@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,7 +1,6 @@
1
1
  import { EventEmitter } from 'node:events';
2
2
  import net from 'node:net';
3
3
  import tls from 'node:tls';
4
- import DataStream from './data-stream.js';
5
4
  import { type Readable } from 'node:stream';
6
5
  import * as shared from '../shared/index.js';
7
6
  import type { NodemailerError } from '../errors.js';
@@ -17,83 +16,83 @@ export type SMTPConnectionCustomAuthHandlers = {
17
16
  */
18
17
  export interface SMTPConnectionOptions {
19
18
  /** Port to connect to, defaults to 587, or to 465 when secure is set */
20
- port?: number | string;
19
+ port?: number | string | undefined;
21
20
  /** Hostname or IP address to connect to, defaults to 'localhost' */
22
- host?: string;
21
+ host?: string | undefined;
23
22
  /** Use TLS from the start */
24
- secure?: boolean;
23
+ secure?: boolean | undefined;
25
24
  /** Marks the provided socket as already upgraded to TLS */
26
- secured?: boolean;
25
+ secured?: boolean | undefined;
27
26
  /** Server name for SNI, defaults to host when that is not an IP address */
28
- servername?: string;
27
+ servername?: string | undefined;
29
28
  /** Ignore STARTTLS even when the server advertises it */
30
- ignoreTLS?: boolean;
29
+ ignoreTLS?: boolean | undefined;
31
30
  /** Force STARTTLS, fail when the server does not support it */
32
- requireTLS?: boolean;
31
+ requireTLS?: boolean | undefined;
33
32
  /** Continue unencrypted when the STARTTLS upgrade fails */
34
- opportunisticTLS?: boolean;
33
+ opportunisticTLS?: boolean | undefined;
35
34
  /** Name of the client server, sent with EHLO/HELO, CRLF is stripped */
36
- name?: string;
35
+ name?: string | undefined;
37
36
  /** Outbound address to bind to */
38
- localAddress?: string;
37
+ localAddress?: string | undefined;
39
38
  /** Time to wait in ms for the connection to establish, defaults to 2 minutes */
40
- connectionTimeout?: number;
39
+ connectionTimeout?: number | undefined;
41
40
  /** Time to wait in ms until the greeting is received, defaults to 30 seconds */
42
- greetingTimeout?: number;
41
+ greetingTimeout?: number | undefined;
43
42
  /** Time of inactivity in ms until the connection is closed, defaults to 10 minutes */
44
- socketTimeout?: number;
43
+ socketTimeout?: number | undefined;
45
44
  /** Time to wait in ms for the DNS requests to be resolved, defaults to 30 seconds */
46
- dnsTimeout?: number;
45
+ dnsTimeout?: number | undefined;
47
46
  /** Use LMTP instead of SMTP */
48
- lmtp?: boolean;
47
+ lmtp?: boolean | undefined;
49
48
  /** Bunyan compatible logger interface, true for the default console logger */
50
- logger?: shared.ExternalLogger | boolean;
49
+ logger?: shared.ExternalLogger | boolean | undefined;
51
50
  /** Pass SMTP traffic, including the message data, to the logger */
52
- debug?: boolean;
51
+ debug?: boolean | undefined;
53
52
  /** Pass SMTP commands and responses to the logger */
54
- transactionLog?: boolean;
53
+ transactionLog?: boolean | undefined;
55
54
  /** Options for tls.connect */
56
- tls?: tls.ConnectionOptions;
55
+ tls?: tls.ConnectionOptions | undefined;
57
56
  /** Existing socket to use instead of creating a new one, not connected yet */
58
- socket?: net.Socket;
57
+ socket?: net.Socket | undefined;
59
58
  /** Already opened connection to use instead of creating a new one */
60
- connection?: net.Socket;
59
+ connection?: net.Socket | undefined;
61
60
  /** Count loopback interfaces when checking which address families are usable */
62
- allowInternalNetworkInterfaces?: boolean;
61
+ allowInternalNetworkInterfaces?: boolean | undefined;
63
62
  /** Logger component name, defaults to 'smtp-connection' */
64
- component?: string;
63
+ component?: string | undefined;
65
64
  /** Custom authentication handlers keyed by method name */
66
- customAuth?: SMTPConnectionCustomAuthHandlers;
65
+ customAuth?: SMTPConnectionCustomAuthHandlers | undefined;
67
66
  }
68
67
  /**
69
68
  * User and password credentials resolved for a SASL mechanism
70
69
  */
71
70
  export interface SMTPConnectionCredentials {
72
- user?: string;
73
- pass?: string;
71
+ user?: string | undefined;
72
+ pass?: string | undefined;
74
73
  /** Extra options for the authentication method, copied from the auth object */
75
74
  options?: {
76
75
  [key: string]: any;
77
- };
76
+ } | undefined;
78
77
  }
