@mavogel/awscdk-rootmail 0.1.3 → 0.1.5

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 (179) hide show
  1. package/.jsii +2 -2
  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/mailparser/.release-please-manifest.json +1 -1
  66. package/node_modules/mailparser/CHANGELOG.md +28 -0
  67. package/node_modules/mailparser/package.json +2 -2
  68. package/node_modules/nodemailer/CHANGELOG.md +74 -0
  69. package/node_modules/nodemailer/dist/cjs/addressparser/index.d.ts +1 -3
  70. package/node_modules/nodemailer/dist/cjs/addressparser/index.js +176 -13
  71. package/node_modules/nodemailer/dist/cjs/base64/index.d.ts +2 -6
  72. package/node_modules/nodemailer/dist/cjs/base64/index.js +2 -0
  73. package/node_modules/nodemailer/dist/cjs/dkim/index.d.ts +4 -4
  74. package/node_modules/nodemailer/dist/cjs/dkim/message-parser.d.ts +1 -3
  75. package/node_modules/nodemailer/dist/cjs/dkim/message-parser.js +2 -0
  76. package/node_modules/nodemailer/dist/cjs/dkim/relaxed-body.d.ts +3 -22
  77. package/node_modules/nodemailer/dist/cjs/dkim/relaxed-body.js +5 -0
  78. package/node_modules/nodemailer/dist/cjs/dkim/sign.d.ts +5 -5
  79. package/node_modules/nodemailer/dist/cjs/errors.d.ts +8 -8
  80. package/node_modules/nodemailer/dist/cjs/fetch/cookies.d.ts +12 -10
  81. package/node_modules/nodemailer/dist/cjs/fetch/cookies.js +28 -14
  82. package/node_modules/nodemailer/dist/cjs/fetch/index.d.ts +15 -15
  83. package/node_modules/nodemailer/dist/cjs/json-transport/index.d.ts +2 -2
  84. package/node_modules/nodemailer/dist/cjs/mail-composer/index.d.ts +49 -104
  85. package/node_modules/nodemailer/dist/cjs/mail-composer/index.js +11 -2
  86. package/node_modules/nodemailer/dist/cjs/mailer/index.d.ts +21 -28
  87. package/node_modules/nodemailer/dist/cjs/mailer/index.js +19 -5
  88. package/node_modules/nodemailer/dist/cjs/mailer/mail-message.d.ts +8 -12
  89. package/node_modules/nodemailer/dist/cjs/mailer/mail-message.js +2 -0
  90. package/node_modules/nodemailer/dist/cjs/mime-funcs/index.d.ts +1 -1
  91. package/node_modules/nodemailer/dist/cjs/mime-funcs/index.js +4 -1
  92. package/node_modules/nodemailer/dist/cjs/mime-node/index.d.ts +37 -191
  93. package/node_modules/nodemailer/dist/cjs/mime-node/index.js +82 -12
  94. package/node_modules/nodemailer/dist/cjs/mime-node/last-newline.d.ts +1 -3
  95. package/node_modules/nodemailer/dist/cjs/mime-node/last-newline.js +2 -0
  96. package/node_modules/nodemailer/dist/cjs/mime-node/le-unix.d.ts +1 -5
  97. package/node_modules/nodemailer/dist/cjs/mime-node/le-unix.js +1 -0
  98. package/node_modules/nodemailer/dist/cjs/mime-node/le-windows.d.ts +1 -5
  99. package/node_modules/nodemailer/dist/cjs/mime-node/le-windows.js +1 -0
  100. package/node_modules/nodemailer/dist/cjs/nodemailer.d.ts +2 -2
  101. package/node_modules/nodemailer/dist/cjs/package-info.d.ts +1 -1
  102. package/node_modules/nodemailer/dist/cjs/package-info.js +1 -1
  103. package/node_modules/nodemailer/dist/cjs/qp/index.d.ts +2 -5
  104. package/node_modules/nodemailer/dist/cjs/qp/index.js +2 -0
  105. package/node_modules/nodemailer/dist/cjs/sendmail-transport/index.d.ts +4 -6
  106. package/node_modules/nodemailer/dist/cjs/ses-transport/index.d.ts +2 -2
  107. package/node_modules/nodemailer/dist/cjs/ses-transport/index.js +5 -1
  108. package/node_modules/nodemailer/dist/cjs/shared/index.d.ts +31 -37
  109. package/node_modules/nodemailer/dist/cjs/shared/index.js +19 -7
  110. package/node_modules/nodemailer/dist/cjs/smtp-connection/data-stream.d.ts +1 -9
  111. package/node_modules/nodemailer/dist/cjs/smtp-connection/data-stream.js +2 -0
  112. package/node_modules/nodemailer/dist/cjs/smtp-connection/http-proxy-client.d.ts +1 -1
  113. package/node_modules/nodemailer/dist/cjs/smtp-connection/index.d.ts +62 -403
  114. package/node_modules/nodemailer/dist/cjs/smtp-connection/index.js +37 -1
  115. package/node_modules/nodemailer/dist/cjs/smtp-pool/index.d.ts +8 -46
  116. package/node_modules/nodemailer/dist/cjs/smtp-pool/index.js +13 -2
  117. package/node_modules/nodemailer/dist/cjs/smtp-pool/pool-resource.d.ts +2 -4
  118. package/node_modules/nodemailer/dist/cjs/smtp-transport/index.d.ts +16 -16
  119. package/node_modules/nodemailer/dist/cjs/stream-transport/index.d.ts +3 -3
  120. package/node_modules/nodemailer/dist/cjs/well-known/index.d.ts +9 -9
  121. package/node_modules/nodemailer/dist/cjs/well-known/services.js +2 -0
  122. package/node_modules/nodemailer/dist/cjs/xoauth2/index.d.ts +18 -18
  123. package/node_modules/nodemailer/dist/esm/addressparser/index.d.ts +1 -3
  124. package/node_modules/nodemailer/dist/esm/addressparser/index.js +176 -13
  125. package/node_modules/nodemailer/dist/esm/base64/index.d.ts +2 -6
  126. package/node_modules/nodemailer/dist/esm/base64/index.js +2 -0
  127. package/node_modules/nodemailer/dist/esm/dkim/index.d.ts +4 -4
  128. package/node_modules/nodemailer/dist/esm/dkim/message-parser.d.ts +1 -3
  129. package/node_modules/nodemailer/dist/esm/dkim/message-parser.js +2 -0
  130. package/node_modules/nodemailer/dist/esm/dkim/relaxed-body.d.ts +3 -22
  131. package/node_modules/nodemailer/dist/esm/dkim/relaxed-body.js +5 -0
  132. package/node_modules/nodemailer/dist/esm/dkim/sign.d.ts +5 -5
  133. package/node_modules/nodemailer/dist/esm/errors.d.ts +8 -8
  134. package/node_modules/nodemailer/dist/esm/fetch/cookies.d.ts +12 -10
  135. package/node_modules/nodemailer/dist/esm/fetch/cookies.js +25 -14
  136. package/node_modules/nodemailer/dist/esm/fetch/index.d.ts +15 -15
  137. package/node_modules/nodemailer/dist/esm/json-transport/index.d.ts +2 -2
  138. package/node_modules/nodemailer/dist/esm/mail-composer/index.d.ts +49 -104
  139. package/node_modules/nodemailer/dist/esm/mail-composer/index.js +11 -2
  140. package/node_modules/nodemailer/dist/esm/mailer/index.d.ts +21 -28
  141. package/node_modules/nodemailer/dist/esm/mailer/index.js +19 -5
  142. package/node_modules/nodemailer/dist/esm/mailer/mail-message.d.ts +8 -12
  143. package/node_modules/nodemailer/dist/esm/mailer/mail-message.js +2 -0
  144. package/node_modules/nodemailer/dist/esm/mime-funcs/index.d.ts +1 -1
  145. package/node_modules/nodemailer/dist/esm/mime-funcs/index.js +4 -1
  146. package/node_modules/nodemailer/dist/esm/mime-node/index.d.ts +37 -191
  147. package/node_modules/nodemailer/dist/esm/mime-node/index.js +82 -12
  148. package/node_modules/nodemailer/dist/esm/mime-node/last-newline.d.ts +1 -3
  149. package/node_modules/nodemailer/dist/esm/mime-node/last-newline.js +2 -0
  150. package/node_modules/nodemailer/dist/esm/mime-node/le-unix.d.ts +1 -5
  151. package/node_modules/nodemailer/dist/esm/mime-node/le-unix.js +1 -0
  152. package/node_modules/nodemailer/dist/esm/mime-node/le-windows.d.ts +1 -5
  153. package/node_modules/nodemailer/dist/esm/mime-node/le-windows.js +1 -0
  154. package/node_modules/nodemailer/dist/esm/nodemailer.d.ts +2 -2
  155. package/node_modules/nodemailer/dist/esm/package-info.d.ts +1 -1
  156. package/node_modules/nodemailer/dist/esm/package-info.js +1 -1
  157. package/node_modules/nodemailer/dist/esm/qp/index.d.ts +2 -5
  158. package/node_modules/nodemailer/dist/esm/qp/index.js +2 -0
  159. package/node_modules/nodemailer/dist/esm/sendmail-transport/index.d.ts +4 -6
  160. package/node_modules/nodemailer/dist/esm/ses-transport/index.d.ts +2 -2
  161. package/node_modules/nodemailer/dist/esm/ses-transport/index.js +5 -1
  162. package/node_modules/nodemailer/dist/esm/shared/index.d.ts +31 -37
  163. package/node_modules/nodemailer/dist/esm/shared/index.js +19 -7
  164. package/node_modules/nodemailer/dist/esm/smtp-connection/data-stream.d.ts +1 -9
  165. package/node_modules/nodemailer/dist/esm/smtp-connection/data-stream.js +2 -0
  166. package/node_modules/nodemailer/dist/esm/smtp-connection/http-proxy-client.d.ts +1 -1
  167. package/node_modules/nodemailer/dist/esm/smtp-connection/index.d.ts +62 -403
  168. package/node_modules/nodemailer/dist/esm/smtp-connection/index.js +37 -1
  169. package/node_modules/nodemailer/dist/esm/smtp-pool/index.d.ts +8 -46
  170. package/node_modules/nodemailer/dist/esm/smtp-pool/index.js +13 -2
  171. package/node_modules/nodemailer/dist/esm/smtp-pool/pool-resource.d.ts +2 -4
  172. package/node_modules/nodemailer/dist/esm/smtp-transport/index.d.ts +16 -16
  173. package/node_modules/nodemailer/dist/esm/stream-transport/index.d.ts +3 -3
  174. package/node_modules/nodemailer/dist/esm/well-known/index.d.ts +9 -9
  175. package/node_modules/nodemailer/dist/esm/well-known/services.js +2 -0
  176. package/node_modules/nodemailer/dist/esm/xoauth2/index.d.ts +18 -18
  177. package/node_modules/nodemailer/dist/well-known/services.json +2 -2
  178. package/node_modules/nodemailer/package.json +6 -6
  179. package/package.json +1 -1
