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 +1 -1
- package/src/rawmimeBuilder.d.ts +1 -1
- package/src/rawmimeBuilder.js +8 -1
package/package.json
CHANGED
package/src/rawmimeBuilder.d.ts
CHANGED
|
@@ -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.
|
package/src/rawmimeBuilder.js
CHANGED
|
@@ -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();
|