@mavogel/awscdk-rootmail 0.1.4 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (195) hide show
  1. package/.jsii +3 -3
  2. package/lib/rootmail.js +1 -1
  3. package/lib/ses-receive.js +1 -1
  4. package/node_modules/@aws-sdk/checksums/package.json +2 -2
  5. package/node_modules/@aws-sdk/client-cloudwatch-logs/dist-cjs/index.js +1 -1
  6. package/node_modules/@aws-sdk/client-cloudwatch-logs/package.json +3 -3
  7. package/node_modules/@aws-sdk/client-route-53/dist-cjs/index.js +1 -1
  8. package/node_modules/@aws-sdk/client-route-53/package.json +3 -3
  9. package/node_modules/@aws-sdk/client-s3/dist-cjs/index.js +38 -15
  10. package/node_modules/@aws-sdk/client-s3/dist-es/models/enums.js +7 -0
  11. package/node_modules/@aws-sdk/client-s3/dist-es/schemas/schemas_0.js +28 -14
  12. package/node_modules/@aws-sdk/client-s3/dist-types/commands/CopyObjectCommand.d.ts +3 -0
  13. package/node_modules/@aws-sdk/client-s3/dist-types/commands/CreateMultipartUploadCommand.d.ts +3 -0
  14. package/node_modules/@aws-sdk/client-s3/dist-types/commands/GetBucketInventoryConfigurationCommand.d.ts +1 -1
  15. package/node_modules/@aws-sdk/client-s3/dist-types/commands/GetBucketNotificationConfigurationCommand.d.ts +3 -3
  16. package/node_modules/@aws-sdk/client-s3/dist-types/commands/GetObjectCommand.d.ts +3 -0
  17. package/node_modules/@aws-sdk/client-s3/dist-types/commands/GetObjectLockConfigurationCommand.d.ts +4 -0
  18. package/node_modules/@aws-sdk/client-s3/dist-types/commands/GetObjectRetentionCommand.d.ts +5 -0
  19. package/node_modules/@aws-sdk/client-s3/dist-types/commands/HeadObjectCommand.d.ts +3 -0
  20. package/node_modules/@aws-sdk/client-s3/dist-types/commands/ListBucketInventoryConfigurationsCommand.d.ts +1 -1
  21. package/node_modules/@aws-sdk/client-s3/dist-types/commands/PutBucketInventoryConfigurationCommand.d.ts +1 -1
  22. package/node_modules/@aws-sdk/client-s3/dist-types/commands/PutBucketNotificationConfigurationCommand.d.ts +3 -3
  23. package/node_modules/@aws-sdk/client-s3/dist-types/commands/PutObjectCommand.d.ts +3 -0
  24. package/node_modules/@aws-sdk/client-s3/dist-types/commands/PutObjectLockConfigurationCommand.d.ts +4 -0
  25. package/node_modules/@aws-sdk/client-s3/dist-types/commands/PutObjectRetentionCommand.d.ts +5 -0
  26. package/node_modules/@aws-sdk/client-s3/dist-types/commands/PutPublicAccessBlockCommand.d.ts +1 -1
  27. package/node_modules/@aws-sdk/client-s3/dist-types/models/enums.d.ts +15 -0
  28. package/node_modules/@aws-sdk/client-s3/dist-types/models/models_0.d.ts +186 -49
  29. package/node_modules/@aws-sdk/client-s3/dist-types/models/models_1.d.ts +43 -1
  30. package/node_modules/@aws-sdk/client-s3/dist-types/schemas/schemas_0.d.ts +1 -0
  31. package/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/PutPublicAccessBlockCommand.d.ts +1 -1
  32. package/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/models/enums.d.ts +8 -0
  33. package/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/models/models_0.d.ts +23 -7
  34. package/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/models/models_1.d.ts +14 -1
  35. package/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/schemas/schemas_0.d.ts +1 -0
  36. package/node_modules/@aws-sdk/client-s3/package.json +6 -6
  37. package/node_modules/@aws-sdk/client-ses/dist-cjs/index.js +1 -1
  38. package/node_modules/@aws-sdk/client-ses/package.json +3 -3
  39. package/node_modules/@aws-sdk/client-ssm/dist-cjs/index.js +1 -1
  40. package/node_modules/@aws-sdk/client-ssm/package.json +3 -3
  41. package/node_modules/@aws-sdk/core/dist-cjs/submodules/util/index.js +5 -0
  42. package/node_modules/@aws-sdk/core/dist-es/submodules/util/hasOwn.js +3 -0
  43. package/node_modules/@aws-sdk/core/dist-es/submodules/util/index.js +1 -0
  44. package/node_modules/@aws-sdk/core/dist-types/submodules/util/hasOwn.d.ts +4 -0
  45. package/node_modules/@aws-sdk/core/dist-types/submodules/util/index.d.ts +1 -0
  46. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/util/hasOwn.d.ts +1 -0
  47. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/util/index.d.ts +1 -0
  48. package/node_modules/@aws-sdk/core/package.json +1 -1
  49. package/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
  50. package/node_modules/@aws-sdk/credential-provider-http/package.json +2 -2
  51. package/node_modules/@aws-sdk/credential-provider-ini/package.json +9 -9
  52. package/node_modules/@aws-sdk/credential-provider-login/package.json +3 -3
  53. package/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
  54. package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
  55. package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
  56. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
  57. package/node_modules/@aws-sdk/middleware-sdk-s3/package.json +2 -2
  58. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
  59. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +1 -1
  60. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
  61. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
  62. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
  63. package/node_modules/@aws-sdk/nested-clients/package.json +2 -2
  64. package/node_modules/@aws-sdk/token-providers/package.json +3 -3
  65. package/node_modules/@zone-eu/mailsplit/package.json +3 -3
  66. package/node_modules/encoding-japanese/LICENSE +25 -1
  67. package/node_modules/encoding-japanese/README.md +86 -51
  68. package/node_modules/encoding-japanese/encoding.js +107 -78
  69. package/node_modules/encoding-japanese/encoding.min.js +2 -2
  70. package/node_modules/encoding-japanese/index.d.ts +102 -0
  71. package/node_modules/encoding-japanese/package.json +26 -17
  72. package/node_modules/encoding-japanese/src/encoding-convert.js +67 -58
  73. package/node_modules/encoding-japanese/src/encoding-table.js +1 -0
  74. package/node_modules/encoding-japanese/src/index.js +1 -1
  75. package/node_modules/encoding-japanese/src/kana-case-table.js +1 -1
  76. package/node_modules/encoding-japanese/src/utf8-to-jis-alias-table.js +14 -0
  77. package/node_modules/encoding-japanese/src/utf8-to-jis-table.js +6 -5
  78. package/node_modules/encoding-japanese/src/utf8-to-jisx0212-table.js +7 -5
  79. package/node_modules/libmime/CHANGELOG.md +7 -0
  80. package/node_modules/libmime/package.json +2 -2
  81. package/node_modules/mailparser/.release-please-manifest.json +1 -1
  82. package/node_modules/mailparser/CHANGELOG.md +42 -0
  83. package/node_modules/mailparser/package.json +5 -5
  84. package/node_modules/nodemailer/CHANGELOG.md +83 -0
  85. package/node_modules/nodemailer/dist/cjs/addressparser/index.d.ts +1 -3
  86. package/node_modules/nodemailer/dist/cjs/addressparser/index.js +176 -13
  87. package/node_modules/nodemailer/dist/cjs/base64/index.d.ts +2 -6
  88. package/node_modules/nodemailer/dist/cjs/base64/index.js +2 -0
  89. package/node_modules/nodemailer/dist/cjs/dkim/index.d.ts +4 -4
  90. package/node_modules/nodemailer/dist/cjs/dkim/message-parser.d.ts +1 -3
  91. package/node_modules/nodemailer/dist/cjs/dkim/message-parser.js +14 -5
  92. package/node_modules/nodemailer/dist/cjs/dkim/relaxed-body.d.ts +3 -22
  93. package/node_modules/nodemailer/dist/cjs/dkim/relaxed-body.js +5 -0
  94. package/node_modules/nodemailer/dist/cjs/dkim/sign.d.ts +5 -5
  95. package/node_modules/nodemailer/dist/cjs/errors.d.ts +8 -8
  96. package/node_modules/nodemailer/dist/cjs/fetch/cookies.d.ts +12 -10
  97. package/node_modules/nodemailer/dist/cjs/fetch/cookies.js +28 -14
  98. package/node_modules/nodemailer/dist/cjs/fetch/index.d.ts +15 -15
  99. package/node_modules/nodemailer/dist/cjs/json-transport/index.d.ts +2 -2
  100. package/node_modules/nodemailer/dist/cjs/mail-composer/index.d.ts +49 -104
  101. package/node_modules/nodemailer/dist/cjs/mail-composer/index.js +14 -3
  102. package/node_modules/nodemailer/dist/cjs/mailer/index.d.ts +21 -28
  103. package/node_modules/nodemailer/dist/cjs/mailer/index.js +19 -5
  104. package/node_modules/nodemailer/dist/cjs/mailer/mail-message.d.ts +8 -12
  105. package/node_modules/nodemailer/dist/cjs/mailer/mail-message.js +4 -1
  106. package/node_modules/nodemailer/dist/cjs/mime-funcs/index.d.ts +1 -1
  107. package/node_modules/nodemailer/dist/cjs/mime-funcs/index.js +4 -1
  108. package/node_modules/nodemailer/dist/cjs/mime-node/index.d.ts +37 -191
  109. package/node_modules/nodemailer/dist/cjs/mime-node/index.js +82 -12
  110. package/node_modules/nodemailer/dist/cjs/mime-node/last-newline.d.ts +1 -3
  111. package/node_modules/nodemailer/dist/cjs/mime-node/last-newline.js +2 -0
  112. package/node_modules/nodemailer/dist/cjs/mime-node/le-unix.d.ts +1 -5
  113. package/node_modules/nodemailer/dist/cjs/mime-node/le-unix.js +1 -0
  114. package/node_modules/nodemailer/dist/cjs/mime-node/le-windows.d.ts +1 -5
  115. package/node_modules/nodemailer/dist/cjs/mime-node/le-windows.js +1 -0
  116. package/node_modules/nodemailer/dist/cjs/nodemailer.d.ts +2 -2
  117. package/node_modules/nodemailer/dist/cjs/package-info.d.ts +1 -1
  118. package/node_modules/nodemailer/dist/cjs/package-info.js +1 -1
  119. package/node_modules/nodemailer/dist/cjs/qp/index.d.ts +2 -5
  120. package/node_modules/nodemailer/dist/cjs/qp/index.js +2 -0
  121. package/node_modules/nodemailer/dist/cjs/sendmail-transport/index.d.ts +4 -6
  122. package/node_modules/nodemailer/dist/cjs/ses-transport/index.d.ts +2 -2
  123. package/node_modules/nodemailer/dist/cjs/ses-transport/index.js +5 -1
  124. package/node_modules/nodemailer/dist/cjs/shared/index.d.ts +31 -37
  125. package/node_modules/nodemailer/dist/cjs/shared/index.js +19 -7
  126. package/node_modules/nodemailer/dist/cjs/smtp-connection/data-stream.d.ts +1 -9
  127. package/node_modules/nodemailer/dist/cjs/smtp-connection/data-stream.js +2 -0
  128. package/node_modules/nodemailer/dist/cjs/smtp-connection/http-proxy-client.d.ts +1 -1
  129. package/node_modules/nodemailer/dist/cjs/smtp-connection/index.d.ts +65 -403
  130. package/node_modules/nodemailer/dist/cjs/smtp-connection/index.js +99 -19
  131. package/node_modules/nodemailer/dist/cjs/smtp-pool/index.d.ts +8 -46
  132. package/node_modules/nodemailer/dist/cjs/smtp-pool/index.js +13 -2
  133. package/node_modules/nodemailer/dist/cjs/smtp-pool/pool-resource.d.ts +2 -4
  134. package/node_modules/nodemailer/dist/cjs/smtp-transport/index.d.ts +16 -16
  135. package/node_modules/nodemailer/dist/cjs/stream-transport/index.d.ts +3 -3
  136. package/node_modules/nodemailer/dist/cjs/well-known/index.d.ts +9 -9
  137. package/node_modules/nodemailer/dist/cjs/well-known/services.js +2 -0
  138. package/node_modules/nodemailer/dist/cjs/xoauth2/index.d.ts +18 -18
  139. package/node_modules/nodemailer/dist/esm/addressparser/index.d.ts +1 -3
  140. package/node_modules/nodemailer/dist/esm/addressparser/index.js +176 -13
  141. package/node_modules/nodemailer/dist/esm/base64/index.d.ts +2 -6
  142. package/node_modules/nodemailer/dist/esm/base64/index.js +2 -0
  143. package/node_modules/nodemailer/dist/esm/dkim/index.d.ts +4 -4
  144. package/node_modules/nodemailer/dist/esm/dkim/message-parser.d.ts +1 -3
  145. package/node_modules/nodemailer/dist/esm/dkim/message-parser.js +14 -5
  146. package/node_modules/nodemailer/dist/esm/dkim/relaxed-body.d.ts +3 -22
  147. package/node_modules/nodemailer/dist/esm/dkim/relaxed-body.js +5 -0
  148. package/node_modules/nodemailer/dist/esm/dkim/sign.d.ts +5 -5
  149. package/node_modules/nodemailer/dist/esm/errors.d.ts +8 -8
  150. package/node_modules/nodemailer/dist/esm/fetch/cookies.d.ts +12 -10
  151. package/node_modules/nodemailer/dist/esm/fetch/cookies.js +25 -14
  152. package/node_modules/nodemailer/dist/esm/fetch/index.d.ts +15 -15
  153. package/node_modules/nodemailer/dist/esm/json-transport/index.d.ts +2 -2
  154. package/node_modules/nodemailer/dist/esm/mail-composer/index.d.ts +49 -104
  155. package/node_modules/nodemailer/dist/esm/mail-composer/index.js +14 -3
  156. package/node_modules/nodemailer/dist/esm/mailer/index.d.ts +21 -28
  157. package/node_modules/nodemailer/dist/esm/mailer/index.js +19 -5
  158. package/node_modules/nodemailer/dist/esm/mailer/mail-message.d.ts +8 -12
  159. package/node_modules/nodemailer/dist/esm/mailer/mail-message.js +4 -1
  160. package/node_modules/nodemailer/dist/esm/mime-funcs/index.d.ts +1 -1
  161. package/node_modules/nodemailer/dist/esm/mime-funcs/index.js +4 -1
  162. package/node_modules/nodemailer/dist/esm/mime-node/index.d.ts +37 -191
  163. package/node_modules/nodemailer/dist/esm/mime-node/index.js +82 -12
  164. package/node_modules/nodemailer/dist/esm/mime-node/last-newline.d.ts +1 -3
  165. package/node_modules/nodemailer/dist/esm/mime-node/last-newline.js +2 -0
  166. package/node_modules/nodemailer/dist/esm/mime-node/le-unix.d.ts +1 -5
  167. package/node_modules/nodemailer/dist/esm/mime-node/le-unix.js +1 -0
  168. package/node_modules/nodemailer/dist/esm/mime-node/le-windows.d.ts +1 -5
  169. package/node_modules/nodemailer/dist/esm/mime-node/le-windows.js +1 -0
  170. package/node_modules/nodemailer/dist/esm/nodemailer.d.ts +2 -2
  171. package/node_modules/nodemailer/dist/esm/package-info.d.ts +1 -1
  172. package/node_modules/nodemailer/dist/esm/package-info.js +1 -1
  173. package/node_modules/nodemailer/dist/esm/qp/index.d.ts +2 -5
  174. package/node_modules/nodemailer/dist/esm/qp/index.js +2 -0
  175. package/node_modules/nodemailer/dist/esm/sendmail-transport/index.d.ts +4 -6
  176. package/node_modules/nodemailer/dist/esm/ses-transport/index.d.ts +2 -2
  177. package/node_modules/nodemailer/dist/esm/ses-transport/index.js +5 -1
  178. package/node_modules/nodemailer/dist/esm/shared/index.d.ts +31 -37
  179. package/node_modules/nodemailer/dist/esm/shared/index.js +19 -7
  180. package/node_modules/nodemailer/dist/esm/smtp-connection/data-stream.d.ts +1 -9
  181. package/node_modules/nodemailer/dist/esm/smtp-connection/data-stream.js +2 -0
  182. package/node_modules/nodemailer/dist/esm/smtp-connection/http-proxy-client.d.ts +1 -1
  183. package/node_modules/nodemailer/dist/esm/smtp-connection/index.d.ts +65 -403
  184. package/node_modules/nodemailer/dist/esm/smtp-connection/index.js +99 -19
  185. package/node_modules/nodemailer/dist/esm/smtp-pool/index.d.ts +8 -46
  186. package/node_modules/nodemailer/dist/esm/smtp-pool/index.js +13 -2
  187. package/node_modules/nodemailer/dist/esm/smtp-pool/pool-resource.d.ts +2 -4
  188. package/node_modules/nodemailer/dist/esm/smtp-transport/index.d.ts +16 -16
  189. package/node_modules/nodemailer/dist/esm/stream-transport/index.d.ts +3 -3
  190. package/node_modules/nodemailer/dist/esm/well-known/index.d.ts +9 -9
  191. package/node_modules/nodemailer/dist/esm/well-known/services.js +2 -0
  192. package/node_modules/nodemailer/dist/esm/xoauth2/index.d.ts +18 -18
  193. package/node_modules/nodemailer/dist/well-known/services.json +2 -2
  194. package/node_modules/nodemailer/package.json +6 -6
  195. package/package.json +1 -1