79
78
  /**
80
79
  * Authentication data for login()
81
80
  */
82
81
  export interface SMTPConnectionAuth {
83
82
  /** Authentication type, informational */
84
- type?: string;
83
+ type?: string | undefined;
85
84
  /** SASL method to use, false or unset picks the first supported one (PLAIN if none is advertised) */
86
- method?: string | false;
87
- user?: string;
88
- pass?: string;
85
+ method?: string | false | undefined;
86
+ user?: string | undefined;
87
+ pass?: string | undefined;
89
88
  /** Extra options for the authentication method */
90
89
  options?: {
91
90
  [key: string]: any;
92
- };
91
+ } | undefined;
93
92
  /** XOAuth2 token generator, selects XOAUTH2 when no method is set */
94
- oauth2?: XOAuth2;
93
+ oauth2?: XOAuth2 | undefined;
95
94
  /** Credentials for the SASL mechanism, filled in from user and pass when missing */
96
- credentials?: SMTPConnectionCredentials;
95
+ credentials?: SMTPConnectionCredentials | undefined;
97
96
  /** Custom authentication handlers receive the auth object as is, so it may carry any other value */
98
97
  [key: string]: any;
99
98
  }
@@ -108,7 +107,7 @@ export interface SMTPConnectionCustomAuthResponse {
108
107
  /** Numeric status code, 0 if the response did not start with one */
109
108
  status: number;
110
109
  /** Enhanced status code, if any */
111
- code?: string;
110
+ code?: string | undefined;
112
111
  /** Response text without the status codes */
113
112
  text: string;
114
113
  }