@@ -1,6 +1,4 @@
1
1
  import { type Duplex, type Readable, type TransformOptions, type Writable } from 'node:stream';
2
- import * as mimeFuncs from '../mime-funcs/index.js';
3
- import { type Address } from '../addressparser/index.js';
4
2
  import type { NodemailerError } from '../errors.js';
5
3
  import type { OutgoingHttpHeaders } from 'node:http';
6
4
  /**
@@ -8,38 +6,38 @@ import type { OutgoingHttpHeaders } from 'node:http';
8
6
  */
9
7
  export interface MimeNodeOptions {
10
8
  /** root node for this tree */
11
- rootNode?: MimeNode;
9
+ rootNode?: MimeNode | undefined;
12
10
  /** immediate parent for this node */
13
- parentNode?: MimeNode;
11
+ parentNode?: MimeNode | undefined;
14
12
  /** filename for an attachment node */
15
- filename?: string;
13
+ filename?: string | undefined;
16
14
  /** shared part of the unique multipart boundary */
17
- baseBoundary?: string;
15
+ baseBoundary?: string | undefined;
18
16
  /** prefix for the generated multipart boundaries, defaults to '--_NmP' */
19
- boundaryPrefix?: string;
17
+ boundaryPrefix?: string | undefined;
20
18
  /** If true, do not exclude Bcc from the generated headers */
21
- keepBcc?: boolean;
19
+ keepBcc?: boolean | undefined;
22
20
  /** method to normalize header keys for custom caseing */
23
- normalizeHeaderKey?: (key: string, value: string) => string;
21
+ normalizeHeaderKey?: ((key: string, value: string) => string) | undefined;
24
22
  /** either 'Q' (the default) or 'B' */
25
- textEncoding?: string;
23
+ textEncoding?: string | undefined;
26
24
  /** Hostname for default message-id values */
27
- hostname?: string;
25
+ hostname?: string | undefined;
28
26
  /** If set to 'win' then uses \r\n, if 'linux' then \n. If not set (or `raw` is used) then newlines are kept as is */
29
- newline?: string;
27
+ newline?: string | undefined;
30
28
  /** Reject content that points to a file path, for this node and every node below it */
31
- disableFileAccess?: boolean;
29
+ disableFileAccess?: boolean | undefined;
32
30
  /** Reject content that points to a URL, for this node and every node below it */
33
- disableUrlAccess?: boolean;
31
+ disableUrlAccess?: boolean | undefined;
34
32
  }