@@ -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,85 @@ 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;
44
+ /** Largest single server response to accept in bytes, defaults to 1 MB */
45
+ maxResponseSize?: number | undefined;
45
46
  /** Time to wait in ms for the DNS requests to be resolved, defaults to 30 seconds */
46
- dnsTimeout?: number;
47
+ dnsTimeout?: number | undefined;
47
48
  /** Use LMTP instead of SMTP */
48
- lmtp?: boolean;
49
+ lmtp?: boolean | undefined;
49
50
  /** Bunyan compatible logger interface, true for the default console logger */
50
- logger?: shared.ExternalLogger | boolean;
51
+ logger?: shared.ExternalLogger | boolean | undefined;
51
52
  /** Pass SMTP traffic, including the message data, to the logger */
52
- debug?: boolean;
53
+ debug?: boolean | undefined;
53
54
  /** Pass SMTP commands and responses to the logger */
54
- transactionLog?: boolean;
55
+ transactionLog?: boolean | undefined;
55
56
  /** Options for tls.connect */
56
- tls?: tls.ConnectionOptions;
57
+ tls?: tls.ConnectionOptions | undefined;
57
58
  /** Existing socket to use instead of creating a new one, not connected yet */
58
- socket?: net.Socket;
59
+ socket?: net.Socket | undefined;
59
60
  /** Already opened connection to use instead of creating a new one */
