///|
pub fn simple_plain_eml() -> String {
"From: Fu Haohao \r\n" +
"To: MoonBit Team \r\n" +
"Subject: Hello MoonMailKit\r\n" +
"Date: Tue, 11 Aug 2026 10:00:00 +0800\r\n" +
"Message-ID: \r\n" +
"Content-Type: text/plain; charset=utf-8\r\n" +
"\r\n" +
"Hello from MoonBit mail parser.\r\n"
}
///|
pub fn quoted_printable_eml() -> String {
"From: Fu \r\n" +
"To: Dev \r\n" +
"Subject: Encoded body\r\n" +
"Content-Type: text/plain; charset=utf-8\r\n" +
"Content-Transfer-Encoding: quoted-printable\r\n" +
"\r\n" +
"Hello=20MoonBit=21\r\n"
}
///|
pub fn base64_eml() -> String {
"From: Fu \r\n" +
"To: Dev \r\n" +
"Subject: Base64 body\r\n" +
"Content-Type: text/plain; charset=utf-8\r\n" +
"Content-Transfer-Encoding: base64\r\n" +
"\r\n" +
"SGVsbG8gTW9vbkJpdCE=\r\n"
}
///|
pub fn multipart_alternative_eml() -> String {
"From: Fu \r\n" +
"To: Dev \r\n" +
"Subject: Multipart alternative\r\n" +
"Content-Type: multipart/alternative; boundary=\"alt-123\"\r\n" +
"\r\n" +
"--alt-123\r\n" +
"Content-Type: text/plain; charset=utf-8\r\n" +
"\r\n" +
"Plain body\r\n" +
"--alt-123\r\n" +
"Content-Type: text/html; charset=utf-8\r\n" +
"\r\n" +
"HTML body
\r\n" +
"--alt-123--\r\n"
}
///|
pub fn multipart_mixed_with_attachment_eml() -> String {
"From: Fu \r\n" +
"To: Dev \r\n" +
"Subject: Attachment demo\r\n" +
"Content-Type: multipart/mixed; boundary=\"mix-123\"\r\n" +
"\r\n" +
"--mix-123\r\n" +
"Content-Type: text/plain; charset=utf-8\r\n" +
"\r\n" +
"Please see attachment.\r\n" +
"--mix-123\r\n" +
"Content-Type: text/plain; name=\"note.txt\"\r\n" +
"Content-Disposition: attachment; filename=\"note.txt\"\r\n" +
"Content-Transfer-Encoding: base64\r\n" +
"\r\n" +
"Tm90ZSBmcm9tIE1vb25CaXQu\r\n" +
"--mix-123--\r\n"
}
///|
pub fn suspicious_attachment_eml() -> String {
"From: Fu \r\n" +
"To: Dev \r\n" +
"Subject: Suspicious attachment\r\n" +
"Content-Type: multipart/mixed; boundary=\"mix-risk\"\r\n" +
"\r\n" +
"--mix-risk\r\n" +
"Content-Type: text/plain; charset=utf-8\r\n" +
"\r\n" +
"Please check this file.\r\n" +
"--mix-risk\r\n" +
"Content-Type: application/octet-stream; name=\"setup.exe\"\r\n" +
"Content-Disposition: attachment; filename=\"setup.exe\"\r\n" +
"Content-Transfer-Encoding: base64\r\n" +
"\r\n" +
"AAECAwQF\r\n" +
"--mix-risk--\r\n"
}
///|
pub fn missing_boundary_eml() -> String {
"From: Fu \r\n" +
"To: Dev \r\n" +
"Subject: Broken multipart\r\n" +
"Content-Type: multipart/mixed\r\n" +
"\r\n" +
"This body cannot be split safely.\r\n"
}
///|
pub fn authenticated_route_eml() -> String {
"Received: from client.example (client.example [192.0.2.10]) by mx.example with ESMTPS id abc123; Tue, 11 Aug 2026 10:00:00 +0800\r\n" +
"Received: from app.example by client.example with SMTP id def456; Tue, 11 Aug 2026 09:59:00 +0800\r\n" +
"Authentication-Results: mx.example; spf=pass smtp.mailfrom=example.com; dkim=pass header.d=example.com; dmarc=pass header.from=example.com\r\n" +
"From: Fu \r\n" +
"To: Dev \r\n" +
"Subject: Authenticated route\r\n" +
"Content-Type: text/html; charset=utf-8\r\n" +
"\r\n" +
"Visit https://example.com/report.
\r\n"
}