35
33
  /**
36
34
  * An address object as accepted in address headers and produced by getAddresses. Either a
37
35
  * mailbox with an address or a group holding a list of addresses
38
36
  */
39
37
  export interface MimeNodeAddress {
40
- name?: string;
41
- address?: string;
42
- group?: MimeNodeAddress[];
38
+ name?: string | undefined;
39
+ address?: string | undefined;
40
+ group?: MimeNodeAddress[] | undefined;
43
41
  }
44
42
  /**
45
43
  * Addresses as accepted by address headers and envelope fields: an address string, an
@@ -52,8 +50,8 @@ export type MimeNodeAddressInput = string | MimeNodeAddress | MimeNodeAddressInp
52
50
  */
53
51
  export interface MimeNodePreparedHeaderValue {
54
52
  value?: unknown;
55
- prepared?: boolean;
56
- foldLines?: boolean;
53
+ prepared?: boolean | undefined;
54
+ foldLines?: boolean | undefined;
57
55
  }
58
56
  /**
59
57
  * The values a header can hold: a string, a number, a Date (for the Date header), address
@@ -84,19 +82,15 @@ export type MimeNodeHeaders = MimeNodeHeader | MimeNodeHeader[] | MimeNodeHeader
84
82
  */
85
83
  export interface MimeNodeContentObject {
86
84
  /** File path to read the content from */
87
- path?: string;
85
+ path?: string | undefined;
88
86
  /** URL to fetch the content from */
89
- href?: string;
87
+ href?: string | undefined;
90
88
  /** Request headers for a URL fetch */
91
- httpHeaders?: OutgoingHttpHeaders;
89
+ httpHeaders?: OutgoingHttpHeaders | undefined;
92
90
  /** TLS settings for a URL fetch, see nmfetch */
93
91
  tls?: {
94
92
  [key: string]: any;
95
- };
96
- /** Read the content once and reuse the buffered value for every stream. MailComposer sets it on the icalEvent content, which is used twice */
97
- _resolve?: boolean;
98
- /** The buffered content once _resolve has run */
99
- _resolvedValue?: Buffer;
93
+ } | undefined;
100
94
  }