60
- connection?: net.Socket;
61
+ connection?: net.Socket | undefined;
61
62
  /** Count loopback interfaces when checking which address families are usable */
62
- allowInternalNetworkInterfaces?: boolean;
63
+ allowInternalNetworkInterfaces?: boolean | undefined;
63
64
  /** Logger component name, defaults to 'smtp-connection' */
64
- component?: string;
65
+ component?: string | undefined;
65
66
  /** Custom authentication handlers keyed by method name */
66
- customAuth?: SMTPConnectionCustomAuthHandlers;
67
+ customAuth?: SMTPConnectionCustomAuthHandlers | undefined;
67
68
  }
68
69
  /**
69
70
  * User and password credentials resolved for a SASL mechanism
70
71
  */
71
72
  export interface SMTPConnectionCredentials {
72
- user?: string;
73
- pass?: string;
73
+ user?: string | undefined;
74
+ pass?: string | undefined;
74
75
  /** Extra options for the authentication method, copied from the auth object */
75
76
  options?: {
76
77
  [key: string]: any;
77
- };
78
+ } | undefined;
78
79
  }
79
80
  /**
80
81
  * Authentication data for login()
81
82
  */
82
83
  export interface SMTPConnectionAuth {
83
84
  /** Authentication type, informational */
84
- type?: string;
85
+ type?: string | undefined;
85
86
  /** 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;
87
+ method?: string | false | undefined;
88
+ user?: string | undefined;
89
+ pass?: string | undefined;
89
90
  /** Extra options for the authentication method */
90
91
  options?: {
91
92
  [key: string]: any;
92
- };
93
+ } | undefined;
93
94
  /** XOAuth2 token generator, selects XOAUTH2 when no method is set */