@@ -145,52 +144,52 @@ export type SMTPConnectionCustomAuthHandler = (ctx: SMTPConnectionCustomAuthCont
145
144
  * An envelope address, either a plain string or an object with an address property
146
145
  */
147
146
  export interface SMTPEnvelopeAddress {
148
- address?: string;
149
- name?: string;
147
+ address?: string | undefined;
148
+ name?: string | undefined;
150
149
  }
151
150
  /**
152
151
  * DSN parameters for the envelope (RFC 3461)
153
152
  */
154
153
  export interface SMTPEnvelopeDsn {
155
154
  /** Return either 'HDRS' (headers) or 'FULL' (body) with the notification */
156
- ret?: string | null;
155
+ ret?: string | null | undefined;
157
156
  /** Alias of ret */
158
- return?: string;
157
+ return?: string | undefined;
159
158
  /** Envelope identifier, sent as ENVID */
160
- envid?: string | null;
159
+ envid?: string | null | undefined;
161
160
  /** Alias of envid */
162
- id?: string;
161
+ id?: string | undefined;
163
162
  /** When to notify: 'NEVER', or any combination of 'SUCCESS', 'FAILURE' and 'DELAY' */
164
- notify?: string | string[] | null;
163
+ notify?: string | string[] | null | undefined;
165
164
  /** Original recipient, sent as ORCPT */
166
- recipient?: string;
165
+ recipient?: string | undefined;
167
166
  /** Alias of recipient, in the 'rfc822;address' form */
168
- orcpt?: string | null;
167
+ orcpt?: string | null | undefined;
169
168
  }
170
169
  /**
171
170
  * Envelope object accepted by send()
172
171
  */
173
172
  export interface SMTPEnvelope {
174
173
  /** Sender address */
175
- from?: string | SMTPEnvelopeAddress;
174
+ from?: string | SMTPEnvelopeAddress | undefined;
176
175
  /** Recipient address or addresses */
177
- to?: string | SMTPEnvelopeAddress | Array<string | SMTPEnvelopeAddress>;
176
+ to?: string | SMTPEnvelopeAddress | Array<string | SMTPEnvelopeAddress> | undefined;
178
177
  /** Message size in bytes, sent as the SIZE parameter when the server supports it */
179
- size?: number | string;
178
+ size?: number | string | undefined;
180
179
  /** DSN parameters, sent when the server supports the DSN extension */
181
- dsn?: SMTPEnvelopeDsn;
180
+ dsn?: SMTPEnvelopeDsn | undefined;
182
181
  /** Declare BODY=8BITMIME when the server supports it */
183
- use8BitMime?: boolean;
182
+ use8BitMime?: boolean | undefined;
184
183
  /** RFC 8689: send the REQUIRETLS parameter, requires a TLS connection and server support */
185
- requireTLSExtensionEnabled?: boolean;
184
+ requireTLSExtensionEnabled?: boolean | undefined;
186
185
  }
187
186
  /**
188
187
  * The envelope as tracked by the connection while a message is being sent. The from and to
189
188
  * values are normalized to strings and the recipient bookkeeping is added by _setEnvelope
190
189
  */
191
190
  export interface SMTPConnectionEnvelope extends SMTPEnvelope {
192
- from?: string;
193
- to?: string[];
191
+ from?: string | undefined;
192
+ to?: string[] | undefined;
194
193
  /** Recipients still waiting for RCPT TO */
195
194
  rcptQueue: string[];
196
195
  /** Recipients the server rejected */
@@ -209,17 +208,17 @@ export interface SMTPConnectionSendInfo {
209
208
  /** Recipients the server rejected */
210
209
  rejected: string[];
211
210
  /** EHLO response lines, without the greeting line */
212
- ehlo?: string[];
211
+ ehlo?: string[] | undefined;
213
212
  /** Errors for the rejected recipients */
214
- rejectedErrors?: NodemailerError[];
213
+ rejectedErrors?: NodemailerError[] | undefined;
215
214
  /** Time in ms spent on the envelope commands */
216
- envelopeTime?: number;
215
+ envelopeTime?: number | undefined;
217
216
  /** Time in ms spent on streaming the message */
218
- messageTime?: number;
217
+ messageTime?: number | undefined;
219
218
  /** Size of the encoded message in bytes */
220
- messageSize?: number;
219
+ messageSize?: number | undefined;
221
220
  /** Final server response for the message */
222
- response?: string;
221
+ response?: string | undefined;
223
222
  }
224
223
  /**
225
224
  * Callback for send()
@@ -244,11 +243,11 @@ export interface SMTPConnectionConnectOptions extends tls.ConnectionOptions {
244
243
  port: number;
245
244
  host: string;
246
245
  /** Outbound address to bind to */
247
- localAddress?: string;
246
+ localAddress?: string | undefined;
248
247
  /** Count loopback interfaces when resolving the hostname */
249
- allowInternalNetworkInterfaces?: boolean;
248
+ allowInternalNetworkInterfaces?: boolean | undefined;
250
249
  /** DNS lookup timeout in ms */
251
- timeout?: number;
250
+ timeout?: number | undefined;
252
251
  }
253
252
  /**
254
253
  * A queued handler for the next server response
@@ -313,167 +312,28 @@ declare class SMTPConnection extends EventEmitter {
313
312
  * @private
314
313
  */
315
314
  secure: boolean;
316
- /**
317
- * Store incomplete messages coming from the server
318
- * @private
319
- */
320
- _remainder: string;
321
- /**
322
- * Unprocessed responses from the server
323
- */
324
- _responseQueue: string[];
325
315
  lastServerResponse: string | false;
326
316
  /**
327
317
  * The socket connecting to the server
328
318
  * @public
329
319
  */
330
320
  _socket: net.Socket | false | null;
331
- /**
332
- * Lists supported auth mechanisms
333
- * @private
334
- */
335
- _supportedAuth: string[];
336
321
  /**
337
322
  * Set to true, if EHLO response includes "AUTH".
338
323
  * If false then authentication is not tried
339
324
  */
340
325
  allowsAuth: boolean;
341
- /**
342
- * Includes current envelope (from, to)
343
- * @private
344
- */
345
- _envelope: SMTPConnectionEnvelope | false;
346
- /**
347
- * Lists supported extensions
348
- * @private
349
- */
350
- _supportedExtensions: string[];
351
- /**
352
- * Defines the maximum allowed size for a single message
353
- * @private
354
- */
355
- _maxAllowedSize: number;
356
- /**
357
- * Function queue to run if a data chunk comes from the server
358
- * @private
359
- */
360
- _responseActions: SMTPConnectionResponseAction[];
361
- _recipientQueue: string[];
362
- /**
363
- * Timeout variable for waiting the greeting
364
- * @private
365
- */
366
- _greetingTimeout: NodeJS.Timeout | false;
367
- /**
368
- * Timeout variable for waiting the connection to start
369
- * @private
370
- */
371
- _connectionTimeout: NodeJS.Timeout | false;
372
- /**
373
- * If the socket is deemed already closed
374
- * @private
375
- */
376
- _destroyed: boolean;
377
- /**
378
- * If the socket is already being closed
379
- * @private
380
- */
381
- _closing: boolean;
382
- /**
383
- * Message DATA stream currently piped to the socket, if any. Tracked so
384
- * close() can unpipe it before tearing the socket down.
385
- * @private
386
- */
387
- _currentDataStream: DataStream | false;
388
- /**
389
- * Callbacks for socket's listeners
390
- */
391
- _onSocketData: (chunk: Buffer) => void;
392
- _onSocketError: (error: Error) => void;
393
- _onSocketClose: () => void;
394
- _onSocketEnd: () => void;
395
- _onSocketTimeout: () => void;
396
- /**
397
- * Connection-phase error handler (supports fallback to alternative addresses)
398
- */
399
- _onConnectionSocketError: (err: Error) => void;
400
- /**
401
- * Connection attempt counter for fallback race condition protection
402
- * @private
403
- */
404
- _connectionAttemptId: number;
405
- /**
406
- * Alternative resolved addresses to try when the connection fails, set by connect()
407
- * @private
408
- */
409
- _fallbackAddresses?: string[];
410
- /**
411
- * Options of the current connection attempt, set by connect()
412
- * @private
413
- */
414
- _connectOpts?: SMTPConnectionConnectOptions;
415
- /**
416
- * Authentication data, set by login()
417
- * @private
418
- */
419
- _auth: SMTPConnectionAuth;
420
- /**
421
- * Selected SASL method, set by login()
422
- * @private
423
- */
424
- _authMethod: string | false;
425
326
  /**
426
327
  * True while the STARTTLS upgrade is in progress
427
328
  * @private
428
329
  */
429
- upgrading?: boolean;
430
- /**
431
- * EHLO response lines, without the greeting line
432
- * @private
433
- */
434
- _ehloLines?: string[];
435
- /**
436
- * True if SMTPUTF8 was declared for the current envelope
437
- * @private
438
- */
439
- _usingSmtpUtf8?: boolean;
440
- /**
441
- * True if BODY=8BITMIME was declared for the current envelope
442
- * @private
443
- */
444
- _using8BitMime?: boolean;
330
+ upgrading?: boolean | undefined;
445
331
  constructor(options?: SMTPConnectionOptions);
446
332
  /**
447
333
  * Creates a connection to a SMTP server and sets up connection
448
334
  * listener
449
335
  */
450
336
  connect(connectCallback?: SMTPConnectionConnectCallback): void;
451
- /**
452
- * Resolves the hostname and applies resolved values to opts,
453
- * then calls the provided callback with the resolved data
454
- *
455
- * @param opts Connection options (modified in place)
456
- * @param callback Called with resolved data on success
457
- */
458
- _resolveAndConnect(opts: SMTPConnectionConnectOptions, callback: (resolved: shared.ResolvedHostname) => void): void;
459
- /**
460
- * Attempts to connect to the specified host address
461
- *
462
- * @param opts Connection options
463
- * @param secure Whether to use TLS
464
- */
465
- _connectToHost(opts: SMTPConnectionConnectOptions, secure: boolean): void;
466
- /**
467
- * Sets up connection timeout and error handlers
468
- */
469
- _setupConnectionHandlers(): void;
470
- /**
471
- * Handles connection errors with fallback to alternative addresses
472
- *
473
- * @param err Error object or message
474
- * @param code Error code
475
- */
476
- _onConnectionError(err: Error | string, code: string): void;
477
337
  /**
478
338
  * Sends QUIT
479
339
  */
@@ -500,207 +360,6 @@ declare class SMTPConnection extends EventEmitter {
500
360
  * @param callback Callback to return once connection is reset
501
361
  */
502
362
  reset(callback: SMTPConnectionCallback): void;
503
- /**
504
- * Connection listener that is run when the connection to
505
- * the server is opened
506
- *
507
- * @event
508
- */
509
- _onConnect(): void;
510
- /**
511
- * 'data' listener for data coming from the server
512
- *
513
- * @event
514
- * @param chunk Data chunk coming from the server
515
- */
516
- _onData(chunk: Buffer): void;
517
- /**
518
- * 'error' listener for the socket
519
- *
520
- * @event
521
- * @param err Error object
522
- * @param type Error name
523
- */
524
- _onError(err: NodemailerError | string, type: string | false, data: string | false, command: string | false): void;
525
- _formatError(message: Error | string, type?: string | false, response?: string | false, command?: string | false): NodemailerError;
526
- /**
527
- * 'close' listener for the socket
528
- *
529
- * @event
530
- */
531
- _onClose(): void;
532
- /**
533
- * 'end' listener for the socket
534
- *
535
- * @event
536
- */
537
- _onEnd(): void;
538
- /**
539
- * 'timeout' listener for the socket
540
- *
541
- * @event
542
- */
543
- _onTimeout(): void;
544
- /**
545
- * Destroys the client, emits 'end'
546
- */
547
- _destroy(): void;
548
- /**
549
- * Upgrades the connection to TLS
550
- *
551
- * @param callback Callback function to run when the connection
552
- * has been secured
553
- */
554
- _upgradeConnection(callback: (err: Error | null, secured?: boolean) => void): void;
555
- /**
556
- * Processes queued responses from the server
557
- */
558
- _processResponse(): boolean | void;
559
- /**
560
- * Send a command to the server, append \r\n
561
- *
562
- * @param str String to be sent to the server
563
- * @param logStr Optional string to be used for logging instead of the actual string
564
- */
565
- _sendCommand(str: string, logStr?: string): void;
566
- /**
567
- * Initiates a new message by submitting envelope data, starting with
568
- * MAIL FROM: command
569
- *
570
- * @param envelope Envelope object in the form of
571
- * {from:'...', to:['...']}
572
- * or
573
- * {from:{address:'...',name:'...'}, to:[address:'...',name:'...']}
574
- */
575
- _setEnvelope(envelope: SMTPEnvelope | undefined, callback: SMTPConnectionSendCallback): void;
576
- _setDsnEnvelope(params: SMTPEnvelopeDsn): SMTPEnvelopeDsn;
577
- _getDsnRcptToArgs(): string;
578
- _createSendStream(callback: SMTPConnectionResponseCallback): DataStream;
579
- /** ACTIONS **/
580
- /**
581
- * Will be run after the connection is created and the server sends
582
- * a greeting. If the incoming message starts with 220 initiate
583
- * SMTP session by sending EHLO command
584
- *
585
- * @param str Message from the server
586
- */
587
- _actionGreeting(str: string): void;
588
- /**
589
- * Handles server response for LHLO command. If it yielded in
590
- * error, emit 'error', otherwise treat this as an EHLO response
591
- *
592
- * @param str Message from the server
593
- */
594
- _actionLHLO(str: string): void;
595
- /**
596
- * Handles server response for EHLO command. If it yielded in
597
- * error, try HELO instead, otherwise initiate TLS negotiation
598
- * if STARTTLS is supported by the server or move into the
599
- * authentication phase.
600
- *
601
- * @param str Message from the server
602
- */
603
- _actionEHLO(str: string): void;
604
- /**
605
- * Handles server response for HELO command. If it yielded in
606
- * error, emit 'error', otherwise move into the authentication phase.
607
- *
608
- * @param str Message from the server
609
- */
610
- _actionHELO(str: string): void;
611
- /**
612
- * Handles server response for STARTTLS command. If there's an error
613
- * try HELO instead, otherwise initiate TLS upgrade. If the upgrade
614
- * succeedes restart the EHLO
615
- *
616
- * @param str Message from the server
617
- */
618
- _actionSTARTTLS(str: string): void;
619
- /**
620
- * Handle the response for AUTH LOGIN command. We are expecting
621
- * '334 VXNlcm5hbWU6' (base64 for 'Username:'). Data to be sent as
622
- * response needs to be base64 encoded username. We do not need
623
- * exact match but settle with 334 response in general as some
624
- * hosts invalidly use a longer message than VXNlcm5hbWU6
625
- *
626
- * @param str Message from the server
627
- */
628
- _actionAUTH_LOGIN_USER(str: string, callback: SMTPConnectionCallback): void;
629
- /**
630
- * Handle the response for AUTH CRAM-MD5 command. We are expecting
631
- * '334 <challenge string>'. Data to be sent as response needs to be
632
- * base64 decoded challenge string, MD5 hashed using the password as
633
- * a HMAC key, prefixed by the username and a space, and finally all
634
- * base64 encoded again.
635
- *
636
- * @param str Message from the server
637
- */
638
- _actionAUTH_CRAM_MD5(str: string, callback: SMTPConnectionCallback): void;
639
- /**
640
- * Handles the response to CRAM-MD5 authentication, if there's no error,
641
- * the user can be considered logged in. Start waiting for a message to send
642
- *
643
- * @param str Message from the server
644
- */
645
- _actionAUTH_CRAM_MD5_PASS(str: string, callback: SMTPConnectionCallback): void;
646
- /**
647
- * Handle the response for AUTH LOGIN command. We are expecting
648
- * '334 UGFzc3dvcmQ6' (base64 for 'Password:'). Data to be sent as
649
- * response needs to be base64 encoded password.
650
- *
651
- * @param str Message from the server
652
- */
653
- _actionAUTH_LOGIN_PASS(str: string, callback: SMTPConnectionCallback): void;
654
- /**
655
- * Handles the response for authentication, if there's no error,
656
- * the user can be considered logged in. Start waiting for a message to send
657
- *
658
- * @param str Message from the server
659
- */
660
- _actionAUTHComplete(str: string, isRetry: boolean | SMTPConnectionCallback, callback?: SMTPConnectionCallback): void;
661
- /**
662
- * Handle response for a MAIL FROM: command
663
- *
664
- * @param str Message from the server
665
- */
666
- _actionMAIL(str: string, callback: SMTPConnectionSendCallback): void;
667
- /**
668
- * Handle response for a RCPT TO: command
669
- *
670
- * @param str Message from the server
671
- */
672
- _actionRCPT(str: string, callback: SMTPConnectionSendCallback): void;
673
- /**
674
- * Handle response for a DATA command
675
- *
676
- * @param str Message from the server
677
- */
678
- _actionDATA(str: string, callback: SMTPConnectionSendCallback): void;
679
- /**
680
- * Handle response for a DATA stream when using SMTP
681
- * We expect a single response that defines if the sending succeeded or failed
682
- *
683
- * @param str Message from the server
684
- */
685
- _actionSMTPStream(str: string, callback: SMTPConnectionResponseCallback): void;
686
- /**
687
- * Handle response for a DATA stream
688
- * We expect a separate response for every recipient. All recipients can either
689
- * succeed or fail separately
690
- *
691
- * @param recipient The recipient this response applies to
692
- * @param final Is this the final recipient?
693
- * @param str Message from the server
694
- */
695
- _actionLMTPStream(recipient: string, final: boolean, str: string, callback: SMTPConnectionResponseCallback): void;
696
- _handleXOauth2Token(isRetry: boolean, callback: SMTPConnectionCallback): void;
697
- /**
698
- *
699
- * @param command
700
- * @private
701
- */
702
- _isDestroyedMessage(command: string): string | undefined;
703
- _getHostname(): string;
704
363
  }
705
364
  /**
706
365
  * Type aliases in the layout of @types/nodemailer, so `SMTPConnection.Options` style references keep working