101
95
  /**
102
96
  * Body content as accepted by setContent and setRaw: a string, a Buffer, a readable stream
@@ -117,22 +111,22 @@ export interface MimeNodeEnvelope {
117
111
  * other field is copied to the envelope as is
118
112
  */
119
113
  export interface MimeNodeEnvelopeInput {
120
- from?: MimeNodeAddressInput;
121
- to?: MimeNodeAddressInput;
122
- cc?: MimeNodeAddressInput;
123
- bcc?: MimeNodeAddressInput;
114
+ from?: MimeNodeAddressInput | undefined;
115
+ to?: MimeNodeAddressInput | undefined;
116
+ cc?: MimeNodeAddressInput | undefined;
117
+ bcc?: MimeNodeAddressInput | undefined;
124
118
  [key: string]: unknown;
125
119
  }
126
120
  /**
127
121
  * Parsed address headers as returned by getAddresses, keyed by lowercase header name
128
122
  */
129
123
  export interface MimeNodeAddresses {
130
- from?: MimeNodeAddress[];
131
- sender?: MimeNodeAddress[];
132
- 'reply-to'?: MimeNodeAddress[];
133
- to?: MimeNodeAddress[];
134
- cc?: MimeNodeAddress[];
135
- bcc?: MimeNodeAddress[];
124
+ from?: MimeNodeAddress[] | undefined;
125
+ sender?: MimeNodeAddress[] | undefined;
126
+ 'reply-to'?: MimeNodeAddress[] | undefined;
127
+ to?: MimeNodeAddress[] | undefined;
128
+ cc?: MimeNodeAddress[] | undefined;
129
+ bcc?: MimeNodeAddress[] | undefined;
136
130
  }
137
131
  /**
138
132
  * Options for createReadStream. Handed to the PassThrough the message is written to and to
@@ -140,7 +134,7 @@ export interface MimeNodeAddresses {
140
134
  */
141
135
  export interface MimeNodeStreamOptions extends TransformOptions {
142
136
  /** Maximum line length for base64 and quoted-printable bodies, false disables wrapping */
143
- lineLength?: number | false;
137
+ lineLength?: number | false | undefined;
144
138
  }
145
139
  /**
146
140
  * A transform stream the message is piped through, or a function returning one
@@ -184,25 +178,16 @@ declare class MimeNode {
184
178
  hostname: string | undefined;
185
179
  newline: string | undefined;
186
180
  childNodes: MimeNode[];
187
- _nodeId: number;
188
- _headers: MimeNodeHeader[];
189
- _isPlainText: boolean;
190
- _hasLongLines: boolean;
191
- _envelope: MimeNodeEnvelope | false;
192
- _raw: MimeNodeContent | Error | false;
193
- _transforms: MimeNodeTransform[];
194
- _processFuncs: MimeNodeProcessFunc[];
195
181
  /** Filename for this node. Useful with attachments */
196
- filename?: string;
182
+ filename?: string | undefined;
197
183
  /** Body content, or the error a content stream emitted before it was read */
198
- content?: MimeNodeContent | Error;
184
+ content?: MimeNodeContent | Error | undefined;
199
185
  /** Lowercase content type, set when the headers are built */
200
- contentType?: string;
186
+ contentType?: string | undefined;
201
187
  /** Multipart subtype, false for a non-multipart node, set when the headers are built */
202
- multipart?: string | false;
188
+ multipart?: string | false | undefined;
203
189
  /** Multipart boundary, false for a non-multipart node, set when the headers are built */
204
- boundary?: string | false;
205
- _contentErrorHandler?: (err: Error) => void;
190
+ boundary?: string | false | undefined;
206
191
  constructor(contentType?: string | false, options?: MimeNodeOptions);
207
192
  /**
208
193
  * Creates and appends a child node.Arguments provided are passed to MimeNode constructor
@@ -333,145 +318,6 @@ declare class MimeNode {
333
318
  * @param raw Raw MIME contents
334
319
  */
335
320
  setRaw(raw: MimeNodeContent): this;