94
- oauth2?: XOAuth2;
95
+ oauth2?: XOAuth2 | undefined;
95
96
  /** Credentials for the SASL mechanism, filled in from user and pass when missing */
96
- credentials?: SMTPConnectionCredentials;
97
+ credentials?: SMTPConnectionCredentials | undefined;
97
98
  /** Custom authentication handlers receive the auth object as is, so it may carry any other value */
98
99
  [key: string]: any;
99
100
  }
@@ -108,7 +109,7 @@ export interface SMTPConnectionCustomAuthResponse {
108
109
  /** Numeric status code, 0 if the response did not start with one */
109
110
  status: number;
110
111
  /** Enhanced status code, if any */
111
- code?: string;
112
+ code?: string | undefined;
112
113
  /** Response text without the status codes */
113
114
  text: string;
114
115
  }
@@ -145,52 +146,52 @@ export type SMTPConnectionCustomAuthHandler = (ctx: SMTPConnectionCustomAuthCont
145
146
  * An envelope address, either a plain string or an object with an address property
146
147
  */
147
148
  export interface SMTPEnvelopeAddress {
148
- address?: string;
149
- name?: string;
149
+ address?: string | undefined;
150
+ name?: string | undefined;
150
151
  }
151
152
  /**
152
153
  * DSN parameters for the envelope (RFC 3461)
153
154
  */
154
155
  export interface SMTPEnvelopeDsn {
155
156
  /** Return either 'HDRS' (headers) or 'FULL' (body) with the notification */
156
- ret?: string | null;
157
+ ret?: string | null | undefined;
157
158
  /** Alias of ret */
158
- return?: string;
159
+ return?: string | undefined;
159
160
  /** Envelope identifier, sent as ENVID */
160
- envid?: string | null;
161
+ envid?: string | null | undefined;
161
162
  /** Alias of envid */
162
- id?: string;
163
+ id?: string | undefined;
163
164
  /** When to notify: 'NEVER', or any combination of 'SUCCESS', 'FAILURE' and 'DELAY' */
164
- notify?: string | string[] | null;
165
+ notify?: string | string[] | null | undefined;
165
166
  /** Original recipient, sent as ORCPT */
166
- recipient?: string;
167
+ recipient?: string | undefined;
167
168
  /** Alias of recipient, in the 'rfc822;address' form */
168
- orcpt?: string | null;
169
+ orcpt?: string | null | undefined;
169
170
  }
170
171
  /**
171
172
  * Envelope object accepted by send()
172
173
  */
173
174
  export interface SMTPEnvelope {
174
175
  /** Sender address */
175
- from?: string | SMTPEnvelopeAddress;
176
+ from?: string | SMTPEnvelopeAddress | undefined;
176
177
  /** Recipient address or addresses */
177
- to?: string | SMTPEnvelopeAddress | Array<string | SMTPEnvelopeAddress>;
178
+ to?: string | SMTPEnvelopeAddress | Array<string | SMTPEnvelopeAddress> | undefined;
178
179
  /** Message size in bytes, sent as the SIZE parameter when the server supports it */
179
- size?: number | string;
180
+ size?: number | string | undefined;
180
181
  /** DSN parameters, sent when the server supports the DSN extension */
181
- dsn?: SMTPEnvelopeDsn;
182
+ dsn?: SMTPEnvelopeDsn | undefined;
182
183
  /** Declare BODY=8BITMIME when the server supports it */
183
- use8BitMime?: boolean;
184
+ use8BitMime?: boolean | undefined;
184
185
  /** RFC 8689: send the REQUIRETLS parameter, requires a TLS connection and server support */
185
- requireTLSExtensionEnabled?: boolean;
186
+ requireTLSExtensionEnabled?: boolean | undefined;
186
187
  }
187
188
  /**
188
189
  * The envelope as tracked by the connection while a message is being sent. The from and to
189
190
  * values are normalized to strings and the recipient bookkeeping is added by _setEnvelope
190
191
  */
191
192
  export interface SMTPConnectionEnvelope extends SMTPEnvelope {
192
- from?: string;
193
- to?: string[];
193
+ from?: string | undefined;
194
+ to?: string[] | undefined;
194
195
  /** Recipients still waiting for RCPT TO */
195
196
  rcptQueue: string[];
196
197
  /** Recipients the server rejected */
@@ -209,17 +210,17 @@ export interface SMTPConnectionSendInfo {
209
210
  /** Recipients the server rejected */
210
211
  rejected: string[];
211
212
  /** EHLO response lines, without the greeting line */
212
- ehlo?: string[];
213
+ ehlo?: string[] | undefined;
213
214
  /** Errors for the rejected recipients */
214
- rejectedErrors?: NodemailerError[];
215
+ rejectedErrors?: NodemailerError[] | undefined;
215
216
  /** Time in ms spent on the envelope commands */
216
- envelopeTime?: number;
217
+ envelopeTime?: number | undefined;
217
218
  /** Time in ms spent on streaming the message */
218
- messageTime?: number;
219
+ messageTime?: number | undefined;
219
220
  /** Size of the encoded message in bytes */
220
- messageSize?: number;
221
+ messageSize?: number | undefined;
221
222
  /** Final server response for the message */
222
- response?: string;
223
+ response?: string | undefined;
223
224
  }
224
225
  /**
225
226
  * Callback for send()
@@ -244,11 +245,11 @@ export interface SMTPConnectionConnectOptions extends tls.ConnectionOptions {
244
245
  port: number;
245
246
  host: string;
246
247
  /** Outbound address to bind to */
247
- localAddress?: string;
248
+ localAddress?: string | undefined;
248
249
  /** Count loopback interfaces when resolving the hostname */
249
- allowInternalNetworkInterfaces?: boolean;
250
+ allowInternalNetworkInterfaces?: boolean | undefined;
250
251
  /** DNS lookup timeout in ms */
251
- timeout?: number;
252
+ timeout?: number | undefined;
252
253
  }
253
254
  /**
254
255
  * A queued handler for the next server response
@@ -269,6 +270,7 @@ export type SMTPConnectionResponseAction = (str: string) => void;
269
270
  * * **greetingTimeout** - Time to wait in ms until greeting message is received from the server (defaults to 30 seconds)
270
271
  * * **connectionTimeout** - how many milliseconds to wait for the connection to establish (defaults to 2 minutes)
271
272
  * * **socketTimeout** - Time of inactivity until the connection is closed (defaults to 10 minutes)
273
+ * * **maxResponseSize** - Largest single server response to accept in bytes (defaults to 1 MB)
272
274
  * * **dnsTimeout** - Time to wait in ms for the DNS requests to be resolved (defaults to 30 seconds)
273
275
  * * **lmtp** - if true, uses LMTP instead of SMTP protocol
274
276
  * * **logger** - bunyan compatible logger interface
@@ -313,167 +315,28 @@ declare class SMTPConnection extends EventEmitter {
313
315
  * @private
314
316
  */
315
317
  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
318
  lastServerResponse: string | false;
326
319
  /**
327
320
  * The socket connecting to the server
328
321
  * @public
329
322
  */
330
323
  _socket: net.Socket | false | null;
331
- /**
332
- * Lists supported auth mechanisms
333
- * @private
334
- */
335
- _supportedAuth: string[];
336
324
  /**
337
325
  * Set to true, if EHLO response includes "AUTH".
338
326
  * If false then authentication is not tried
339
327
  */
340
328
  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
329
  /**
426
330
  * True while the STARTTLS upgrade is in progress
427
331
  * @private
428
332
  */
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;
333
+ upgrading?: boolean | undefined;
445
334
  constructor(options?: SMTPConnectionOptions);
446
335
  /**
447
336
  * Creates a connection to a SMTP server and sets up connection
448
337
  * listener
449
338
  */
450
339
  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
340
  /**
478
341
  * Sends QUIT
479
342
  */
@@ -500,207 +363,6 @@ declare class SMTPConnection extends EventEmitter {
500
363
  * @param callback Callback to return once connection is reset
501
364
  */
502
365
  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
366
  }
705
367
  /**
706
368
  * Type aliases in the layout of @types/nodemailer, so `SMTPConnection.Options` style references keep working