@mavogel/awscdk-rootmail 0.1.4 → 0.1.6

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.
Files changed (195) hide show
  1. package/.jsii +3 -3
  2. package/lib/rootmail.js +1 -1
  3. package/lib/ses-receive.js +1 -1
  4. package/node_modules/@aws-sdk/checksums/package.json +2 -2
  5. package/node_modules/@aws-sdk/client-cloudwatch-logs/dist-cjs/index.js +1 -1
  6. package/node_modules/@aws-sdk/client-cloudwatch-logs/package.json +3 -3
  7. package/node_modules/@aws-sdk/client-route-53/dist-cjs/index.js +1 -1
  8. package/node_modules/@aws-sdk/client-route-53/package.json +3 -3
  9. package/node_modules/@aws-sdk/client-s3/dist-cjs/index.js +38 -15
  10. package/node_modules/@aws-sdk/client-s3/dist-es/models/enums.js +7 -0
  11. package/node_modules/@aws-sdk/client-s3/dist-es/schemas/schemas_0.js +28 -14
  12. package/node_modules/@aws-sdk/client-s3/dist-types/commands/CopyObjectCommand.d.ts +3 -0
  13. package/node_modules/@aws-sdk/client-s3/dist-types/commands/CreateMultipartUploadCommand.d.ts +3 -0
  14. package/node_modules/@aws-sdk/client-s3/dist-types/commands/GetBucketInventoryConfigurationCommand.d.ts +1 -1
  15. package/node_modules/@aws-sdk/client-s3/dist-types/commands/GetBucketNotificationConfigurationCommand.d.ts +3 -3
  16. package/node_modules/@aws-sdk/client-s3/dist-types/commands/GetObjectCommand.d.ts +3 -0
  17. package/node_modules/@aws-sdk/client-s3/dist-types/commands/GetObjectLockConfigurationCommand.d.ts +4 -0
  18. package/node_modules/@aws-sdk/client-s3/dist-types/commands/GetObjectRetentionCommand.d.ts +5 -0
  19. package/node_modules/@aws-sdk/client-s3/dist-types/commands/HeadObjectCommand.d.ts +3 -0
  20. package/node_modules/@aws-sdk/client-s3/dist-types/commands/ListBucketInventoryConfigurationsCommand.d.ts +1 -1
  21. package/node_modules/@aws-sdk/client-s3/dist-types/commands/PutBucketInventoryConfigurationCommand.d.ts +1 -1
  22. package/node_modules/@aws-sdk/client-s3/dist-types/commands/PutBucketNotificationConfigurationCommand.d.ts +3 -3
  23. package/node_modules/@aws-sdk/client-s3/dist-types/commands/PutObjectCommand.d.ts +3 -0
  24. package/node_modules/@aws-sdk/client-s3/dist-types/commands/PutObjectLockConfigurationCommand.d.ts +4 -0
  25. package/node_modules/@aws-sdk/client-s3/dist-types/commands/PutObjectRetentionCommand.d.ts +5 -0
  26. package/node_modules/@aws-sdk/client-s3/dist-types/commands/PutPublicAccessBlockCommand.d.ts +1 -1
  27. package/node_modules/@aws-sdk/client-s3/dist-types/models/enums.d.ts +15 -0
  28. package/node_modules/@aws-sdk/client-s3/dist-types/models/models_0.d.ts +186 -49
  29. package/node_modules/@aws-sdk/client-s3/dist-types/models/models_1.d.ts +43 -1
  30. package/node_modules/@aws-sdk/client-s3/dist-types/schemas/schemas_0.d.ts +1 -0
  31. package/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/PutPublicAccessBlockCommand.d.ts +1 -1
  32. package/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/models/enums.d.ts +8 -0
  33. package/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/models/models_0.d.ts +23 -7
  34. package/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/models/models_1.d.ts +14 -1
  35. package/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/schemas/schemas_0.d.ts +1 -0
  36. package/node_modules/@aws-sdk/client-s3/package.json +6 -6
  37. package/node_modules/@aws-sdk/client-ses/dist-cjs/index.js +1 -1
  38. package/node_modules/@aws-sdk/client-ses/package.json +3 -3
  39. package/node_modules/@aws-sdk/client-ssm/dist-cjs/index.js +1 -1
  40. package/node_modules/@aws-sdk/client-ssm/package.json +3 -3
  41. package/node_modules/@aws-sdk/core/dist-cjs/submodules/util/index.js +5 -0
  42. package/node_modules/@aws-sdk/core/dist-es/submodules/util/hasOwn.js +3 -0
  43. package/node_modules/@aws-sdk/core/dist-es/submodules/util/index.js +1 -0
  44. package/node_modules/@aws-sdk/core/dist-types/submodules/util/hasOwn.d.ts +4 -0
  45. package/node_modules/@aws-sdk/core/dist-types/submodules/util/index.d.ts +1 -0
  46. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/util/hasOwn.d.ts +1 -0
  47. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/util/index.d.ts +1 -0
  48. package/node_modules/@aws-sdk/core/package.json +1 -1
  49. package/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
  50. package/node_modules/@aws-sdk/credential-provider-http/package.json +2 -2
  51. package/node_modules/@aws-sdk/credential-provider-ini/package.json +9 -9
  52. package/node_modules/@aws-sdk/credential-provider-login/package.json +3 -3
  53. package/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
  54. package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
  55. package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
  56. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
  57. package/node_modules/@aws-sdk/middleware-sdk-s3/package.json +2 -2
  58. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
  59. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +1 -1
  60. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
  61. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
  62. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
  63. package/node_modules/@aws-sdk/nested-clients/package.json +2 -2
  64. package/node_modules/@aws-sdk/token-providers/package.json +3 -3
  65. package/node_modules/@zone-eu/mailsplit/package.json +3 -3
  66. package/node_modules/encoding-japanese/LICENSE +25 -1
  67. package/node_modules/encoding-japanese/README.md +86 -51
  68. package/node_modules/encoding-japanese/encoding.js +107 -78
  69. package/node_modules/encoding-japanese/encoding.min.js +2 -2
  70. package/node_modules/encoding-japanese/index.d.ts +102 -0
  71. package/node_modules/encoding-japanese/package.json +26 -17
  72. package/node_modules/encoding-japanese/src/encoding-convert.js +67 -58
  73. package/node_modules/encoding-japanese/src/encoding-table.js +1 -0
  74. package/node_modules/encoding-japanese/src/index.js +1 -1
  75. package/node_modules/encoding-japanese/src/kana-case-table.js +1 -1
  76. package/node_modules/encoding-japanese/src/utf8-to-jis-alias-table.js +14 -0
  77. package/node_modules/encoding-japanese/src/utf8-to-jis-table.js +6 -5
  78. package/node_modules/encoding-japanese/src/utf8-to-jisx0212-table.js +7 -5
  79. package/node_modules/libmime/CHANGELOG.md +7 -0
  80. package/node_modules/libmime/package.json +2 -2
  81. package/node_modules/mailparser/.release-please-manifest.json +1 -1
  82. package/node_modules/mailparser/CHANGELOG.md +42 -0
  83. package/node_modules/mailparser/package.json +5 -5
  84. package/node_modules/nodemailer/CHANGELOG.md +83 -0
  85. package/node_modules/nodemailer/dist/cjs/addressparser/index.d.ts +1 -3
  86. package/node_modules/nodemailer/dist/cjs/addressparser/index.js +176 -13
  87. package/node_modules/nodemailer/dist/cjs/base64/index.d.ts +2 -6
  88. package/node_modules/nodemailer/dist/cjs/base64/index.js +2 -0
  89. package/node_modules/nodemailer/dist/cjs/dkim/index.d.ts +4 -4
  90. package/node_modules/nodemailer/dist/cjs/dkim/message-parser.d.ts +1 -3
  91. package/node_modules/nodemailer/dist/cjs/dkim/message-parser.js +14 -5
  92. package/node_modules/nodemailer/dist/cjs/dkim/relaxed-body.d.ts +3 -22
  93. package/node_modules/nodemailer/dist/cjs/dkim/relaxed-body.js +5 -0
  94. package/node_modules/nodemailer/dist/cjs/dkim/sign.d.ts +5 -5
  95. package/node_modules/nodemailer/dist/cjs/errors.d.ts +8 -8
  96. package/node_modules/nodemailer/dist/cjs/fetch/cookies.d.ts +12 -10
  97. package/node_modules/nodemailer/dist/cjs/fetch/cookies.js +28 -14
  98. package/node_modules/nodemailer/dist/cjs/fetch/index.d.ts +15 -15
  99. package/node_modules/nodemailer/dist/cjs/json-transport/index.d.ts +2 -2
  100. package/node_modules/nodemailer/dist/cjs/mail-composer/index.d.ts +49 -104
  101. package/node_modules/nodemailer/dist/cjs/mail-composer/index.js +14 -3
  102. package/node_modules/nodemailer/dist/cjs/mailer/index.d.ts +21 -28
  103. package/node_modules/nodemailer/dist/cjs/mailer/index.js +19 -5
  104. package/node_modules/nodemailer/dist/cjs/mailer/mail-message.d.ts +8 -12
  105. package/node_modules/nodemailer/dist/cjs/mailer/mail-message.js +4 -1
  106. package/node_modules/nodemailer/dist/cjs/mime-funcs/index.d.ts +1 -1
  107. package/node_modules/nodemailer/dist/cjs/mime-funcs/index.js +4 -1
  108. package/node_modules/nodemailer/dist/cjs/mime-node/index.d.ts +37 -191
  109. package/node_modules/nodemailer/dist/cjs/mime-node/index.js +82 -12
  110. package/node_modules/nodemailer/dist/cjs/mime-node/last-newline.d.ts +1 -3
  111. package/node_modules/nodemailer/dist/cjs/mime-node/last-newline.js +2 -0
  112. package/node_modules/nodemailer/dist/cjs/mime-node/le-unix.d.ts +1 -5
  113. package/node_modules/nodemailer/dist/cjs/mime-node/le-unix.js +1 -0
  114. package/node_modules/nodemailer/dist/cjs/mime-node/le-windows.d.ts +1 -5
  115. package/node_modules/nodemailer/dist/cjs/mime-node/le-windows.js +1 -0
  116. package/node_modules/nodemailer/dist/cjs/nodemailer.d.ts +2 -2
  117. package/node_modules/nodemailer/dist/cjs/package-info.d.ts +1 -1
  118. package/node_modules/nodemailer/dist/cjs/package-info.js +1 -1
  119. package/node_modules/nodemailer/dist/cjs/qp/index.d.ts +2 -5
  120. package/node_modules/nodemailer/dist/cjs/qp/index.js +2 -0
  121. package/node_modules/nodemailer/dist/cjs/sendmail-transport/index.d.ts +4 -6
  122. package/node_modules/nodemailer/dist/cjs/ses-transport/index.d.ts +2 -2
  123. package/node_modules/nodemailer/dist/cjs/ses-transport/index.js +5 -1
  124. package/node_modules/nodemailer/dist/cjs/shared/index.d.ts +31 -37
  125. package/node_modules/nodemailer/dist/cjs/shared/index.js +19 -7
  126. package/node_modules/nodemailer/dist/cjs/smtp-connection/data-stream.d.ts +1 -9
  127. package/node_modules/nodemailer/dist/cjs/smtp-connection/data-stream.js +2 -0
  128. package/node_modules/nodemailer/dist/cjs/smtp-connection/http-proxy-client.d.ts +1 -1
  129. package/node_modules/nodemailer/dist/cjs/smtp-connection/index.d.ts +65 -403
  130. package/node_modules/nodemailer/dist/cjs/smtp-connection/index.js +99 -19
  131. package/node_modules/nodemailer/dist/cjs/smtp-pool/index.d.ts +8 -46
  132. package/node_modules/nodemailer/dist/cjs/smtp-pool/index.js +13 -2
  133. package/node_modules/nodemailer/dist/cjs/smtp-pool/pool-resource.d.ts +2 -4
  134. package/node_modules/nodemailer/dist/cjs/smtp-transport/index.d.ts +16 -16
  135. package/node_modules/nodemailer/dist/cjs/stream-transport/index.d.ts +3 -3
  136. package/node_modules/nodemailer/dist/cjs/well-known/index.d.ts +9 -9
  137. package/node_modules/nodemailer/dist/cjs/well-known/services.js +2 -0
  138. package/node_modules/nodemailer/dist/cjs/xoauth2/index.d.ts +18 -18
  139. package/node_modules/nodemailer/dist/esm/addressparser/index.d.ts +1 -3
  140. package/node_modules/nodemailer/dist/esm/addressparser/index.js +176 -13
  141. package/node_modules/nodemailer/dist/esm/base64/index.d.ts +2 -6
  142. package/node_modules/nodemailer/dist/esm/base64/index.js +2 -0
  143. package/node_modules/nodemailer/dist/esm/dkim/index.d.ts +4 -4
  144. package/node_modules/nodemailer/dist/esm/dkim/message-parser.d.ts +1 -3
  145. package/node_modules/nodemailer/dist/esm/dkim/message-parser.js +14 -5
  146. package/node_modules/nodemailer/dist/esm/dkim/relaxed-body.d.ts +3 -22
  147. package/node_modules/nodemailer/dist/esm/dkim/relaxed-body.js +5 -0
  148. package/node_modules/nodemailer/dist/esm/dkim/sign.d.ts +5 -5
  149. package/node_modules/nodemailer/dist/esm/errors.d.ts +8 -8
  150. package/node_modules/nodemailer/dist/esm/fetch/cookies.d.ts +12 -10
  151. package/node_modules/nodemailer/dist/esm/fetch/cookies.js +25 -14
  152. package/node_modules/nodemailer/dist/esm/fetch/index.d.ts +15 -15
  153. package/node_modules/nodemailer/dist/esm/json-transport/index.d.ts +2 -2
  154. package/node_modules/nodemailer/dist/esm/mail-composer/index.d.ts +49 -104
  155. package/node_modules/nodemailer/dist/esm/mail-composer/index.js +14 -3
  156. package/node_modules/nodemailer/dist/esm/mailer/index.d.ts +21 -28
  157. package/node_modules/nodemailer/dist/esm/mailer/index.js +19 -5
  158. package/node_modules/nodemailer/dist/esm/mailer/mail-message.d.ts +8 -12
  159. package/node_modules/nodemailer/dist/esm/mailer/mail-message.js +4 -1
  160. package/node_modules/nodemailer/dist/esm/mime-funcs/index.d.ts +1 -1
  161. package/node_modules/nodemailer/dist/esm/mime-funcs/index.js +4 -1
  162. package/node_modules/nodemailer/dist/esm/mime-node/index.d.ts +37 -191
  163. package/node_modules/nodemailer/dist/esm/mime-node/index.js +82 -12
  164. package/node_modules/nodemailer/dist/esm/mime-node/last-newline.d.ts +1 -3
  165. package/node_modules/nodemailer/dist/esm/mime-node/last-newline.js +2 -0
  166. package/node_modules/nodemailer/dist/esm/mime-node/le-unix.d.ts +1 -5
  167. package/node_modules/nodemailer/dist/esm/mime-node/le-unix.js +1 -0
  168. package/node_modules/nodemailer/dist/esm/mime-node/le-windows.d.ts +1 -5
  169. package/node_modules/nodemailer/dist/esm/mime-node/le-windows.js +1 -0
  170. package/node_modules/nodemailer/dist/esm/nodemailer.d.ts +2 -2
  171. package/node_modules/nodemailer/dist/esm/package-info.d.ts +1 -1
  172. package/node_modules/nodemailer/dist/esm/package-info.js +1 -1
  173. package/node_modules/nodemailer/dist/esm/qp/index.d.ts +2 -5
  174. package/node_modules/nodemailer/dist/esm/qp/index.js +2 -0
  175. package/node_modules/nodemailer/dist/esm/sendmail-transport/index.d.ts +4 -6
  176. package/node_modules/nodemailer/dist/esm/ses-transport/index.d.ts +2 -2
  177. package/node_modules/nodemailer/dist/esm/ses-transport/index.js +5 -1
  178. package/node_modules/nodemailer/dist/esm/shared/index.d.ts +31 -37
  179. package/node_modules/nodemailer/dist/esm/shared/index.js +19 -7
  180. package/node_modules/nodemailer/dist/esm/smtp-connection/data-stream.d.ts +1 -9
  181. package/node_modules/nodemailer/dist/esm/smtp-connection/data-stream.js +2 -0
  182. package/node_modules/nodemailer/dist/esm/smtp-connection/http-proxy-client.d.ts +1 -1
  183. package/node_modules/nodemailer/dist/esm/smtp-connection/index.d.ts +65 -403
  184. package/node_modules/nodemailer/dist/esm/smtp-connection/index.js +99 -19
  185. package/node_modules/nodemailer/dist/esm/smtp-pool/index.d.ts +8 -46
  186. package/node_modules/nodemailer/dist/esm/smtp-pool/index.js +13 -2
  187. package/node_modules/nodemailer/dist/esm/smtp-pool/pool-resource.d.ts +2 -4
  188. package/node_modules/nodemailer/dist/esm/smtp-transport/index.d.ts +16 -16
  189. package/node_modules/nodemailer/dist/esm/stream-transport/index.d.ts +3 -3
  190. package/node_modules/nodemailer/dist/esm/well-known/index.d.ts +9 -9
  191. package/node_modules/nodemailer/dist/esm/well-known/services.js +2 -0
  192. package/node_modules/nodemailer/dist/esm/xoauth2/index.d.ts +18 -18
  193. package/node_modules/nodemailer/dist/well-known/services.json +2 -2
  194. package/node_modules/nodemailer/package.json +6 -6
  195. package/package.json +1 -1