336
- /**
337
- * Checks an access policy flag for this node and every node above it. The flags are set
338
- * from the options the node was built with, and createChild only ever sees the options
339
- * the caller passed, so a child of a closed tree starts out open. Reading the answer off
340
- * the parent chain keeps it right whatever order the tree was assembled in.
341
- *
342
- * @param flag Either 'disableFileAccess' or 'disableUrlAccess'
343
- * @return true if this node or an ancestor closed that access
344
- */
345
- _accessDisabled(flag: 'disableFileAccess' | 'disableUrlAccess'): boolean;
346
- /**
347
- * Detects and returns handle to a stream related with the content.
348
- *
349
- * @param content Node content
350
- * @returns Stream object
351
- */
352
- _getStream(content: any): Readable;
353
- /**
354
- * Parses addresses. Takes in a single address or an array or an
355
- * array of address arrays (eg. To: [[first group], [second group],...])
356
- *
357
- * @param addresses Addresses to be parsed
358
- * @return An array of address objects
359
- */
360
- _parseAddresses(addresses: MimeNodeAddressInput | undefined): MimeNodeAddress[];
361
- /**
362
- * Normalizes the addresses of a freshly parsed address list, groups included.
363
- *
364
- * Everything this method returns carries a normalized address, whether it arrived as an
365
- * object or was parsed out of a header value. Without this the two shapes disagree, and
366
- * a consumer reading the parsed form back is handed the ambiguous
367
- * 'user@evil.com@good.com' that the header and the envelope no longer carry.
368
- *
369
- * @param parsed An array of address objects, as returned by addressparser
370
- * @return The same array, with every address normalized
371
- */
372
- _normalizeParsedAddresses(parsed: Address[]): Address[];
373
- /**
374
- * Parses the addresses of an explicitly set envelope.
375
- *
376
- * An envelope value is an addr-spec and never a display name, so a bare local username
377
- * such as 'root' is the address here. Header parsing has to read the same value as a
378
- * display name, as a value with no '@' in it can not be an addr-spec in a header.
379
- *
380
- * @param addresses Addresses to be parsed
381
- * @return An array of address objects
382
- */
383
- _parseEnvelopeAddresses(addresses: MimeNodeAddressInput | undefined): MimeNodeAddress[];
384
- /**
385
- * Normalizes a header key, uses Camel-Case form, except for uppercase MIME-
386
- *
387
- * @param key Key to be normalized
388
- * @return key in Camel-Case form
389
- */
390
- _normalizeHeaderKey(key: string): string;
391
- /**
392
- * Checks if the content type is multipart and defines boundary if needed.
393
- * Doesn't return anything, modifies object argument instead.
394
- *
395
- * @param structured Parsed header value for 'Content-Type' key
396
- */
397
- _handleContentType(structured: mimeFuncs.StructuredHeaderValue): void;
398
- /**
399
- * Generates a multipart boundary value
400
- *
401
- * @return boundary value
402
- */
403
- _generateBoundary(): string;
404
- /**
405
- * Encodes a header value for use in the generated rfc2822 email.
406
- *
407
- * @param key Header key
408
- * @param value Header value
409
- */
410
- _encodeHeaderValue(key: string, value: MimeNodeHeaderValue): string;
411
- /**
412
- * Rebuilds address object using punycode and other adjustments
413
- *
414
- * @param addresses An array of address objects
415
- * @param [uniqueList] An array to be populated with addresses
416
- * @return address string
417
- */
418
- _convertAddresses(addresses: MimeNodeAddress | MimeNodeAddress[] | undefined, uniqueList?: MimeNodeAddress[], seenAddresses?: Set<string>): string;
419
- /**
420
- * Normalizes an email address
421
- *
422
- * @param address An array of address objects
423
- * @return address string
424
- */
425
- _normalizeAddress(address?: string | false): string;
426
- /**
427
- * Normalizes the local part of an address into a form that can be emitted as is.
428
- *
429
- * A local part is either a dot-atom or a quoted-string, anything else is not a valid
430
- * addr-spec. The quotes of a quoted local part get lost along the way, and a bare
431
- * 'user@evil.com@good.com' leaves it to the receiver which '@' splits the domain off,
432
- * while the split here is always at the last one. So whatever is not already one of
433
- * the two valid forms goes back out as a quoted-string.
434
- *
435
- * @param user Local part of an address
436
- * @return Local part as a dot-atom or as a quoted-string
437
- */
438
- _normalizeLocalPart(user: string): string;
439
- /**
440
- * If needed, mime encodes the name part
441
- *
442
- * @param name Name part of an address
443
- * @returns Mime word encoded string if needed
444
- */
445
- _encodeAddressName(name: string): string;
446
- /**
447
- * Encodes an unstructured header value. Such a value can only carry VCHAR and WSP, so a
448
- * control char or DEL has to be forced into the mime encoded word that a non-ascii value
449
- * would get anyway. HT stays as it is, it is valid folding whitespace here.
450
- *
451
- * @param value Header value to encode
452
- * @returns Mime word encoded string if needed
453
- */
454
- _encodeHeaderText(value: string): string;
455
- /**
456
- * If needed, mime encodes the name part
457
- *
458
- * @param name Name part of an address
459
- * @returns Mime word encoded string if needed
460
- */
461
- _encodeWords(value: string): string;
462
- /**
463
- * Detects best mime encoding for a text value
464
- *
465
- * @param value Value to check for
466
- * @return either 'Q' or 'B'
467
- */
468
- _getTextEncoding(value?: string | Buffer): string;
469
- /**
470
- * Generates a message id
471
- *
472
- * @return Random Message-ID value
473
- */
474
- _generateMessageId(): string;
475
321
  }
