@mavogel/awscdk-rootmail 0.1.4 → 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,4 +1,4 @@
1
- import { Transform, type TransformCallback } from 'node:stream';
1
+ import { Transform } from 'node:stream';
2
2
  export declare function encode(buffer: Buffer | string): string;
3
3
  /**
4
4
  * Adds soft line breaks to a Quoted-Printable string
@@ -13,7 +13,7 @@ export declare function wrap(str: string, lineLength?: number): string;
13
13
  */
14
14
  export interface QPEncoderOptions {
15
15
  /** Maximum length for lines, set to false to disable wrapping */
16
- lineLength?: number | false;
16
+ lineLength?: number | false | undefined;
17
17
  }
18
18
  /**
19
19
  * Creates a transform stream for encoding data to Quoted-Printable encoding
@@ -26,8 +26,5 @@ export declare class Encoder extends Transform {
26
26
  options: QPEncoderOptions;
27
27
  inputBytes: number;
28
28
  outputBytes: number;
29
- _curLine: string;
30
29
  constructor(options?: QPEncoderOptions);
31
- _transform(chunk: Buffer | string, encoding: BufferEncoding | 'buffer', done: TransformCallback): void;
32
- _flush(done: TransformCallback): void;
33
30
  }
@@ -152,6 +152,7 @@ export class Encoder extends Transform {
152
152
  this.inputBytes = 0;
153
153
  this.outputBytes = 0;
154
154
  }
155
+ /** @internal */
155
156
  _transform(chunk, encoding, done) {
156
157
  let qp;
157
158
  if (encoding !== 'buffer') {
@@ -180,6 +181,7 @@ export class Encoder extends Transform {
180
181
  }
181
182
  done();
182
183
  }
184
+ /** @internal */
183
185
  _flush(done) {
184
186
  if (this._curLine) {
185
187
  this.outputBytes += this._curLine.length;
@@ -1,4 +1,3 @@
1
- import { spawn } from 'node:child_process';
2
1
  import type { Logger } from '../shared/index.js';
3
2
  import type { MimeNodeEnvelope } from '../mime-node/index.js';
4
3
  import type MailMessage from '../mailer/mail-message.js';
@@ -8,13 +7,13 @@ import type { default as Mail, SentMessageInfo, SendMailOptions, TransportOption
8
7
  */
9
8
  export interface SendmailTransportOptions extends TransportOptions {
10
9
  /** Selects this transport in createTransport, the binary itself is set with `path` */
11
- sendmail?: boolean | string;
10
+ sendmail?: boolean | string | undefined;
12
11
  /** Path to the sendmail binary, defaults to 'sendmail' */
13
- path?: string;
12
+ path?: string | undefined;
14
13
  /** Either 'windows' or 'unix', the line ending of the message piped to sendmail */
15
- newline?: string;
14
+ newline?: string | undefined;
16
15
  /** Arguments for the sendmail binary, replaces the default '-f <sender>' */
17
- args?: string[];
16
+ args?: string[] | undefined;
18
17
  }
19
18
  /**
20
19
  * The value the Sendmail transport hands to the send callback
@@ -41,7 +40,6 @@ export interface SendmailSentMessageInfo extends SentMessageInfo {
41
40
  */
42
41
  declare class SendmailTransport {
43
42
  mailer: Mail<SendmailSentMessageInfo>;
44
- _spawn: typeof spawn;
45
43
  options: SendmailTransportOptions;
46
44
  name: string;
47
45
  version: string;
@@ -12,9 +12,9 @@ export interface SESTransportOptions extends TransportOptions {
12
12
  /** SESv2Client instance. Its config.region provider is resolved for the domain of the returned Message-ID */
13
13
  sesClient: {
14
14
  config?: {
15
- region?: () => Promise<string>;
15
+ region?: (() => Promise<string>) | undefined;
16
16
  [key: string]: any;
17
- };
17
+ } | undefined;
18
18
  send(command: unknown): Promise<any>;
19
19
  };
20
20
  /** SendEmailCommand class, constructed with the SendEmailCommandInput of every message */
@@ -24,7 +24,11 @@ function tagSesError(err) {
24
24
  class SESTransport extends EventEmitter {
25
25
  constructor(options) {
26
26
  super();
27
- options = options || {};
27
+ if (!options || !options.SES || !options.SES.sesClient) {
28
+ const error = new Error('Missing SES configuration, expecting { sesClient, SendEmailCommand } from @aws-sdk/client-sesv2, see https://nodemailer.com/transports/ses/');
29
+ error.code = errors.ECONFIG;
30
+ throw error;
31
+ }
28
32
  this.options = options;
29
33
  this.ses = this.options.SES;
30
34
  this.name = 'SESTransport';
@@ -9,39 +9,36 @@ export { isProtoKey, copyOwnKeys };
9
9
  */
10
10
  export interface ResolveHostnameOptions {
11
11
  /** Hostname or IP address to resolve */
12
- host?: string;
12
+ host?: string | undefined;
13
13
  /** Server name for TLS, used as the host when no host is set */
14
- servername?: string;
14
+ servername?: string | undefined;
15
15
  /** Count loopback interfaces when checking which address families are usable */
16
- allowInternalNetworkInterfaces?: boolean;
16
+ allowInternalNetworkInterfaces?: boolean | undefined;
17
17
  /** How long a resolved value stays cached, in milliseconds (default 5 minutes) */
18
- dnsTtl?: number;
18
+ dnsTtl?: number | undefined;
19
19
  /** Query timeout in milliseconds, passed to dns.Resolver */
20
- timeout?: number;
20
+ timeout?: number | undefined;
21
21
  /** Number of query attempts, passed to dns.Resolver */
22
- tries?: number;
22
+ tries?: number | undefined;
23
23
  }
24
24
  /**
25
25
  * Resolved value handed to the resolveHostname callback
26
26
  */
27
27
  export interface ResolvedHostname {
28
28
  /** Server name to use for TLS, false when an IP literal was given without one */
29
- servername?: string | false;
29
+ servername?: string | false | undefined;
30
30
  /** Address to connect to, picked at random from the resolved addresses */
31
- host?: string | null;
32
- /** All resolved addresses, for connection fallback support */
33
- _addresses?: string[];
31
+ host?: string | null | undefined;
34
32
  /** Whether the value came from the DNS cache */
35
- cached?: boolean;
33
+ cached?: boolean | undefined;
36
34
  /** The resolver error when a cached value was used because of it */
37
- error?: Error;
35
+ error?: Error | undefined;
38
36
  }
39
37
  /**
40
38
  * Resolved addresses as stored in the DNS cache
41
39
  */
42
40
  export interface DnsCacheValue {
43
41
  addresses: string[];
44
- servername: string | false;
45
42
  }
46
43
  /**
47
44
  * A DNS cache entry
@@ -49,26 +46,26 @@ export interface DnsCacheValue {
49
46
  export interface DnsCacheEntry {
50
47
  value: DnsCacheValue;
51
48
  /** Expiration time as a timestamp, entries without one never expire */
52
- expires?: number;
49
+ expires?: number | undefined;
53
50
  }
54
51
  /**
55
52
  * Configuration object parsed from a connection url. Query parameters become
56
53
  * top level keys, `tls.*` parameters go into `tls`
57
54
  */
58
55
  export interface ConnectionUrlOptions {
59
- secure?: boolean;
60
- direct?: boolean;
61
- port?: number;
62
- host?: string;
56
+ secure?: boolean | undefined;
57
+ direct?: boolean | undefined;
58
+ port?: number | undefined;
59
+ host?: string | undefined;
63
60
  /** Well-known service name from the ?service= query parameter */
64
- service?: string;
61
+ service?: string | undefined;
65
62
  auth?: {
66
63
  user: string;
67
64
  pass: string;
68
- };
65
+ } | undefined;
69
66
  tls?: {
70
67
  [key: string]: unknown;
71
- };
68
+ } | undefined;
72
69
  [key: string]: unknown;
73
70
  }
74
71
  /**
@@ -77,12 +74,12 @@ export interface ConnectionUrlOptions {
77
74
  */
78
75
  export interface LogEntry {
79
76
  /** 'server' or 'client' for SMTP transaction lines */
80
- tnx?: string;
77
+ tnx?: string | undefined;
81
78
  /** Session id */
82
- sid?: string;
79
+ sid?: string | undefined;
83
80
  /** Connection id */
84
- cid?: string | number;
85
- level?: string;
81
+ cid?: string | number | undefined;
82
+ level?: string | undefined;
86
83
  [key: string]: any;
87
84
  }
88
85
  export type LogLevel = 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal';
@@ -105,7 +102,7 @@ export interface ExternalLogger {
105
102
  */
106
103
  export interface GetLoggerOptions {
107
104
  /** A bunyan compatible logger, true for the default console logger, false or unset for no logging */
108
- logger?: ExternalLogger | boolean;
105
+ logger?: ExternalLogger | boolean | undefined;
109
106
  }
110
107
  /**
111
108
  * The bunyan compatible logger interface returned by getLogger
@@ -137,9 +134,9 @@ export interface ParsedDataURI {
137
134
  */
138
135
  export interface ResolveContentOptions {
139
136
  /** Reject content that points to a file path */
140
- disableFileAccess?: boolean;
137
+ disableFileAccess?: boolean | undefined;
141
138
  /** Reject content that points to a URL */
142
- disableUrlAccess?: boolean;
139
+ disableUrlAccess?: boolean | undefined;
143
140
  }
144
141
  /**
145
142
  * An object value resolveContent understands. A plain string or Buffer value is returned as
@@ -148,23 +145,21 @@ export interface ResolveContentOptions {
148
145
  */
149
146
  export interface ContentDescriptor {
150
147
  /** The content itself, a string, a Buffer or a readable stream */
151
- content?: string | Buffer | Readable;
148
+ content?: string | Buffer | Readable | undefined;
152
149
  /** Encoding of a string `content`, it is decoded into a Buffer unless it is utf8 or ascii */
153
- encoding?: string;
150
+ encoding?: string | undefined;
154
151
  /** File path, http(s) URL or data URI to read the content from */
155
- path?: string;
152
+ path?: string | undefined;
156
153
  /** URL to fetch the content from */
157
- href?: string;
154
+ href?: string | undefined;
158
155
  /** Request headers for a URL fetch */
159
- httpHeaders?: OutgoingHttpHeaders;
156
+ httpHeaders?: OutgoingHttpHeaders | undefined;
160
157
  /** TLS settings for a URL fetch, see nmfetch */
161
158
  tls?: {
162
159
  [key: string]: any;
163
- };
160
+ } | undefined;
164
161
  }
165
162
  export type ResolveContentCallback = (err: Error | null, value?: any) => void;
166
- export declare const _lastCacheCleanup: () => number;
167
- export declare const _resetCacheCleanup: () => void;
168
163
  export declare let networkInterfaces: NodeJS.Dict<os.NetworkInterfaceInfo[]> | undefined;
169
164
  export declare const dnsCache: Map<string, DnsCacheEntry>;
170
165
  export declare const resolveHostname: (options: ResolveHostnameOptions | undefined, callback: (err: Error | null, result?: ResolvedHostname) => void) => void;
@@ -175,7 +170,6 @@ export declare const resolveHostname: (options: ResolveHostnameOptions | undefin
175
170
  * @return Configuration object
176
171
  */
177
172
  export declare const parseConnectionUrl: (str?: string | null) => ConnectionUrlOptions;
178
- export declare const _logFunc: (logger: ExternalLogger, level: string, defaults: LogEntry | undefined, data: LogEntry | undefined, message?: string, ...args: any[]) => void;
179
173
  /**
180
174
  * Returns a bunyan-compatible logger interface. Uses either provided logger or
181
175
  * creates a default console logger
@@ -14,7 +14,9 @@ const DNS_TTL = 5 * 60 * 1000;
14
14
  const CACHE_CLEANUP_INTERVAL = 30 * 1000; // Minimum 30 seconds between cleanups
15
15
  const MAX_CACHE_SIZE = 1000; // Maximum number of entries in cache
16
16
  let lastCacheCleanup = 0;
17
+ /** @internal */
17
18
  export const _lastCacheCleanup = () => lastCacheCleanup;
19
+ /** @internal */
18
20
  export const _resetCacheCleanup = () => {
19
21
  lastCacheCleanup = 0;
20
22
  };
@@ -66,7 +68,6 @@ const formatDNSValue = (value, extra) => {
66
68
  // Select a random address from available addresses, or null if none
67
69
  const host = addresses.length > 0 ? addresses[Math.floor(Math.random() * addresses.length)] : null;
68
70
  return Object.assign({
69
- servername: value.servername,
70
71
  host,
71
72
  // Include all addresses for connection fallback support
72
73
  _addresses: addresses
@@ -80,14 +81,19 @@ export const resolveHostname = (options, callback) => {
80
81
  if (!options.host || net.isIP(options.host)) {
81
82
  // nothing to do here
82
83
  const value = {
83
- addresses: [options.host],
84
- servername: options.servername || false
84
+ addresses: [options.host]
85
85
  };
86
86
  return callback(null, formatDNSValue(value, {
87
+ servername: options.servername || false,
87
88
  cached: false
88
89
  }));
89
90
  }
90
91
  const host = options.host;
92
+ // The TLS server name belongs to the connection asking, not to the host it resolves. The
93
+ // cache is shared by every transport of the process and keyed by host alone, so a server
94
+ // name stored in it would be the one of whichever transport resolved the host first, and a
95
+ // later transport with its own tls.servername would present and verify that name instead
96
+ const servername = options.servername || host;
91
97
  let cached;
92
98
  if (dnsCache.has(options.host)) {
93
99
  cached = dnsCache.get(options.host);
@@ -110,6 +116,7 @@ export const resolveHostname = (options, callback) => {
110
116
  }
111
117
  if (!cached.expires || cached.expires >= now) {
112
118
  return callback(null, formatDNSValue(cached.value, {
119
+ servername,
113
120
  cached: true
114
121
  }));
115
122
  }
@@ -137,14 +144,14 @@ export const resolveHostname = (options, callback) => {
137
144
  const allAddresses = ipv4Addresses.concat(ipv6Addresses);
138
145
  if (allAddresses.length) {
139
146
  const value = {
140
- addresses: allAddresses,
141
- servername: options.servername || host
147
+ addresses: allAddresses
142
148
  };
143
149
  dnsCache.set(host, {
144
150
  value,
145
151
  expires: Date.now() + (options.dnsTtl || DNS_TTL)
146
152
  });
147
153
  return callback(null, formatDNSValue(value, {
154
+ servername,
148
155
  cached: false
149
156
  }));
150
157
  }
@@ -157,6 +164,7 @@ export const resolveHostname = (options, callback) => {
157
164
  expires: Date.now() + (options.dnsTtl || DNS_TTL)
158
165
  });
159
166
  return callback(null, formatDNSValue(cached.value, {
167
+ servername,
160
168
  cached: true,
161
169
  error: ipv4Error
162
170
  }));
@@ -171,6 +179,7 @@ export const resolveHostname = (options, callback) => {
171
179
  expires: Date.now() + (options.dnsTtl || DNS_TTL)
172
180
  });
173
181
  return callback(null, formatDNSValue(cached.value, {
182
+ servername,
174
183
  cached: true,
175
184
  error: err
176
185
  }));
@@ -188,18 +197,19 @@ export const resolveHostname = (options, callback) => {
188
197
  if (!supportedAddresses.length && cached) {
189
198
  // nothing was found, fallback to cached value
190
199
  return callback(null, formatDNSValue(cached.value, {
200
+ servername,
191
201
  cached: true
192
202
  }));
193
203
  }
194
204
  const value = {
195
- addresses: supportedAddresses.length ? supportedAddresses : [host],
196
- servername: options.servername || host
205
+ addresses: supportedAddresses.length ? supportedAddresses : [host]
197
206
  };
198
207
  dnsCache.set(host, {
199
208
  value,
200
209
  expires: Date.now() + (options.dnsTtl || DNS_TTL)
201
210
  });
202
211
  return callback(null, formatDNSValue(value, {
212
+ servername,
203
213
  cached: false
204
214
  }));
205
215
  });
@@ -211,6 +221,7 @@ export const resolveHostname = (options, callback) => {
211
221
  expires: Date.now() + (options.dnsTtl || DNS_TTL)
212
222
  });
213
223
  return callback(null, formatDNSValue(cached.value, {
224
+ servername,
214
225
  cached: true,
215
226
  error: lookupErr
216
227
  }));
@@ -288,6 +299,7 @@ export const parseConnectionUrl = (str) => {
288
299
  });
289
300
  return options;
290
301
  };
302
+ /** @internal */
291
303
  export const _logFunc = (logger, level, defaults, data, message, ...args) => {
292
304
  const entry = Object.assign({}, defaults || {}, data || {});
293
305
  delete entry.level;
@@ -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
  * Escapes dots in the beginning of lines. Ends the stream with <CR><LF>.<CR><LF>
4
4
  * Also makes sure that only <CR><LF> sequences are used for linebreaks
@@ -11,12 +11,4 @@ export default class DataStream extends Transform {
11
11
  outByteCount: number;
12
12
  lastByte: number | false;
13
13
  constructor(options?: TransformOptions);
14
- /**
15
- * Escapes dots
16
- */
17
- _transform(chunk: Buffer | string, encoding: BufferEncoding, done: TransformCallback): void;
18
- /**
19
- * Finalizes the stream with a dot on a single line
20
- */
21
- _flush(done: TransformCallback): void;
22
14
  }
@@ -15,6 +15,7 @@ export default class DataStream extends Transform {
15
15
  }
16
16
  /**
17
17
  * Escapes dots
18
+ * @internal
18
19
  */
19
20
  _transform(chunk, encoding, done) {
20
21
  const chunks = [];
@@ -74,6 +75,7 @@ export default class DataStream extends Transform {
74
75
  }
75
76
  /**
76
77
  * Finalizes the stream with a dot on a single line
78
+ * @internal
77
79
  */
78
80
  _flush(done) {
79
81
  let buf;
@@ -8,7 +8,7 @@ import type { NodemailerError } from '../errors.js';
8
8
  */
9
9
  export interface HttpProxyClientOptions {
10
10
  /** Set to false to accept a proxy certificate that fails validation (e.g. self-signed) */
11
- rejectUnauthorized?: boolean;
11
+ rejectUnauthorized?: boolean | undefined;
12
12
  }
13
13
  /**
14
14
  * Receives the proxied socket once the CONNECT handshake has succeeded, or the error that prevented it