@@ -8,11 +8,11 @@ import type { default as Mail, SentMessageInfo, SendMailOptions, TransportOption
8
8
  */
9
9
  export interface StreamTransportOptions extends TransportOptions {
10
10
  /** Selects this transport in createTransport */
11
- streamTransport?: boolean;
11
+ streamTransport?: boolean | undefined;
12
12
  /** If true, the message is returned as a Buffer object instead of a stream */
13
- buffer?: boolean;
13
+ buffer?: boolean | undefined;
14
14
  /** Either 'windows' or 'unix', the line ending of the generated message */
15
- newline?: string;
15
+ newline?: string | undefined;
16
16
  }
17
17
  /**
18
18
  * The value the Stream transport hands to the send callback
@@ -3,23 +3,23 @@
3
3
  */
4
4
  export interface WellKnownServiceDefinition {
5
5
  /** Human readable description of the service */
6
- description?: string;
6
+ description?: string | undefined;
7
7
  /** Domains of e-mail addresses hosted by the service */
8
- domains?: string[];
8
+ domains?: string[] | undefined;
9
9
  /** Alternative names the service can be looked up by */
10
- aliases?: string[];
10
+ aliases?: string[] | undefined;
11
11
  /** SMTP hostname */
12
- host?: string;
12
+ host?: string | undefined;
13
13
  /** SMTP port (a numeric string in a few entries) */
14
- port?: number | string;
14
+ port?: number | string | undefined;
15
15
  /** true for implicit TLS (usually port 465) */
16
- secure?: boolean;
16
+ secure?: boolean | undefined;
17
17
  /** Preferred authentication method */
18
- authMethod?: string;
18
+ authMethod?: string | undefined;
19
19
  /** Set to true to require STARTTLS on a plaintext connection */
20
- requireTLS?: boolean;
20
+ requireTLS?: boolean | undefined;
21
21
  /** Set to true to skip STARTTLS */
22
- ignoreTLS?: boolean;
22
+ ignoreTLS?: boolean | undefined;
23
23
  }
24
24
  /**
25
25
  * SMTP settings of a well-known service, without the lookup keys
@@ -119,6 +119,7 @@ exports.services = {
119
119
  "FastMail": {
120
120
  "description": "FastMail",
121
121
  "domains": [
122
+ "fastmail.com",
122
123
  "fastmail.fm"
123
124
  ],
124
125
  "host": "smtp.fastmail.com",
@@ -232,6 +233,7 @@ exports.services = {
232
233
  "Mac"
233
234
  ],
234
235
  "domains": [
236
+ "icloud.com",
235
237
  "me.com",
236
238
  "mac.com"
237
239
  ],
@@ -25,50 +25,50 @@ export type XOAuth2PrivateKey = crypto.KeyLike | crypto.SignKeyObjectInput | cry
25
25
  */
26
26
  export interface XOAuth2Options {
27
27
  /** User e-mail address */
28
- user?: string;
28
+ user?: string | undefined;
29
29
  /** Client ID value */
30
- clientId?: string;
30
+ clientId?: string | undefined;
31
31
  /** Client secret value */
32
- clientSecret?: string;
32
+ clientSecret?: string | undefined;
33
33
  /** Refresh token for an user */
34
- refreshToken?: string;
34
+ refreshToken?: string | undefined;
35
35
  /** Endpoint for token generation, defaults to 'https://accounts.google.com/o/oauth2/token' */
36
- accessUrl?: string;
36
+ accessUrl?: string | undefined;
37
37
  /** An existing valid accessToken */
38
- accessToken?: string;
38
+ accessToken?: string | undefined;
39
39
  /** Private key for JSW */
40
- privateKey?: XOAuth2PrivateKey;
40
+ privateKey?: XOAuth2PrivateKey | undefined;
41
41
  /** Optional Access Token expire time in ms */
42
- expires?: number;
42
+ expires?: number | undefined;
43
43
  /** Optional TTL for Access Token in seconds */
44
- timeout?: number;
44
+ timeout?: number | undefined;
45
45
  /** Function to run when a new access token is required */
46
- provisionCallback?: XOAuth2ProvisionCallback;
46
+ provisionCallback?: XOAuth2ProvisionCallback | undefined;
47
47
  /** Optional TLS options forwarded to the HTTPS token request. Defaults to strict cert validation; supply { rejectUnauthorized: false } only for self-hosted OAuth providers on private CAs. */
48
48
  tls?: {
49
49
  [key: string]: any;
50
- };
50
+ } | undefined;
51
51
  /** Service account client id (the JWT issuer), switches to the JWT bearer flow */
52
- serviceClient?: string;
52
+ serviceClient?: string | undefined;
53
53
  /** Lifetime of the service account JWT in seconds, defaults to 5 minutes, capped at an hour */
54
- serviceRequestTimeout?: number;
54
+ serviceRequestTimeout?: number | undefined;
55
55
  /** OAuth2 scope for the service account flow, defaults to 'https://mail.google.com/' */
56
- scope?: string;
56
+ scope?: string | undefined;
57
57
  /** Logger component name, defaults to 'OAuth2' */
58
- component?: string;
58
+ component?: string | undefined;
59
59
  /** Extra headers for the token request */
60
- customHeaders?: OutgoingHttpHeaders;
60
+ customHeaders?: OutgoingHttpHeaders | undefined;
61
61
  /** Extra form fields for the token request */
62
62
  customParams?: {
63
63
  [key: string]: any;
64
- };
64
+ } | undefined;
65
65
  }