476
322
  /**
477
323
  * Type aliases in the layout of @types/nodemailer, so `MimeNode.Options` style references keep working
@@ -99,6 +99,23 @@ function normalizeDomain(domain, toUnicode) {
99
99
  }
100
100
  return toUnicode ? punycode.toUnicode(domain) : punycode.toASCII(domain);
101
101
  }
102
+ /**
103
+ * Removes the characters that must never reach a multipart delimiter line.
104
+ *
105
+ * A line break splits the delimiter, so the boundary declared in the header can never
106
+ * match it again and the parts go out as body lines instead. The other C0 controls and
107
+ * DEL do not split anything but must not be written either: RFC 5321 does not allow a
108
+ * NUL in DATA at all, and an MTA or a scanner that stops at one reads a different
109
+ * message than a client that does not, which is the same parser disagreement a split
110
+ * delimiter creates. Both sides are cleaned together, since the declared value and the
111
+ * delimiters come from this one result.
112
+ *
113
+ * @param value Value to clean
114
+ * @return Value with every control character removed
115
+ */
116
+ function _stripBoundaryControls(value) {
117
+ return value.replace(/[\x00-\x1f\x7f]+/g, '');
118
+ }
102
119
  /**
103
120
  * Creates a new mime tree node. Assumes 'multipart/*' as the content type
104
121
  * if it is a branch, anything else counts as leaf. If rootNode is missing from
@@ -119,10 +136,11 @@ class MimeNode {
119
136
  this.nodeCounter = 0;
120
137
  options = options || {};
121
138
  /**
122
- * shared part of the unique multipart boundary
139
+ * shared part of the unique multipart boundary. Control characters are dropped
140
+ * here rather than at the delimiter, see _stripBoundaryControls
123
141
  */
124
- this.baseBoundary = options.baseBoundary || node_crypto_1.default.randomBytes(8).toString('hex');
125
- this.boundaryPrefix = options.boundaryPrefix || '--_NmP';
142
+ this.baseBoundary = _stripBoundaryControls(options.baseBoundary || node_crypto_1.default.randomBytes(8).toString('hex'));
143
+ this.boundaryPrefix = _stripBoundaryControls(options.boundaryPrefix || '--_NmP');
126
144
  this.disableFileAccess = !!options.disableFileAccess;
127
145
  this.disableUrlAccess = !!options.disableUrlAccess;
128
146
  this.normalizeHeaderKey = options.normalizeHeaderKey;
