arn-rawmime 0.1.8 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arn-rawmime",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "A lightweight, dependency-free raw MIME email builder with DKIM support.",
5
5
  "author": "ARNDESK",
6
6
  "type": "module",
@@ -38,7 +38,7 @@ export class MimeMessage {
38
38
  /**
39
39
  * Sets the style of the multipart boundary separator.
40
40
  */
41
- setBoundaryStyle(style: "google" | "outlook" | "apple-mail"): void;
41
+ setBoundaryStyle(style: "google" | "outlook" | "apple-mail" | "yahoo"): void;
42
42
 
43
43
  /**
44
44
  * Sets whether to preserve the exact insertion order of MIME parts.
@@ -38,7 +38,7 @@ class MimeMessage {
38
38
  }
39
39
 
40
40
  setBoundaryStyle(style) {
41
- const allowed = ["google", "outlook", "apple-mail"];
41
+ const allowed = ["google", "outlook", "apple-mail", "yahoo"];
42
42
  if (!allowed.includes(style)) {
43
43
  throw new Error(`Invalid boundary style: ${style}. Allowed: ${allowed.join(", ")}`);
44
44
  }
@@ -610,6 +610,13 @@ class MimeMessage {
610
610
  // Office 365/Outlook format: _000_HashedIDapcp_
611
611
  const middle = randomBytes(24).toString("hex").toUpperCase();
612
612
  return `_000_${middle}apcp_`;
613
+ } else if (this.boundaryStyle === "yahoo") {
614
+ // Yahoo style: ----=_Part_[Part1]_[Part2].[Timestamp]
615
+ // e.g. ----=_Part_1660954_1899761734.1782525050322
616
+ const part1 = Math.floor(Math.random() * 9000000) + 1000000;
617
+ const part2 = Math.floor(Math.random() * 9000000000) + 1000000000;
618
+ const timestamp = Date.now();
619
+ return `----=_Part_${part1}_${part2}.${timestamp}`;
613
620
  } else if (this.boundaryStyle === "apple-mail") {
614
621
  // Apple Mail style: Apple-Mail=_UUID
615
622
  const uuid = randomBytes(16).toString("hex").toUpperCase();