66
66
  /**
67
67
  * The object emitted with the 'token' event once a new access token has been generated
68
68
  */
69
69
  export interface XOAuth2Token {
70
70
  /** User e-mail address */
71
- user?: string;
71
+ user?: string | undefined;
72
72
  /** The new access token */
73
73
  accessToken: string;
74
74
  /** Expire time as a timestamp in milliseconds, 0 when unknown */
@@ -3,9 +3,7 @@
3
3
  */
4
4
  export interface AddressParserOptions {
5
5
  /** Flatten groups into a single list of mailboxes */
6
- flatten?: boolean;
7
- /** Internal recursion depth counter (do not set manually) */
8
- _depth?: number;
6
+ flatten?: boolean | undefined;
9
7
  }
10
8
  /**
11
9
  * A single mailbox. Either value may be an empty string when the input did not carry it
@@ -47,6 +47,134 @@ const ADDR_SPEC = /^[^@\s]+@[^@\s]+$/;
47
47
  * further '@' that a domain should not have but malformed headers carry anyway.
48
48
  */
49
49
  const LOOSE_ADDR_SPEC = /^[^@\s]+@\S+$/;
50
+ /**
51
+ * An addr-spec sitting inside free text, together with the whitespace around it. Sticky
52
+ * on purpose: it is run at the one offset _looseAddressStart picks rather than being let
53
+ * loose to search, see there.
54
+ */
55
+ const LOOSE_TEXT_ADDR = /\s*\b[^@\s]+@[^\s]+\b\s*/y;
56
+ /**
57
+ * The characters JS `\s` matches, which the scan below has to agree with to land on the
58
+ * same match the pattern would.
59
+ */
60
+ function _isSpaceCode(code) {
61
+ return (code === 0x20 ||
62
+ (code >= 0x09 && code <= 0x0d) ||
63
+ code === 0xa0 ||
64
+ code === 0x1680 ||
65
+ (code >= 0x2000 && code <= 0x200a) ||
66
+ code === 0x2028 ||
67
+ code === 0x2029 ||
68
+ code === 0x202f ||
69
+ code === 0x205f ||
70
+ code === 0x3000 ||
71
+ code === 0xfeff);
72
+ }
73
+ /**
74
+ * The characters JS `\w` matches without the unicode flag, the set the `\b` in
75
+ * LOOSE_TEXT_ADDR is read against. charCodeAt off either end of the string gives NaN,
76
+ * which compares false throughout, so out of range reads as the non-word the pattern
77
+ * treats them as.
78
+ */
79
+ function _isWordCode(code) {
80
+ return (code >= 0x30 && code <= 0x39) || (code >= 0x41 && code <= 0x5a) || (code >= 0x61 && code <= 0x7a) || code === 0x5f;
81
+ }
82
+ /**
83
+ * Whether `\b` holds at an offset
84
+ */
85
+ function _isBoundary(text, at) {
86
+ return _isWordCode(text.charCodeAt(at - 1)) !== _isWordCode(text.charCodeAt(at));
87
+ }
88
+ /**
89
+ * Offset of the first '@' in `text` between `from` and `to`, or -1 when the range holds none.
90
+ *
91
+ * indexOf would scan on to the end of the value, and the value here is a whole header. The
92
+ * walk below steps one whitespace delimited run at a time and only ever uses a '@' that sits
93
+ * inside the run it is on, so an unbounded probe rescans everything behind that run once per
94
+ * run and grows with the square of the header: 400KB of free text carrying no '@' took a
95
+ * quarter of a second. GHSA-v53p-9fqp-m79j took the pattern search out of this walk and left
96
+ * the probe unbounded behind it.
97
+ *
98
+ * @param text Text to look in
99
+ * @param from Offset to start at
100
+ * @param to Offset to stop before
101
+ * @return Offset of the '@', or -1
102
+ */
103
+ function _indexOfAt(text, from, to) {
104
+ for (let i = from; i < to; i++) {
105
+ if (text.charCodeAt(i) === 0x40) {
106
+ return i;
107
+ }
108
+ }
109
+ return -1;
110
+ }
111
+ /**
112
+ * Finds the offset LOOSE_TEXT_ADDR matches at, or -1 when it does not match at all.
113
+ *
114
+ * Letting the pattern search for itself is quadratic: '[^@\s]+' is retried from every
115
+ * offset and rescans the run to the next '@' each time, so 140KB of header holding no
116
+ * usable '@' blocks the event loop for about ten seconds (GHSA-v53p-9fqp-m79j). The search is also unnecessary.
117
+ * '[^@\s]+' crosses neither whitespace nor a '@', so a match can only begin at the head of
118
+ * a whitespace delimited run or just past a '@' inside one, and '[^\s]+\b' gives characters
119
+ * back until it lands on a boundary, so the only end it can take in that run is the last
120
+ * boundary in it. Both are found in one pass, and the pattern is then run at that single
121
+ * offset.
122
+ *
123
+ * @param text Free text to look in
124
+ * @return Offset to match at, or -1
125
+ */
126
+ function _looseAddressStart(text) {
127
+ const len = text.length;
128
+ let pos = 0;
129
+ while (pos < len) {
130
+ while (pos < len && _isSpaceCode(text.charCodeAt(pos))) {
131
+ pos++;
132
+ }
133
+ if (pos >= len) {
134
+ break;
135
+ }
136
+ const runStart = pos;
137
+ let runEnd = pos;
138
+ while (runEnd < len && !_isSpaceCode(text.charCodeAt(runEnd))) {
139
+ runEnd++;
140
+ }
141
+ let at = _indexOfAt(text, runStart, runEnd);
142
+ if (at >= 0) {
143
+ let lastBoundary = -1;
144
+ for (let k = runEnd; k > runStart; k--) {
145
+ if (_isBoundary(text, k)) {
146
+ lastBoundary = k;
147
+ break;
148
+ }
149
+ }
150
+ let atomStart = runStart;
151
+ while (lastBoundary >= 0 && at >= 0) {
152
+ // '[^@\s]+' has to cover a character before the '@' and '[^\s]+' one after it,
153
+ // and the boundary that ends the match has to sit past both
154
+ if (at > atomStart && runEnd > at + 1 && lastBoundary > at + 1) {
155
+ for (let start = atomStart; start < at; start++) {
156
+ if (_isBoundary(text, start)) {
157
+ if (start > runStart) {
158
+ return start;
159
+ }
160
+ // the leading '\s*' is greedy, so a match that begins at the run
161
+ // takes the whitespace in front of it along
162
+ let padded = runStart;
163
+ while (padded > 0 && _isSpaceCode(text.charCodeAt(padded - 1))) {
164
+ padded--;
165
+ }
166
+ return padded;
167
+ }
168
+ }
169
+ }
170
+ atomStart = at + 1;
171
+ at = _indexOfAt(text, atomStart, runEnd);
172
+ }
173
+ }
174
+ pos = runEnd;
175
+ }
176
+ return -1;
177
+ }
50
178
  /**
51
179
  * Recovers the addr-spec from an angle-addr that came back holding unquoted whitespace.
52
180
  *
@@ -131,6 +259,12 @@ function _handleAddress(tokens, depth) {
131
259
  textWasQuoted: []
132
260
  };
133
261
  let insideQuotes = false;
262
+ // Last character of the run each state is currently accumulating. Reading it back off
263
+ // the accumulator with slice(-1) makes the engine flatten the whole growing string on
264
+ // every token, which is quadratic over an address built from many comment-joined atoms
265
+ // (GHSA-prgh-xp8r-p3m5). A run only ever grows by the token appended below, so the
266
+ // character is carried along instead of re-read.
267
+ const lastChars = { address: '', comment: '', group: '', text: '' };
134
268
  // Filter out <addresses>, (comments) and regular text
135
269
  for (let i = 0, len = tokens.length; i < len; i++) {
136
270
  const token = tokens[i];
@@ -161,6 +295,19 @@ function _handleAddress(tokens, depth) {
161
295
  }
162
296
  }
163
297
  else if (token.value) {
298
+ // An empty quoted string is dropped by the tokenizer, leaving no text token of its
299
+ // own for textWasQuoted to be recorded on, so the pair of quote operators right in
300
+ // front of this token is all that is left of it and the run it opens carries the
301
+ // quoting instead. Without this '""@example.com' reads as the bare '@example.com',
302
+ // the quotes never go back on, and the value is no longer an addr-spec a trailing
303
+ // comment can be peeled off of. It only ever opens a run: a run that already holds
304
+ // material collected outside the quotes is not a quoted string, whatever follows it
305
+ const prevPrevToken = i > 1 ? tokens[i - 2] : null;
306
+ const opensAfterEmptyQuotedString = prevToken?.type === 'operator' &&
307
+ prevToken.value === '"' &&
308
+ !!prevToken.noBreak &&
309
+ prevPrevToken?.type === 'operator' &&
310
+ prevPrevToken.value === '"';
164
311
  if (state === 'address') {
165
312
  // Handle unquoted name that includes a "<".
166
313
  // Apple Mail truncates everything between an unexpected < and an address.
@@ -174,17 +321,21 @@ function _handleAddress(tokens, depth) {
174
321
  const joins = prevToken &&
175
322
  prevToken.noBreak &&
176
323
  parts.length &&
177
- (prevToken.value !== ')' || parts[parts.length - 1].slice(-1) === '@' || token.value.charAt(0) === '@');
324
+ (prevToken.value !== ')' || lastChars[state] === '@' || token.value.charAt(0) === '@');
178
325
  if (joins) {
179
326
  data[state][data[state].length - 1] += token.value;
327
+ if (token.value) {
328
+ lastChars[state] = token.value.charAt(token.value.length - 1);
329
+ }
180
330
  if (state === 'text' && insideQuotes) {
181
331
  data.textWasQuoted[data.textWasQuoted.length - 1] = true;
182
332
  }
183
333
  }
184
334
  else {
185
335
  data[state].push(token.value);
336
+ lastChars[state] = token.value.charAt(token.value.length - 1);
186
337
  if (state === 'text') {
187
- data.textWasQuoted.push(insideQuotes);
338
+ data.textWasQuoted.push(insideQuotes || opensAfterEmptyQuotedString);
188
339
  }
189
340
  }
190
341
  }
@@ -234,16 +385,19 @@ function _handleAddress(tokens, depth) {
234
385
  for (let i = data.text.length - 1; i >= 0; i--) {
235
386
  // Security: Do not extract email addresses from quoted strings
236
387
  if (!data.textWasQuoted[i]) {
237
- data.text[i] = data.text[i]
238
- .replace(/\s*\b[^@\s]+@[^\s]+\b\s*/, (match) => {
239
- if (!extracted) {
240
- data.address = [match.trim()];
388
+ const part = data.text[i];
389
+ let remainder = part;
390
+ const at = _looseAddressStart(part);
391
+ if (at >= 0) {
392
+ LOOSE_TEXT_ADDR.lastIndex = at;
393
+ const match = LOOSE_TEXT_ADDR.exec(part);
394
+ if (match) {
395
+ data.address = [match[0].trim()];
241
396
  extracted = true;
242
- return ' ';
397
+ remainder = part.slice(0, at) + ' ' + part.slice(at + match[0].length);
243
398
  }
244
- return match;
245
- })
246
- .trim();
399
+ }
400
+ data.text[i] = remainder.trim();
247
401
  if (extracted) {
248
402
  break;
249
403
  }
@@ -266,6 +420,18 @@ function _handleAddress(tokens, depth) {
266
420
  // Join values with spaces
267
421
  data.text = data.text.join(' ');
268
422
  data.address = data.address.join(' ');
423
+ if (addressFromQuotedText && data.text) {
424
+ // The mailbox is still sitting in the text, so it moves over here and is quoted
425
+ // before the recovery below rather than after it. Anything else the text holds
426
+ // came along with it: a comment ends the domain but leaves the atoms behind it in
427
+ // the same text, and '"user"@example.com(x)evil.com' was handed on as the address
428
+ // 'user@example.com evil.com', a second domain riding into the envelope recipient
429
+ // on a value that is no addr-spec at all (GHSA-g57g-f23g-4646). Putting the quotes
430
+ // back first is what lets the recovery tell the whitespace an addr-spec may carry
431
+ // from the wreckage trailing one, as only a quoted local part may hold whitespace
432
+ data.address = _quoteLocalPart(data.text);
433
+ data.text = '';
434
+ }
269
435
  _recoverAddrSpec(data);
270
436
  const address = {
271
437
  address: data.address || data.text || '',
@@ -279,9 +445,6 @@ function _handleAddress(tokens, depth) {
279
445
  address.address = '';
280
446
  }
281
447
  }
282
- if (addressFromQuotedText && address.address) {
283
- address.address = _quoteLocalPart(address.address);
284
- }
285
448
  addresses.push(address);
286
449
  }
287
450
  return addresses;
@@ -1,4 +1,4 @@
1
- import { Transform, type TransformCallback } from 'node:stream';
1
+ import { Transform } from 'node:stream';
2
2
  /**
3
3
  * Encodes a Buffer into a base64 encoded string
4
4
  *
@@ -19,7 +19,7 @@ export declare function wrap(str: string, lineLength?: number | false): string;
19
19
  */
20
20
  export interface EncoderOptions {
21
21
  /** Maximum length for lines, set to false to disable wrapping */
22
- lineLength?: number | false;
22
+ lineLength?: number | false | undefined;
23
23
  }
24
24
  /**
25
25
  * Creates a transform stream for encoding data to base64 encoding
@@ -32,9 +32,5 @@ export declare class Encoder extends Transform {
32
32
  options: EncoderOptions;
33
33
  inputBytes: number;
34
34
  outputBytes: number;
35
- _curLine: string;
36
- _remainingBytes: Buffer | false;
37
35
  constructor(options?: EncoderOptions);
38
- _transform(chunk: Buffer | string, encoding: BufferEncoding | 'buffer', done: TransformCallback): void;
39
- _flush(done: TransformCallback): void;
40
36
  }
@@ -54,6 +54,7 @@ export class Encoder extends Transform {
54
54
  this.inputBytes = 0;
55
55
  this.outputBytes = 0;
56
56
  }
57
+ /** @internal */
57
58
  _transform(chunk, encoding, done) {
58
59
  let buf = encoding !== 'buffer' ? Buffer.from(chunk, encoding) : chunk;
59
60
  if (!buf || !buf.length) {
@@ -95,6 +96,7 @@ export class Encoder extends Transform {
95
96
  }
96
97
  setImmediate(done);
97
98
  }
99
+ /** @internal */
98
100
  _flush(done) {
99
101
  if (this._remainingBytes && this._remainingBytes.length) {
100
102
  this._curLine += encode(this._remainingBytes);
@@ -9,13 +9,13 @@ export type { DKIMKey, DKIMPrivateKey, DKIMSignOptions };
9
9
  */
10
10
  export interface DKIMOptions extends DKIMSignOptions {
11
11
  /** One or more signing keys, used instead of the domainName, keySelector and privateKey options */
12
- keys?: DKIMKey | DKIMKey[];
12
+ keys?: DKIMKey | DKIMKey[] | undefined;
13
13
  /** Directory for buffering large message bodies to disk, no buffering when not set */
14
- cacheDir?: string | false;
14
+ cacheDir?: string | false | undefined;
15
15
  /** Body size in bytes from which the body is buffered to cacheDir, defaults to 10 MB */
16
- cacheTreshold?: number;
16
+ cacheTreshold?: number | undefined;
17
17
  /** Hash algorithm for the body hash and the signature, defaults to sha256 */
18
- hashAlgo?: string;
18
+ hashAlgo?: string | undefined;
19
19
  }
20
20
  /**
21
21
  * The signed message as returned by DKIM#sign
@@ -1,4 +1,4 @@
1
- import { Transform, type TransformCallback, type TransformOptions } from 'node:stream';
1
+ import { Transform, type TransformOptions } from 'node:stream';
2
2
  /**
3
3
  * A header line as emitted with the 'headers' event
4
4
  */
@@ -35,7 +35,5 @@ export default class MessageParser extends Transform {
35
35
  * @return Returns true if headers are already found or false otherwise
36
36
  */
37
37
  checkHeaders(data: Buffer): boolean;
38
- _transform(chunk: Buffer | string, encoding: BufferEncoding, callback: TransformCallback): void;
39
- _flush(callback: TransformCallback): void;
40
38
  parseHeaders(): MessageParserHeaderLine[];
41
39
  }
@@ -88,6 +88,7 @@ export default class MessageParser extends Transform {
88
88
  this.updateLastBytes(data);
89
89
  return false;
90
90
  }
91
+ /** @internal */
91
92
  _transform(chunk, encoding, callback) {
92
93
  if (!chunk || !chunk.length) {
93
94
  return callback();
@@ -108,6 +109,7 @@ export default class MessageParser extends Transform {
108
109
  }
109
110
  setImmediate(callback);
110
111
  }
112
+ /** @internal */
111
113
  _flush(callback) {
112
114
  if (this.headerChunks) {
113
115
  // no empty line was seen, so the message consists of headers only
@@ -122,11 +124,18 @@ export default class MessageParser extends Transform {
122
124
  // signature covers exactly the bytes the receiving side canonicalizes
123
125
  // Only SP and HTAB fold a line, and only they are trimmed from the field name, the
124
126
  // same whitespace the relaxed canonicalization in sign.ts works with
125
- const lines = (this.rawHeaders || Buffer.alloc(0)).toString('binary').split(/\r?\n/);
126
- for (let i = lines.length - 1; i > 0; i--) {
127
- if (/^[ \t]/.test(lines[i])) {
128
- lines[i - 1] += '\n' + lines[i];
129
- lines.splice(i, 1);
127
+ const rawLines = (this.rawHeaders || Buffer.alloc(0)).toString('binary').split(/\r?\n/);
128
+ // Unfold in a single forward pass and only ever test a freshly split line for the
129
+ // continuation prefix. Testing an already merged line instead would rescan a string
130
+ // that grows with every continuation line, so a header folded into many continuation
131
+ // lines (a large recipient list, for example) would take quadratic time to unfold
132
+ const lines = [];
133
+ for (const rawLine of rawLines) {
134
+ if (lines.length && /^[ \t]/.test(rawLine)) {
135
+ lines[lines.length - 1] += '\n' + rawLine;
136
+ }
137
+ else {
138
+ lines.push(rawLine);
130
139
  }
131
140
  }
132
141
  return lines
@@ -1,13 +1,13 @@
1
- import { Transform, type TransformCallback } from 'node:stream';
1
+ import { Transform } from 'node:stream';
2
2
  import crypto from 'node:crypto';
3
3
  /**
4
4
  * Options for the relaxed body hash stream
5
5
  */
6
6
  export interface RelaxedBodyOptions {
7
7
  /** Hash algorithm for the body hash, defaults to sha256 */
8
- hashAlgo?: string;
8
+ hashAlgo?: string | undefined;
9
9
  /** Collect the canonicalized body and emit it with the 'hash' event */
10
- debug?: boolean;
10
+ debug?: boolean | undefined;
11
11
  }
12
12
  /**
13
13
  * Passes the message body through unchanged and hashes its relaxed
@@ -22,25 +22,6 @@ export default class RelaxedBody extends Transform {
22
22
  /** Bytes of the original body seen so far */
23
23
  byteLength: number;
24
24
  debug: boolean | undefined;
25
- _debugBody: Buffer[] | false;
26
- /** The current line has bytes that survive canonicalization */
27
- _lineHasContent: boolean;
28
- /** Whitespace that ends up as a single space if more content follows on the line */
29
- _pendingWsp: boolean;
30
- /** A CR that is part of the line ending if LF follows, otherwise content */
31
- _pendingCr: boolean;
32
- /** Empty lines that are hashed only once a non-empty line follows them */
33
- _pendingEmptyLines: number;
34
25
  constructor(options?: RelaxedBodyOptions);
35
- _hashCanonical(data: Buffer): void;
36
- _hashEmptyLines(): void;
37
- /**
38
- * Writes a content byte, with the space a pending run of whitespace collapses to,
39
- * into the output buffer and returns the new write position. Kept a method rather
40
- * than a closure so the write position stays a plain local in the byte loop
41
- */
42
- _emitContent(out: Buffer, outPos: number, c: number): number;
43
26
  updateHash(chunk: Buffer, final?: boolean): void;
44
- _transform(chunk: Buffer | string, encoding: BufferEncoding, callback: TransformCallback): void;
45
- _flush(callback: TransformCallback): void;
46
27
  }
@@ -29,6 +29,7 @@ export default class RelaxedBody extends Transform {
29
29
  this._pendingCr = false;
30
30
  this._pendingEmptyLines = 0;
31
31
  }
32
+ /** @internal */
32
33
  _hashCanonical(data) {
33
34
  if (!data.length) {
34
35
  return;
@@ -38,6 +39,7 @@ export default class RelaxedBody extends Transform {
38
39
  this._debugBody.push(Buffer.from(data));
39
40
  }
40
41
  }
42
+ /** @internal */
41
43
  _hashEmptyLines() {
42
44
  while (this._pendingEmptyLines > 0) {
43
45
  const count = Math.min(this._pendingEmptyLines, EMPTY_LINES.length / 2);
@@ -49,6 +51,7 @@ export default class RelaxedBody extends Transform {
49
51
  * Writes a content byte, with the space a pending run of whitespace collapses to,
50
52
  * into the output buffer and returns the new write position. Kept a method rather
51
53
  * than a closure so the write position stays a plain local in the byte loop
54
+ * @internal
52
55
  */
53
56
  _emitContent(out, outPos, c) {
54
57
  if (!this._lineHasContent) {
@@ -111,6 +114,7 @@ export default class RelaxedBody extends Transform {
111
114
  }
112
115
  this._hashCanonical(out.subarray(0, outPos));
113
116
  }
117
+ /** @internal */
114
118
  _transform(chunk, encoding, callback) {
115
119
  if (!chunk || !chunk.length) {
116
120
  return callback();
@@ -123,6 +127,7 @@ export default class RelaxedBody extends Transform {
123
127
  this.push(chunk);
124
128
  callback();
125
129
  }
130
+ /** @internal */
126
131
  _flush(callback) {
127
132
  this.updateHash(Buffer.alloc(0), true);
128
133
  if (this._lineHasContent) {
@@ -10,17 +10,17 @@ export type DKIMPrivateKey = crypto.KeyLike | crypto.SignKeyObjectInput | crypto
10
10
  */
11
11
  export interface DKIMKey {
12
12
  /** Domain name to be signed for */
13
- domainName?: string;
13
+ domainName?: string | undefined;
14
14
  /** DKIM key selector to use */
15
- keySelector?: string;
15
+ keySelector?: string | undefined;
16
16
  /** DKIM private key to use */
17
- privateKey?: DKIMPrivateKey;
17
+ privateKey?: DKIMPrivateKey | undefined;
18
18
  }
19
19
  export interface DKIMSignOptions extends DKIMKey {
20
20
  /** Colon separated list of header field names to sign, defaults to the RFC4871 list */
21
- headerFieldNames?: string;
21
+ headerFieldNames?: string | undefined;
22
22
  /** Colon separated list of header field names to leave out of the signature */
23
- skipFields?: string;
23
+ skipFields?: string | undefined;
24
24
  }
25
25
  /**
26
26
  * Canonicalized headers and the list of field names that went into them
@@ -68,21 +68,21 @@ export declare const EFETCH = "EFETCH";
68
68
  */
69
69
  export interface NodemailerError extends Error {
70
70
  /** Nodemailer error code, see ERROR_CODES */
71
- code?: string;
71
+ code?: string | undefined;
72
72
  /** SMTP command that was in flight when the server replied with an error */
73
- command?: string;
73
+ command?: string | undefined;
74
74
  /** Raw SMTP server response */
75
- response?: string;
75
+ response?: string | undefined;
76
76
  /** Numeric SMTP response code */
77
- responseCode?: number;
77
+ responseCode?: number | undefined;
78
78
  /** URL of the resource that could not be fetched */
79
- sourceUrl?: string;
79
+ sourceUrl?: string | undefined;
80
80
  /** Recipient address the error applies to */
81
- recipient?: string;
81
+ recipient?: string | undefined;
82
82
  /** Recipient addresses rejected by the server */
83
- rejected?: string[];
83
+ rejected?: string[] | undefined;
84
84
  /** Per-recipient errors for the rejected addresses */
85
- rejectedErrors?: NodemailerError[];
85
+ rejectedErrors?: NodemailerError[] | undefined;
86
86
  }
87
87
  /**
88
88
  * Node style callback: called with an error, or with null and the result