@@ -954,6 +972,7 @@ class MimeNode {
954
972
  *
955
973
  * @param flag Either 'disableFileAccess' or 'disableUrlAccess'
956
974
  * @return true if this node or an ancestor closed that access
975
+ * @internal
957
976
  */
958
977
  _accessDisabled(flag) {
959
978
  // eslint-disable-next-line @typescript-eslint/no-this-alias
@@ -971,6 +990,7 @@ class MimeNode {
971
990
  *
972
991
  * @param content Node content
973
992
  * @returns Stream object
993
+ * @internal
974
994
  */
975
995
  _getStream(content) {
976
996
  let contentStream;
@@ -1037,19 +1057,41 @@ class MimeNode {
1037
1057
  *
1038
1058
  * @param addresses Addresses to be parsed
1039
1059
  * @return An array of address objects
1060
+ * @internal
1040
1061
  */
1041
1062
  _parseAddresses(addresses) {
1042
- // Collected into one list as we go. concat.apply spreads the entries into arguments
1043
- // and throws a RangeError once a recipient array is long enough to pass the
1044
- // argument limit, which a large Bcc list reaches on its own.
1045
1063
  const flattened = [];
1046
- [].concat(addresses).forEach(address => {
1064
+ // Nested arrays are flattened iteratively. concat.apply throws once a recipient list
1065
+ // is long enough to pass the argument limit, and an array handed to addressparser is
1066
+ // stringified, which recurses once per nesting level and exhausts the call stack on
1067
+ // a deep enough value. Every array is walked once, which also ends a self-referential
1068
+ // input
1069
+ const seen = new WeakSet();
1070
+ const stack = [];
1071
+ const enter = (list) => {
1072
+ if (!seen.has(list)) {
1073
+ seen.add(list);
1074
+ stack.push({ list, pos: 0 });
1075
+ }
1076
+ };
1077
+ enter(Array.isArray(addresses) ? addresses : [addresses]);
1078
+ while (stack.length) {
1079
+ const frame = stack[stack.length - 1];
1080
+ if (frame.pos >= frame.list.length) {
1081
+ stack.pop();
1082
+ continue;
1083
+ }
1084
+ const address = frame.list[frame.pos++];
1085
+ if (Array.isArray(address)) {
1086
+ enter(address);
1087
+ continue;
1088
+ }
1047
1089
  if (address && address.address) {
1048
1090
  const normalized = this._normalizeAddress(address.address);
1049
1091
  if (normalized === address.address && typeof address.name === 'string') {
1050
1092
  // there is nothing to rewrite, so there is nothing to keep off the original
1051
1093
  flattened.push(address);
1052
- return;
1094
+ continue;
1053
1095
  }
1054
1096
  // rewriting would land on the object the caller passed in and might
1055
1097
  // still hold a reference to, so rewrite a copy of it instead. An own
@@ -1059,13 +1101,13 @@ class MimeNode {
1059
1101
  copy.address = normalized;
1060
1102
  copy.name = address.name || '';
1061
1103
  flattened.push(copy);
1062
- return;
1104
+ continue;
1063
1105
  }
1064
1106
  const parsed = this._normalizeParsedAddresses((0, index_js_1.default)(address));
1065
1107
  for (let i = 0; i < parsed.length; i++) {
1066
1108
  flattened.push(parsed[i]);
1067
1109
  }
1068
- });
1110
+ }
1069
1111
  return flattened;
1070
1112
  }
1071
1113
  /**
@@ -1078,6 +1120,7 @@ class MimeNode {
1078
1120
  *
1079
1121
  * @param parsed An array of address objects, as returned by addressparser
1080
1122
  * @return The same array, with every address normalized
1123
+ * @internal
1081
1124
  */
1082
1125
  _normalizeParsedAddresses(parsed) {
1083
1126
  // addressparser builds these objects, so no caller holds a reference to rewrite around
@@ -1100,6 +1143,7 @@ class MimeNode {
1100
1143
  *
1101
1144
  * @param addresses Addresses to be parsed
1102
1145
  * @return An array of address objects
1146
+ * @internal
1103
1147
  */
1104
1148
  _parseEnvelopeAddresses(addresses) {
1105
1149
  return this._parseAddresses(addresses).map(entry => {
@@ -1114,6 +1158,7 @@ class MimeNode {
1114
1158
  *
1115
1159
  * @param key Key to be normalized
1116
1160
  * @return key in Camel-Case form
1161
+ * @internal
1117
1162
  */
1118
1163
  _normalizeHeaderKey(key) {
1119
1164
  key = (key || '')
@@ -1136,13 +1181,26 @@ class MimeNode {
1136
1181
  * Doesn't return anything, modifies object argument instead.
1137
1182
  *
1138
1183
  * @param structured Parsed header value for 'Content-Type' key
1184
+ * @internal
1139
1185
  */
1140
1186
  _handleContentType(structured) {
1141
1187
  this.contentType = structured.value.trim().toLowerCase();
1142
1188
  this.multipart = /^multipart\//i.test(this.contentType) ? this.contentType.substr(this.contentType.indexOf('/') + 1) : false;
1143
1189
  if (this.multipart) {
1190
+ // The declared value and the delimiters are assigned from the same expression
1191
+ // here, so whatever the header emitter then does with it, the two sides cannot
1192
+ // disagree about which characters the boundary is made of.
1193
+ //
1194
+ // Stripping runs before the fallback rather than over the whole chain: a
1195
+ // boundary made only of control characters would otherwise strip to '' and
1196
+ // leave the node declaring no boundary and streaming bare '--' delimiters.
1197
+ // _generateBoundary cleans what it builds, but this is the one place the boundary
1198
+ // is written, so it cleans the value it is about to write rather than trusting
1199
+ // where it came from. MimeNode is exported and subclassable, so the generator is
1200
+ // not necessarily the one below. Stripping twice costs nothing, it is idempotent.
1201
+ const declared = _stripBoundaryControls(structured.params.boundary || this.boundary || '');
1144
1202
  this.boundary = structured.params.boundary =
1145
- structured.params.boundary || this.boundary || this._generateBoundary();
1203
+ declared || _stripBoundaryControls(this._generateBoundary());
1146
1204
  }
1147
1205
  else {
1148
1206
  this.boundary = false;
@@ -1152,15 +1210,19 @@ class MimeNode {
1152
1210
  * Generates a multipart boundary value
1153
1211
  *
1154
1212
  * @return boundary value
1213
+ * @internal
1155
1214
  */
1156
1215
  _generateBoundary() {
1157
- return this.rootNode.boundaryPrefix + '-' + this.rootNode.baseBoundary + '-Part_' + this._nodeId;
1216
+ // baseBoundary and boundaryPrefix are public, so they may hold something the
1217
+ // constructor never cleaned, and the -Part_ suffix keeps the result non empty
1218
+ return _stripBoundaryControls(this.rootNode.boundaryPrefix + '-' + this.rootNode.baseBoundary) + '-Part_' + this._nodeId;
1158
1219
  }
1159
1220
  /**
1160
1221
  * Encodes a header value for use in the generated rfc2822 email.
1161
1222
  *
1162
1223
  * @param key Header key
1163
1224
  * @param value Header value
1225
+ * @internal
1164
1226
  */
1165
1227
  _encodeHeaderValue(key, value) {
1166
1228
  key = this._normalizeHeaderKey(key);
@@ -1233,6 +1295,7 @@ class MimeNode {
1233
1295
  * @param addresses An array of address objects
1234
1296
  * @param [uniqueList] An array to be populated with addresses
1235
1297
  * @return address string
1298
+ * @internal
1236
1299
  */
1237
1300
  _convertAddresses(addresses, uniqueList, seenAddresses) {
1238
1301
  const values = [];
@@ -1277,6 +1340,7 @@ class MimeNode {
1277
1340
  *
1278
1341
  * @param address An array of address objects
1279
1342
  * @return address string
1343
+ * @internal
1280
1344
  */
1281
1345
  _normalizeAddress(address) {
1282
1346
  address = (address || '')
@@ -1323,6 +1387,7 @@ class MimeNode {
1323
1387
  *
1324
1388
  * @param user Local part of an address
1325
1389
  * @return Local part as a dot-atom or as a quoted-string
1390
+ * @internal
1326
1391
  */
1327
1392
  _normalizeLocalPart(user) {
1328
1393
  if (DOT_ATOM.test(user) || QUOTED_STRING.test(user)) {
@@ -1335,6 +1400,7 @@ class MimeNode {
1335
1400
  *
1336
1401
  * @param name Name part of an address
1337
1402
  * @returns Mime word encoded string if needed
1403
+ * @internal
1338
1404
  */
1339
1405
  _encodeAddressName(name) {
1340
1406
  if (!/^[\w ]*$/.test(name)) {
@@ -1354,6 +1420,7 @@ class MimeNode {
1354
1420
  *
1355
1421
  * @param value Header value to encode
1356
1422
  * @returns Mime word encoded string if needed
1423
+ * @internal
1357
1424
  */
1358
1425
  _encodeHeaderText(value) {
1359
1426
  return /[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/.test(value)
@@ -1366,6 +1433,7 @@ class MimeNode {
1366
1433
  *
1367
1434
  * @param name Name part of an address
1368
1435
  * @returns Mime word encoded string if needed
1436
+ * @internal
1369
1437
  */
1370
1438
  _encodeWords(value) {
1371
1439
  // set encodeAll parameter to true even though it is against the recommendation of RFC2047,
@@ -1378,6 +1446,7 @@ class MimeNode {
1378
1446
  *
1379
1447
  * @param value Value to check for
1380
1448
  * @return either 'Q' or 'B'
1449
+ * @internal
1381
1450
  */
1382
1451
  _getTextEncoding(value) {
1383
1452
  value = (value || '').toString();
@@ -1405,6 +1474,7 @@ class MimeNode {
1405
1474
  * Generates a message id
1406
1475
  *
1407
1476
  * @return Random Message-ID value
1477
+ * @internal
1408
1478
  */
1409
1479
  _generateMessageId() {
1410
1480
  return ('<' +
@@ -1,7 +1,5 @@
1
- import { Transform, type TransformCallback } from 'node:stream';
1
+ import { Transform } from 'node:stream';
2
2
  export default class LastNewline extends Transform {
3
3
  lastByte: number | false;
4
4
  constructor();
5
- _transform(chunk: Buffer, encoding: BufferEncoding, done: TransformCallback): void;
6
- _flush(done: TransformCallback): void;
7
5
  }
@@ -6,6 +6,7 @@ class LastNewline extends node_stream_1.Transform {
6
6
  super();
7
7
  this.lastByte = false;
8
8
  }
9
+ /** @internal */
9
10
  _transform(chunk, encoding, done) {
10
11
  if (chunk.length) {
11
12
  this.lastByte = chunk[chunk.length - 1];
@@ -13,6 +14,7 @@ class LastNewline extends node_stream_1.Transform {
13
14
  this.push(chunk);
14
15
  done();
15
16
  }
17
+ /** @internal */
16
18
  _flush(done) {
17
19
  if (this.lastByte === 0x0a) {
18
20
  return done();
@@ -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
  * Ensures that only <LF> is used for linebreaks
4
4
  *
@@ -6,8 +6,4 @@ import { Transform, type TransformCallback, type TransformOptions } from 'node:s
6
6
  */
7
7
  export default class LeUnix extends Transform {
8
8
  constructor(options?: TransformOptions);
9
- /**
10
- * Escapes dots
11
- */
12
- _transform(chunk: Buffer, encoding: BufferEncoding, done: TransformCallback): void;
13
9
  }
@@ -12,6 +12,7 @@ class LeUnix extends node_stream_1.Transform {
12
12
  }
13
13
  /**
14
14
  * Escapes dots
15
+ * @internal
15
16
  */
16
17
  _transform(chunk, encoding, done) {
17
18
  let buf;
@@ -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
  * Ensures that only <CR><LF> sequences are used for linebreaks
4
4
  *
@@ -7,8 +7,4 @@ import { Transform, type TransformCallback, type TransformOptions } from 'node:s
7
7
  export default class LeWindows extends Transform {
8
8
  lastByte: number | false;
9
9
  constructor(options?: TransformOptions);
10
- /**
11
- * Escapes dots
12
- */
13
- _transform(chunk: Buffer, encoding: BufferEncoding, done: TransformCallback): void;
14
10
  }
@@ -13,6 +13,7 @@ class LeWindows extends node_stream_1.Transform {
13
13
  }
14
14
  /**
15
15
  * Escapes dots
16
+ * @internal
16
17
  */
17
18
  _transform(chunk, encoding, done) {
18
19
  let buf;
@@ -25,7 +25,7 @@ export interface TestAccount {
25
25
  pop3: TestAccountService;
26
26
  web: string;
27
27
  /** true if the account can also receive external mail */
28
- mxEnabled?: boolean;
28
+ mxEnabled?: boolean | undefined;
29
29
  [key: string]: unknown;
30
30
  }
31
31
  /**
@@ -77,7 +77,7 @@ export declare function createTestAccount(apiUrl?: string | false | null): Promi
77
77
  * @returns URL of the message in the Ethereal web interface, or false if the response does not carry one
78
78
  */
79
79
  export declare function getTestMessageUrl(info?: {
80
- response?: string | Buffer | null;
80
+ response?: string | Buffer | null | undefined;
81
81
  } | false | null): string | false;
82
82
  declare const nodemailer: {
83
83
  createTransport: typeof createTransport;
@@ -1,3 +1,3 @@
1
1
  export declare const name = "nodemailer";
2
- export declare const version = "10.0.0";
2
+ export declare const version = "10.0.9";
3
3
  export declare const homepage = "https://nodemailer.com/";
@@ -3,5 +3,5 @@
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.homepage = exports.version = exports.name = void 0;
5
5
  exports.name = 'nodemailer';
6
- exports.version = '10.0.0';
6
+ exports.version = '10.0.9';
7
7
  exports.homepage = 'https://nodemailer.com/';