arn-rawmime 0.1.10 → 0.1.11

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.10",
3
+ "version": "0.1.11",
4
4
  "description": "A lightweight, dependency-free raw MIME email builder with DKIM support.",
5
5
  "author": "ARNDESK",
6
6
  "type": "module",
@@ -43,7 +43,7 @@ export class MimeMessage {
43
43
  /**
44
44
  * Sets the style of the Message-ID generation.
45
45
  */
46
- setMessageIdStyle(style: "apple_uuid" | "yahoo_mobile" | "yahoo_web" | "gmail_ca" | "outlook_exchange" | "outlook_web" | "samsung_android" | "generic_uuid" | "timestamp_dot" | "generic" | "none"): void;
46
+ setMessageIdStyle(style: "apple_uuid" | "yahoo_mobile" | "yahoo_web" | "gmail_ca" | "outlook_exchange" | "outlook_web" | "samsung_android" | "generic_uuid" | "timestamp_dot" | "icloud_mail" | "android_email" | "google_mx_relay" | "generic" | "none"): void;
47
47
 
48
48
  /**
49
49
  * Sets whether to preserve the exact insertion order of MIME parts.
@@ -10,6 +10,9 @@ export const ALLOWED_MESSAGE_ID_STYLES = [
10
10
  "samsung_android",
11
11
  "generic_uuid",
12
12
  "timestamp_dot",
13
+ "icloud_mail",
14
+ "android_email",
15
+ "google_mx_relay",
13
16
  "generic",
14
17
  "none"
15
18
  ];
@@ -97,6 +100,25 @@ export function generateMessageId(style, domain) {
97
100
  return `<${timestamp}.${rand}@${msgDomain}>`;
98
101
  }
99
102
 
103
+ case "icloud_mail": {
104
+ const prefix = generateRandomString(12).toLowerCase().replace(/=/g, 'a');
105
+ return `<${prefix}@${msgDomain}>`;
106
+ }
107
+
108
+ case "android_email": {
109
+ const prefix = generateRandomString(24).toLowerCase().replace(/=/g, 'z');
110
+ const timestamp = Date.now();
111
+ return `<${prefix}.${timestamp}@email.android.com>`;
112
+ }
113
+
114
+ case "google_mx_relay": {
115
+ const hex1 = randomBytes(4).toString("hex");
116
+ const hex2 = randomBytes(4).toString("hex");
117
+ const hex3 = randomBytes(3).toString("hex");
118
+ const hex4 = randomBytes(2).toString("hex");
119
+ return `<${hex1}.${hex2}.${hex3}.${hex4}@mx.google.com>`;
120
+ }
121
+
100
122
  case "generic":
101
123
  default: {
102
124
  const randStr = generateRandomString(40);