@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.
- package/.jsii +2 -2
- package/lib/rootmail.js +1 -1
- package/lib/ses-receive.js +1 -1
- package/node_modules/@aws-sdk/checksums/package.json +2 -2
- package/node_modules/@aws-sdk/client-cloudwatch-logs/dist-cjs/index.js +1 -1
- package/node_modules/@aws-sdk/client-cloudwatch-logs/package.json +3 -3
- package/node_modules/@aws-sdk/client-route-53/dist-cjs/index.js +1 -1
- package/node_modules/@aws-sdk/client-route-53/package.json +3 -3
- package/node_modules/@aws-sdk/client-s3/dist-cjs/index.js +38 -15
- package/node_modules/@aws-sdk/client-s3/dist-es/models/enums.js +7 -0
- package/node_modules/@aws-sdk/client-s3/dist-es/schemas/schemas_0.js +28 -14
- package/node_modules/@aws-sdk/client-s3/dist-types/commands/CopyObjectCommand.d.ts +3 -0
- package/node_modules/@aws-sdk/client-s3/dist-types/commands/CreateMultipartUploadCommand.d.ts +3 -0
- package/node_modules/@aws-sdk/client-s3/dist-types/commands/GetBucketInventoryConfigurationCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-s3/dist-types/commands/GetBucketNotificationConfigurationCommand.d.ts +3 -3
- package/node_modules/@aws-sdk/client-s3/dist-types/commands/GetObjectCommand.d.ts +3 -0
- package/node_modules/@aws-sdk/client-s3/dist-types/commands/GetObjectLockConfigurationCommand.d.ts +4 -0
- package/node_modules/@aws-sdk/client-s3/dist-types/commands/GetObjectRetentionCommand.d.ts +5 -0
- package/node_modules/@aws-sdk/client-s3/dist-types/commands/HeadObjectCommand.d.ts +3 -0
- package/node_modules/@aws-sdk/client-s3/dist-types/commands/ListBucketInventoryConfigurationsCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-s3/dist-types/commands/PutBucketInventoryConfigurationCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-s3/dist-types/commands/PutBucketNotificationConfigurationCommand.d.ts +3 -3
- package/node_modules/@aws-sdk/client-s3/dist-types/commands/PutObjectCommand.d.ts +3 -0
- package/node_modules/@aws-sdk/client-s3/dist-types/commands/PutObjectLockConfigurationCommand.d.ts +4 -0
- package/node_modules/@aws-sdk/client-s3/dist-types/commands/PutObjectRetentionCommand.d.ts +5 -0
- package/node_modules/@aws-sdk/client-s3/dist-types/commands/PutPublicAccessBlockCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-s3/dist-types/models/enums.d.ts +15 -0
- package/node_modules/@aws-sdk/client-s3/dist-types/models/models_0.d.ts +186 -49
- package/node_modules/@aws-sdk/client-s3/dist-types/models/models_1.d.ts +43 -1
- package/node_modules/@aws-sdk/client-s3/dist-types/schemas/schemas_0.d.ts +1 -0
- package/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/PutPublicAccessBlockCommand.d.ts +1 -1
- package/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/models/enums.d.ts +8 -0
- package/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/models/models_0.d.ts +23 -7
- package/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/models/models_1.d.ts +14 -1
- package/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/schemas/schemas_0.d.ts +1 -0
- package/node_modules/@aws-sdk/client-s3/package.json +6 -6
- package/node_modules/@aws-sdk/client-ses/dist-cjs/index.js +1 -1
- package/node_modules/@aws-sdk/client-ses/package.json +3 -3
- package/node_modules/@aws-sdk/client-ssm/dist-cjs/index.js +1 -1
- package/node_modules/@aws-sdk/client-ssm/package.json +3 -3
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/util/index.js +5 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/util/hasOwn.js +3 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/util/index.js +1 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/util/hasOwn.d.ts +4 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/util/index.d.ts +1 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/util/hasOwn.d.ts +1 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/util/index.d.ts +1 -0
- package/node_modules/@aws-sdk/core/package.json +1 -1
- package/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-http/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +9 -9
- package/node_modules/@aws-sdk/credential-provider-login/package.json +3 -3
- package/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
- package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
- package/node_modules/@aws-sdk/middleware-sdk-s3/package.json +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/package.json +2 -2
- package/node_modules/@aws-sdk/token-providers/package.json +3 -3
- package/node_modules/mailparser/.release-please-manifest.json +1 -1
- package/node_modules/mailparser/CHANGELOG.md +28 -0
- package/node_modules/mailparser/package.json +2 -2
- package/node_modules/nodemailer/CHANGELOG.md +74 -0
- package/node_modules/nodemailer/dist/cjs/addressparser/index.d.ts +1 -3
- package/node_modules/nodemailer/dist/cjs/addressparser/index.js +176 -13
- package/node_modules/nodemailer/dist/cjs/base64/index.d.ts +2 -6
- package/node_modules/nodemailer/dist/cjs/base64/index.js +2 -0
- package/node_modules/nodemailer/dist/cjs/dkim/index.d.ts +4 -4
- package/node_modules/nodemailer/dist/cjs/dkim/message-parser.d.ts +1 -3
- package/node_modules/nodemailer/dist/cjs/dkim/message-parser.js +2 -0
- package/node_modules/nodemailer/dist/cjs/dkim/relaxed-body.d.ts +3 -22
- package/node_modules/nodemailer/dist/cjs/dkim/relaxed-body.js +5 -0
- package/node_modules/nodemailer/dist/cjs/dkim/sign.d.ts +5 -5
- package/node_modules/nodemailer/dist/cjs/errors.d.ts +8 -8
- package/node_modules/nodemailer/dist/cjs/fetch/cookies.d.ts +12 -10
- package/node_modules/nodemailer/dist/cjs/fetch/cookies.js +28 -14
- package/node_modules/nodemailer/dist/cjs/fetch/index.d.ts +15 -15
- package/node_modules/nodemailer/dist/cjs/json-transport/index.d.ts +2 -2
- package/node_modules/nodemailer/dist/cjs/mail-composer/index.d.ts +49 -104
- package/node_modules/nodemailer/dist/cjs/mail-composer/index.js +11 -2
- package/node_modules/nodemailer/dist/cjs/mailer/index.d.ts +21 -28
- package/node_modules/nodemailer/dist/cjs/mailer/index.js +19 -5
- package/node_modules/nodemailer/dist/cjs/mailer/mail-message.d.ts +8 -12
- package/node_modules/nodemailer/dist/cjs/mailer/mail-message.js +2 -0
- package/node_modules/nodemailer/dist/cjs/mime-funcs/index.d.ts +1 -1
- package/node_modules/nodemailer/dist/cjs/mime-funcs/index.js +4 -1
- package/node_modules/nodemailer/dist/cjs/mime-node/index.d.ts +37 -191
- package/node_modules/nodemailer/dist/cjs/mime-node/index.js +82 -12
- package/node_modules/nodemailer/dist/cjs/mime-node/last-newline.d.ts +1 -3
- package/node_modules/nodemailer/dist/cjs/mime-node/last-newline.js +2 -0
- package/node_modules/nodemailer/dist/cjs/mime-node/le-unix.d.ts +1 -5
- package/node_modules/nodemailer/dist/cjs/mime-node/le-unix.js +1 -0
- package/node_modules/nodemailer/dist/cjs/mime-node/le-windows.d.ts +1 -5
- package/node_modules/nodemailer/dist/cjs/mime-node/le-windows.js +1 -0
- package/node_modules/nodemailer/dist/cjs/nodemailer.d.ts +2 -2
- package/node_modules/nodemailer/dist/cjs/package-info.d.ts +1 -1
- package/node_modules/nodemailer/dist/cjs/package-info.js +1 -1
- package/node_modules/nodemailer/dist/cjs/qp/index.d.ts +2 -5
- package/node_modules/nodemailer/dist/cjs/qp/index.js +2 -0
- package/node_modules/nodemailer/dist/cjs/sendmail-transport/index.d.ts +4 -6
- package/node_modules/nodemailer/dist/cjs/ses-transport/index.d.ts +2 -2
- package/node_modules/nodemailer/dist/cjs/ses-transport/index.js +5 -1
- package/node_modules/nodemailer/dist/cjs/shared/index.d.ts +31 -37
- package/node_modules/nodemailer/dist/cjs/shared/index.js +19 -7
- package/node_modules/nodemailer/dist/cjs/smtp-connection/data-stream.d.ts +1 -9
- package/node_modules/nodemailer/dist/cjs/smtp-connection/data-stream.js +2 -0
- package/node_modules/nodemailer/dist/cjs/smtp-connection/http-proxy-client.d.ts +1 -1
- package/node_modules/nodemailer/dist/cjs/smtp-connection/index.d.ts +62 -403
- package/node_modules/nodemailer/dist/cjs/smtp-connection/index.js +37 -1
- package/node_modules/nodemailer/dist/cjs/smtp-pool/index.d.ts +8 -46
- package/node_modules/nodemailer/dist/cjs/smtp-pool/index.js +13 -2
- package/node_modules/nodemailer/dist/cjs/smtp-pool/pool-resource.d.ts +2 -4
- package/node_modules/nodemailer/dist/cjs/smtp-transport/index.d.ts +16 -16
- package/node_modules/nodemailer/dist/cjs/stream-transport/index.d.ts +3 -3
- package/node_modules/nodemailer/dist/cjs/well-known/index.d.ts +9 -9
- package/node_modules/nodemailer/dist/cjs/well-known/services.js +2 -0
- package/node_modules/nodemailer/dist/cjs/xoauth2/index.d.ts +18 -18
- package/node_modules/nodemailer/dist/esm/addressparser/index.d.ts +1 -3
- package/node_modules/nodemailer/dist/esm/addressparser/index.js +176 -13
- package/node_modules/nodemailer/dist/esm/base64/index.d.ts +2 -6
- package/node_modules/nodemailer/dist/esm/base64/index.js +2 -0
- package/node_modules/nodemailer/dist/esm/dkim/index.d.ts +4 -4
- package/node_modules/nodemailer/dist/esm/dkim/message-parser.d.ts +1 -3
- package/node_modules/nodemailer/dist/esm/dkim/message-parser.js +2 -0
- package/node_modules/nodemailer/dist/esm/dkim/relaxed-body.d.ts +3 -22
- package/node_modules/nodemailer/dist/esm/dkim/relaxed-body.js +5 -0
- package/node_modules/nodemailer/dist/esm/dkim/sign.d.ts +5 -5
- package/node_modules/nodemailer/dist/esm/errors.d.ts +8 -8
- package/node_modules/nodemailer/dist/esm/fetch/cookies.d.ts +12 -10
- package/node_modules/nodemailer/dist/esm/fetch/cookies.js +25 -14
- package/node_modules/nodemailer/dist/esm/fetch/index.d.ts +15 -15
- package/node_modules/nodemailer/dist/esm/json-transport/index.d.ts +2 -2
- package/node_modules/nodemailer/dist/esm/mail-composer/index.d.ts +49 -104
- package/node_modules/nodemailer/dist/esm/mail-composer/index.js +11 -2
- package/node_modules/nodemailer/dist/esm/mailer/index.d.ts +21 -28
- package/node_modules/nodemailer/dist/esm/mailer/index.js +19 -5
- package/node_modules/nodemailer/dist/esm/mailer/mail-message.d.ts +8 -12
- package/node_modules/nodemailer/dist/esm/mailer/mail-message.js +2 -0
- package/node_modules/nodemailer/dist/esm/mime-funcs/index.d.ts +1 -1
- package/node_modules/nodemailer/dist/esm/mime-funcs/index.js +4 -1
- package/node_modules/nodemailer/dist/esm/mime-node/index.d.ts +37 -191
- package/node_modules/nodemailer/dist/esm/mime-node/index.js +82 -12
- package/node_modules/nodemailer/dist/esm/mime-node/last-newline.d.ts +1 -3
- package/node_modules/nodemailer/dist/esm/mime-node/last-newline.js +2 -0
- package/node_modules/nodemailer/dist/esm/mime-node/le-unix.d.ts +1 -5
- package/node_modules/nodemailer/dist/esm/mime-node/le-unix.js +1 -0
- package/node_modules/nodemailer/dist/esm/mime-node/le-windows.d.ts +1 -5
- package/node_modules/nodemailer/dist/esm/mime-node/le-windows.js +1 -0
- package/node_modules/nodemailer/dist/esm/nodemailer.d.ts +2 -2
- package/node_modules/nodemailer/dist/esm/package-info.d.ts +1 -1
- package/node_modules/nodemailer/dist/esm/package-info.js +1 -1
- package/node_modules/nodemailer/dist/esm/qp/index.d.ts +2 -5
- package/node_modules/nodemailer/dist/esm/qp/index.js +2 -0
- package/node_modules/nodemailer/dist/esm/sendmail-transport/index.d.ts +4 -6
- package/node_modules/nodemailer/dist/esm/ses-transport/index.d.ts +2 -2
- package/node_modules/nodemailer/dist/esm/ses-transport/index.js +5 -1
- package/node_modules/nodemailer/dist/esm/shared/index.d.ts +31 -37
- package/node_modules/nodemailer/dist/esm/shared/index.js +19 -7
- package/node_modules/nodemailer/dist/esm/smtp-connection/data-stream.d.ts +1 -9
- package/node_modules/nodemailer/dist/esm/smtp-connection/data-stream.js +2 -0
- package/node_modules/nodemailer/dist/esm/smtp-connection/http-proxy-client.d.ts +1 -1
- package/node_modules/nodemailer/dist/esm/smtp-connection/index.d.ts +62 -403
- package/node_modules/nodemailer/dist/esm/smtp-connection/index.js +37 -1
- package/node_modules/nodemailer/dist/esm/smtp-pool/index.d.ts +8 -46
- package/node_modules/nodemailer/dist/esm/smtp-pool/index.js +13 -2
- package/node_modules/nodemailer/dist/esm/smtp-pool/pool-resource.d.ts +2 -4
- package/node_modules/nodemailer/dist/esm/smtp-transport/index.d.ts +16 -16
- package/node_modules/nodemailer/dist/esm/stream-transport/index.d.ts +3 -3
- package/node_modules/nodemailer/dist/esm/well-known/index.d.ts +9 -9
- package/node_modules/nodemailer/dist/esm/well-known/services.js +2 -0
- package/node_modules/nodemailer/dist/esm/xoauth2/index.d.ts +18 -18
- package/node_modules/nodemailer/dist/well-known/services.json +2 -2
- package/node_modules/nodemailer/package.json +6 -6
- package/package.json +1 -1
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { type Duplex, type Readable, type TransformOptions, type Writable } from 'node:stream';
|
|
2
|
-
import * as mimeFuncs from '../mime-funcs/index.js';
|
|
3
|
-
import { type Address } from '../addressparser/index.js';
|
|
4
2
|
import type { NodemailerError } from '../errors.js';
|
|
5
3
|
import type { OutgoingHttpHeaders } from 'node:http';
|
|
6
4
|
/**
|
|
@@ -8,38 +6,38 @@ import type { OutgoingHttpHeaders } from 'node:http';
|
|
|
8
6
|
*/
|
|
9
7
|
export interface MimeNodeOptions {
|
|
10
8
|
/** root node for this tree */
|
|
11
|
-
rootNode?: MimeNode;
|
|
9
|
+
rootNode?: MimeNode | undefined;
|
|
12
10
|
/** immediate parent for this node */
|
|
13
|
-
parentNode?: MimeNode;
|
|
11
|
+
parentNode?: MimeNode | undefined;
|
|
14
12
|
/** filename for an attachment node */
|
|
15
|
-
filename?: string;
|
|
13
|
+
filename?: string | undefined;
|
|
16
14
|
/** shared part of the unique multipart boundary */
|
|
17
|
-
baseBoundary?: string;
|
|
15
|
+
baseBoundary?: string | undefined;
|
|
18
16
|
/** prefix for the generated multipart boundaries, defaults to '--_NmP' */
|
|
19
|
-
boundaryPrefix?: string;
|
|
17
|
+
boundaryPrefix?: string | undefined;
|
|
20
18
|
/** If true, do not exclude Bcc from the generated headers */
|
|
21
|
-
keepBcc?: boolean;
|
|
19
|
+
keepBcc?: boolean | undefined;
|
|
22
20
|
/** method to normalize header keys for custom caseing */
|
|
23
|
-
normalizeHeaderKey?: (key: string, value: string) => string;
|
|
21
|
+
normalizeHeaderKey?: ((key: string, value: string) => string) | undefined;
|
|
24
22
|
/** either 'Q' (the default) or 'B' */
|
|
25
|
-
textEncoding?: string;
|
|
23
|
+
textEncoding?: string | undefined;
|
|
26
24
|
/** Hostname for default message-id values */
|
|
27
|
-
hostname?: string;
|
|
25
|
+
hostname?: string | undefined;
|
|
28
26
|
/** If set to 'win' then uses \r\n, if 'linux' then \n. If not set (or `raw` is used) then newlines are kept as is */
|
|
29
|
-
newline?: string;
|
|
27
|
+
newline?: string | undefined;
|
|
30
28
|
/** Reject content that points to a file path, for this node and every node below it */
|
|
31
|
-
disableFileAccess?: boolean;
|
|
29
|
+
disableFileAccess?: boolean | undefined;
|
|
32
30
|
/** Reject content that points to a URL, for this node and every node below it */
|
|
33
|
-
disableUrlAccess?: boolean;
|
|
31
|
+
disableUrlAccess?: boolean | undefined;
|
|
34
32
|
}
|
|
35
33
|
/**
|
|
36
34
|
* An address object as accepted in address headers and produced by getAddresses. Either a
|
|
37
35
|
* mailbox with an address or a group holding a list of addresses
|
|
38
36
|
*/
|
|
39
37
|
export interface MimeNodeAddress {
|
|
40
|
-
name?: string;
|
|
41
|
-
address?: string;
|
|
42
|
-
group?: MimeNodeAddress[];
|
|
38
|
+
name?: string | undefined;
|
|
39
|
+
address?: string | undefined;
|
|
40
|
+
group?: MimeNodeAddress[] | undefined;
|
|
43
41
|
}
|
|
44
42
|
/**
|
|
45
43
|
* Addresses as accepted by address headers and envelope fields: an address string, an
|
|
@@ -52,8 +50,8 @@ export type MimeNodeAddressInput = string | MimeNodeAddress | MimeNodeAddressInp
|
|
|
52
50
|
*/
|
|
53
51
|
export interface MimeNodePreparedHeaderValue {
|
|
54
52
|
value?: unknown;
|
|
55
|
-
prepared?: boolean;
|
|
56
|
-
foldLines?: boolean;
|
|
53
|
+
prepared?: boolean | undefined;
|
|
54
|
+
foldLines?: boolean | undefined;
|
|
57
55
|
}
|
|
58
56
|
/**
|
|
59
57
|
* The values a header can hold: a string, a number, a Date (for the Date header), address
|
|
@@ -84,19 +82,15 @@ export type MimeNodeHeaders = MimeNodeHeader | MimeNodeHeader[] | MimeNodeHeader
|
|
|
84
82
|
*/
|
|
85
83
|
export interface MimeNodeContentObject {
|
|
86
84
|
/** File path to read the content from */
|
|
87
|
-
path?: string;
|
|
85
|
+
path?: string | undefined;
|
|
88
86
|
/** URL to fetch the content from */
|
|
89
|
-
href?: string;
|
|
87
|
+
href?: string | undefined;
|
|
90
88
|
/** Request headers for a URL fetch */
|
|
91
|
-
httpHeaders?: OutgoingHttpHeaders;
|
|
89
|
+
httpHeaders?: OutgoingHttpHeaders | undefined;
|
|
92
90
|
/** TLS settings for a URL fetch, see nmfetch */
|
|
93
91
|
tls?: {
|
|
94
92
|
[key: string]: any;
|
|
95
|
-
};
|
|
96
|
-
/** Read the content once and reuse the buffered value for every stream. MailComposer sets it on the icalEvent content, which is used twice */
|
|
97
|
-
_resolve?: boolean;
|
|
98
|
-
/** The buffered content once _resolve has run */
|
|
99
|
-
_resolvedValue?: Buffer;
|
|
93
|
+
} | undefined;
|
|
100
94
|
}
|
|
101
95
|
/**
|
|
102
96
|
* Body content as accepted by setContent and setRaw: a string, a Buffer, a readable stream
|
|
@@ -117,22 +111,22 @@ export interface MimeNodeEnvelope {
|
|
|
117
111
|
* other field is copied to the envelope as is
|
|
118
112
|
*/
|
|
119
113
|
export interface MimeNodeEnvelopeInput {
|
|
120
|
-
from?: MimeNodeAddressInput;
|
|
121
|
-
to?: MimeNodeAddressInput;
|
|
122
|
-
cc?: MimeNodeAddressInput;
|
|
123
|
-
bcc?: MimeNodeAddressInput;
|
|
114
|
+
from?: MimeNodeAddressInput | undefined;
|
|
115
|
+
to?: MimeNodeAddressInput | undefined;
|
|
116
|
+
cc?: MimeNodeAddressInput | undefined;
|
|
117
|
+
bcc?: MimeNodeAddressInput | undefined;
|
|
124
118
|
[key: string]: unknown;
|
|
125
119
|
}
|
|
126
120
|
/**
|
|
127
121
|
* Parsed address headers as returned by getAddresses, keyed by lowercase header name
|
|
128
122
|
*/
|
|
129
123
|
export interface MimeNodeAddresses {
|
|
130
|
-
from?: MimeNodeAddress[];
|
|
131
|
-
sender?: MimeNodeAddress[];
|
|
132
|
-
'reply-to'?: MimeNodeAddress[];
|
|
133
|
-
to?: MimeNodeAddress[];
|
|
134
|
-
cc?: MimeNodeAddress[];
|
|
135
|
-
bcc?: MimeNodeAddress[];
|
|
124
|
+
from?: MimeNodeAddress[] | undefined;
|
|
125
|
+
sender?: MimeNodeAddress[] | undefined;
|
|
126
|
+
'reply-to'?: MimeNodeAddress[] | undefined;
|
|
127
|
+
to?: MimeNodeAddress[] | undefined;
|
|
128
|
+
cc?: MimeNodeAddress[] | undefined;
|
|
129
|
+
bcc?: MimeNodeAddress[] | undefined;
|
|
136
130
|
}
|
|
137
131
|
/**
|
|
138
132
|
* Options for createReadStream. Handed to the PassThrough the message is written to and to
|
|
@@ -140,7 +134,7 @@ export interface MimeNodeAddresses {
|
|
|
140
134
|
*/
|
|
141
135
|
export interface MimeNodeStreamOptions extends TransformOptions {
|
|
142
136
|
/** Maximum line length for base64 and quoted-printable bodies, false disables wrapping */
|
|
143
|
-
lineLength?: number | false;
|
|
137
|
+
lineLength?: number | false | undefined;
|
|
144
138
|
}
|
|
145
139
|
/**
|
|
146
140
|
* A transform stream the message is piped through, or a function returning one
|
|
@@ -184,25 +178,16 @@ declare class MimeNode {
|
|
|
184
178
|
hostname: string | undefined;
|
|
185
179
|
newline: string | undefined;
|
|
186
180
|
childNodes: MimeNode[];
|
|
187
|
-
_nodeId: number;
|
|
188
|
-
_headers: MimeNodeHeader[];
|
|
189
|
-
_isPlainText: boolean;
|
|
190
|
-
_hasLongLines: boolean;
|
|
191
|
-
_envelope: MimeNodeEnvelope | false;
|
|
192
|
-
_raw: MimeNodeContent | Error | false;
|
|
193
|
-
_transforms: MimeNodeTransform[];
|
|
194
|
-
_processFuncs: MimeNodeProcessFunc[];
|
|
195
181
|
/** Filename for this node. Useful with attachments */
|
|
196
|
-
filename?: string;
|
|
182
|
+
filename?: string | undefined;
|
|
197
183
|
/** Body content, or the error a content stream emitted before it was read */
|
|
198
|
-
content?: MimeNodeContent | Error;
|
|
184
|
+
content?: MimeNodeContent | Error | undefined;
|
|
199
185
|
/** Lowercase content type, set when the headers are built */
|
|
200
|
-
contentType?: string;
|
|
186
|
+
contentType?: string | undefined;
|
|
201
187
|
/** Multipart subtype, false for a non-multipart node, set when the headers are built */
|
|
202
|
-
multipart?: string | false;
|
|
188
|
+
multipart?: string | false | undefined;
|
|
203
189
|
/** Multipart boundary, false for a non-multipart node, set when the headers are built */
|
|
204
|
-
boundary?: string | false;
|
|
205
|
-
_contentErrorHandler?: (err: Error) => void;
|
|
190
|
+
boundary?: string | false | undefined;
|
|
206
191
|
constructor(contentType?: string | false, options?: MimeNodeOptions);
|
|
207
192
|
/**
|
|
208
193
|
* Creates and appends a child node.Arguments provided are passed to MimeNode constructor
|
|
@@ -333,145 +318,6 @@ declare class MimeNode {
|
|
|
333
318
|
* @param raw Raw MIME contents
|
|
334
319
|
*/
|
|
335
320
|
setRaw(raw: MimeNodeContent): this;
|
|
336
|
-
/**
|
|
337
|
-
* Checks an access policy flag for this node and every node above it. The flags are set
|
|
338
|
-
* from the options the node was built with, and createChild only ever sees the options
|
|
339
|
-
* the caller passed, so a child of a closed tree starts out open. Reading the answer off
|
|
340
|
-
* the parent chain keeps it right whatever order the tree was assembled in.
|
|
341
|
-
*
|
|
342
|
-
* @param flag Either 'disableFileAccess' or 'disableUrlAccess'
|
|
343
|
-
* @return true if this node or an ancestor closed that access
|
|
344
|
-
*/
|
|
345
|
-
_accessDisabled(flag: 'disableFileAccess' | 'disableUrlAccess'): boolean;
|
|
346
|
-
/**
|
|
347
|
-
* Detects and returns handle to a stream related with the content.
|
|
348
|
-
*
|
|
349
|
-
* @param content Node content
|
|
350
|
-
* @returns Stream object
|
|
351
|
-
*/
|
|
352
|
-
_getStream(content: any): Readable;
|
|
353
|
-
/**
|
|
354
|
-
* Parses addresses. Takes in a single address or an array or an
|
|
355
|
-
* array of address arrays (eg. To: [[first group], [second group],...])
|
|
356
|
-
*
|
|
357
|
-
* @param addresses Addresses to be parsed
|
|
358
|
-
* @return An array of address objects
|
|
359
|
-
*/
|
|
360
|
-
_parseAddresses(addresses: MimeNodeAddressInput | undefined): MimeNodeAddress[];
|
|
361
|
-
/**
|
|
362
|
-
* Normalizes the addresses of a freshly parsed address list, groups included.
|
|
363
|
-
*
|
|
364
|
-
* Everything this method returns carries a normalized address, whether it arrived as an
|
|
365
|
-
* object or was parsed out of a header value. Without this the two shapes disagree, and
|
|
366
|
-
* a consumer reading the parsed form back is handed the ambiguous
|
|
367
|
-
* 'user@evil.com@good.com' that the header and the envelope no longer carry.
|
|
368
|
-
*
|
|
369
|
-
* @param parsed An array of address objects, as returned by addressparser
|
|
370
|
-
* @return The same array, with every address normalized
|
|
371
|
-
*/
|
|
372
|
-
_normalizeParsedAddresses(parsed: Address[]): Address[];
|
|
373
|
-
/**
|
|
374
|
-
* Parses the addresses of an explicitly set envelope.
|
|
375
|
-
*
|
|
376
|
-
* An envelope value is an addr-spec and never a display name, so a bare local username
|
|
377
|
-
* such as 'root' is the address here. Header parsing has to read the same value as a
|
|
378
|
-
* display name, as a value with no '@' in it can not be an addr-spec in a header.
|
|
379
|
-
*
|
|
380
|
-
* @param addresses Addresses to be parsed
|
|
381
|
-
* @return An array of address objects
|
|
382
|
-
*/
|
|
383
|
-
_parseEnvelopeAddresses(addresses: MimeNodeAddressInput | undefined): MimeNodeAddress[];
|
|
384
|
-
/**
|
|
385
|
-
* Normalizes a header key, uses Camel-Case form, except for uppercase MIME-
|
|
386
|
-
*
|
|
387
|
-
* @param key Key to be normalized
|
|
388
|
-
* @return key in Camel-Case form
|
|
389
|
-
*/
|
|
390
|
-
_normalizeHeaderKey(key: string): string;
|
|
391
|
-
/**
|
|
392
|
-
* Checks if the content type is multipart and defines boundary if needed.
|
|
393
|
-
* Doesn't return anything, modifies object argument instead.
|
|
394
|
-
*
|
|
395
|
-
* @param structured Parsed header value for 'Content-Type' key
|
|
396
|
-
*/
|
|
397
|
-
_handleContentType(structured: mimeFuncs.StructuredHeaderValue): void;
|
|
398
|
-
/**
|
|
399
|
-
* Generates a multipart boundary value
|
|
400
|
-
*
|
|
401
|
-
* @return boundary value
|
|
402
|
-
*/
|
|
403
|
-
_generateBoundary(): string;
|
|
404
|
-
/**
|
|
405
|
-
* Encodes a header value for use in the generated rfc2822 email.
|
|
406
|
-
*
|
|
407
|
-
* @param key Header key
|
|
408
|
-
* @param value Header value
|
|
409
|
-
*/
|
|
410
|
-
_encodeHeaderValue(key: string, value: MimeNodeHeaderValue): string;
|
|
411
|
-
/**
|
|
412
|
-
* Rebuilds address object using punycode and other adjustments
|
|
413
|
-
*
|
|
414
|
-
* @param addresses An array of address objects
|
|
415
|
-
* @param [uniqueList] An array to be populated with addresses
|
|
416
|
-
* @return address string
|
|
417
|
-
*/
|
|
418
|
-
_convertAddresses(addresses: MimeNodeAddress | MimeNodeAddress[] | undefined, uniqueList?: MimeNodeAddress[], seenAddresses?: Set<string>): string;
|
|
419
|
-
/**
|
|
420
|
-
* Normalizes an email address
|
|
421
|
-
*
|
|
422
|
-
* @param address An array of address objects
|
|
423
|
-
* @return address string
|
|
424
|
-
*/
|
|
425
|
-
_normalizeAddress(address?: string | false): string;
|
|
426
|
-
/**
|
|
427
|
-
* Normalizes the local part of an address into a form that can be emitted as is.
|
|
428
|
-
*
|
|
429
|
-
* A local part is either a dot-atom or a quoted-string, anything else is not a valid
|
|
430
|
-
* addr-spec. The quotes of a quoted local part get lost along the way, and a bare
|
|
431
|
-
* 'user@evil.com@good.com' leaves it to the receiver which '@' splits the domain off,
|
|
432
|
-
* while the split here is always at the last one. So whatever is not already one of
|
|
433
|
-
* the two valid forms goes back out as a quoted-string.
|
|
434
|
-
*
|
|
435
|
-
* @param user Local part of an address
|
|
436
|
-
* @return Local part as a dot-atom or as a quoted-string
|
|
437
|
-
*/
|
|
438
|
-
_normalizeLocalPart(user: string): string;
|
|
439
|
-
/**
|
|
440
|
-
* If needed, mime encodes the name part
|
|
441
|
-
*
|
|
442
|
-
* @param name Name part of an address
|
|
443
|
-
* @returns Mime word encoded string if needed
|
|
444
|
-
*/
|
|
445
|
-
_encodeAddressName(name: string): string;
|
|
446
|
-
/**
|
|
447
|
-
* Encodes an unstructured header value. Such a value can only carry VCHAR and WSP, so a
|
|
448
|
-
* control char or DEL has to be forced into the mime encoded word that a non-ascii value
|
|
449
|
-
* would get anyway. HT stays as it is, it is valid folding whitespace here.
|
|
450
|
-
*
|
|
451
|
-
* @param value Header value to encode
|
|
452
|
-
* @returns Mime word encoded string if needed
|
|
453
|
-
*/
|
|
454
|
-
_encodeHeaderText(value: string): string;
|
|
455
|
-
/**
|
|
456
|
-
* If needed, mime encodes the name part
|
|
457
|
-
*
|
|
458
|
-
* @param name Name part of an address
|
|
459
|
-
* @returns Mime word encoded string if needed
|
|
460
|
-
*/
|
|
461
|
-
_encodeWords(value: string): string;
|
|
462
|
-
/**
|
|
463
|
-
* Detects best mime encoding for a text value
|
|
464
|
-
*
|
|
465
|
-
* @param value Value to check for
|
|
466
|
-
* @return either 'Q' or 'B'
|
|
467
|
-
*/
|
|
468
|
-
_getTextEncoding(value?: string | Buffer): string;
|
|
469
|
-
/**
|
|
470
|
-
* Generates a message id
|
|
471
|
-
*
|
|
472
|
-
* @return Random Message-ID value
|
|
473
|
-
*/
|
|
474
|
-
_generateMessageId(): string;
|
|
475
321
|
}
|
|
476
322
|
/**
|
|
477
323
|
* Type aliases in the layout of @types/nodemailer, so `MimeNode.Options` style references keep working
|
|
@@ -61,6 +61,23 @@ function normalizeDomain(domain, toUnicode) {
|
|
|
61
61
|
}
|
|
62
62
|
return toUnicode ? punycode.toUnicode(domain) : punycode.toASCII(domain);
|
|
63
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* Removes the characters that must never reach a multipart delimiter line.
|
|
66
|
+
*
|
|
67
|
+
* A line break splits the delimiter, so the boundary declared in the header can never
|
|
68
|
+
* match it again and the parts go out as body lines instead. The other C0 controls and
|
|
69
|
+
* DEL do not split anything but must not be written either: RFC 5321 does not allow a
|
|
70
|
+
* NUL in DATA at all, and an MTA or a scanner that stops at one reads a different
|
|
71
|
+
* message than a client that does not, which is the same parser disagreement a split
|
|
72
|
+
* delimiter creates. Both sides are cleaned together, since the declared value and the
|
|
73
|
+
* delimiters come from this one result.
|
|
74
|
+
*
|
|
75
|
+
* @param value Value to clean
|
|
76
|
+
* @return Value with every control character removed
|
|
77
|
+
*/
|
|
78
|
+
function _stripBoundaryControls(value) {
|
|
79
|
+
return value.replace(/[\x00-\x1f\x7f]+/g, '');
|
|
80
|
+
}
|
|
64
81
|
/**
|
|
65
82
|
* Creates a new mime tree node. Assumes 'multipart/*' as the content type
|
|
66
83
|
* if it is a branch, anything else counts as leaf. If rootNode is missing from
|
|
@@ -81,10 +98,11 @@ class MimeNode {
|
|
|
81
98
|
this.nodeCounter = 0;
|
|
82
99
|
options = options || {};
|
|
83
100
|
/**
|
|
84
|
-
* shared part of the unique multipart boundary
|
|
101
|
+
* shared part of the unique multipart boundary. Control characters are dropped
|
|
102
|
+
* here rather than at the delimiter, see _stripBoundaryControls
|
|
85
103
|
*/
|
|
86
|
-
this.baseBoundary = options.baseBoundary || crypto.randomBytes(8).toString('hex');
|
|
87
|
-
this.boundaryPrefix = options.boundaryPrefix || '--_NmP';
|
|
104
|
+
this.baseBoundary = _stripBoundaryControls(options.baseBoundary || crypto.randomBytes(8).toString('hex'));
|
|
105
|
+
this.boundaryPrefix = _stripBoundaryControls(options.boundaryPrefix || '--_NmP');
|
|
88
106
|
this.disableFileAccess = !!options.disableFileAccess;
|
|
89
107
|
this.disableUrlAccess = !!options.disableUrlAccess;
|
|
90
108
|
this.normalizeHeaderKey = options.normalizeHeaderKey;
|
|
@@ -916,6 +934,7 @@ class MimeNode {
|
|
|
916
934
|
*
|
|
917
935
|
* @param flag Either 'disableFileAccess' or 'disableUrlAccess'
|
|
918
936
|
* @return true if this node or an ancestor closed that access
|
|
937
|
+
* @internal
|
|
919
938
|
*/
|
|
920
939
|
_accessDisabled(flag) {
|
|
921
940
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
@@ -933,6 +952,7 @@ class MimeNode {
|
|
|
933
952
|
*
|
|
934
953
|
* @param content Node content
|
|
935
954
|
* @returns Stream object
|
|
955
|
+
* @internal
|
|
936
956
|
*/
|
|
937
957
|
_getStream(content) {
|
|
938
958
|
let contentStream;
|
|
@@ -999,19 +1019,41 @@ class MimeNode {
|
|
|
999
1019
|
*
|
|
1000
1020
|
* @param addresses Addresses to be parsed
|
|
1001
1021
|
* @return An array of address objects
|
|
1022
|
+
* @internal
|
|
1002
1023
|
*/
|
|
1003
1024
|
_parseAddresses(addresses) {
|
|
1004
|
-
// Collected into one list as we go. concat.apply spreads the entries into arguments
|
|
1005
|
-
// and throws a RangeError once a recipient array is long enough to pass the
|
|
1006
|
-
// argument limit, which a large Bcc list reaches on its own.
|
|
1007
1025
|
const flattened = [];
|
|
1008
|
-
|
|
1026
|
+
// Nested arrays are flattened iteratively. concat.apply throws once a recipient list
|
|
1027
|
+
// is long enough to pass the argument limit, and an array handed to addressparser is
|
|
1028
|
+
// stringified, which recurses once per nesting level and exhausts the call stack on
|
|
1029
|
+
// a deep enough value. Every array is walked once, which also ends a self-referential
|
|
1030
|
+
// input
|
|
1031
|
+
const seen = new WeakSet();
|
|
1032
|
+
const stack = [];
|
|
1033
|
+
const enter = (list) => {
|
|
1034
|
+
if (!seen.has(list)) {
|
|
1035
|
+
seen.add(list);
|
|
1036
|
+
stack.push({ list, pos: 0 });
|
|
1037
|
+
}
|
|
1038
|
+
};
|
|
1039
|
+
enter(Array.isArray(addresses) ? addresses : [addresses]);
|
|
1040
|
+
while (stack.length) {
|
|
1041
|
+
const frame = stack[stack.length - 1];
|
|
1042
|
+
if (frame.pos >= frame.list.length) {
|
|
1043
|
+
stack.pop();
|
|
1044
|
+
continue;
|
|
1045
|
+
}
|
|
1046
|
+
const address = frame.list[frame.pos++];
|
|
1047
|
+
if (Array.isArray(address)) {
|
|
1048
|
+
enter(address);
|
|
1049
|
+
continue;
|
|
1050
|
+
}
|
|
1009
1051
|
if (address && address.address) {
|
|
1010
1052
|
const normalized = this._normalizeAddress(address.address);
|
|
1011
1053
|
if (normalized === address.address && typeof address.name === 'string') {
|
|
1012
1054
|
// there is nothing to rewrite, so there is nothing to keep off the original
|
|
1013
1055
|
flattened.push(address);
|
|
1014
|
-
|
|
1056
|
+
continue;
|
|
1015
1057
|
}
|
|
1016
1058
|
// rewriting would land on the object the caller passed in and might
|
|
1017
1059
|
// still hold a reference to, so rewrite a copy of it instead. An own
|
|
@@ -1021,13 +1063,13 @@ class MimeNode {
|
|
|
1021
1063
|
copy.address = normalized;
|
|
1022
1064
|
copy.name = address.name || '';
|
|
1023
1065
|
flattened.push(copy);
|
|
1024
|
-
|
|
1066
|
+
continue;
|
|
1025
1067
|
}
|
|
1026
1068
|
const parsed = this._normalizeParsedAddresses(addressparser(address));
|
|
1027
1069
|
for (let i = 0; i < parsed.length; i++) {
|
|
1028
1070
|
flattened.push(parsed[i]);
|
|
1029
1071
|
}
|
|
1030
|
-
}
|
|
1072
|
+
}
|
|
1031
1073
|
return flattened;
|
|
1032
1074
|
}
|
|
1033
1075
|
/**
|
|
@@ -1040,6 +1082,7 @@ class MimeNode {
|
|
|
1040
1082
|
*
|
|
1041
1083
|
* @param parsed An array of address objects, as returned by addressparser
|
|
1042
1084
|
* @return The same array, with every address normalized
|
|
1085
|
+
* @internal
|
|
1043
1086
|
*/
|
|
1044
1087
|
_normalizeParsedAddresses(parsed) {
|
|
1045
1088
|
// addressparser builds these objects, so no caller holds a reference to rewrite around
|
|
@@ -1062,6 +1105,7 @@ class MimeNode {
|
|
|
1062
1105
|
*
|
|
1063
1106
|
* @param addresses Addresses to be parsed
|
|
1064
1107
|
* @return An array of address objects
|
|
1108
|
+
* @internal
|
|
1065
1109
|
*/
|
|
1066
1110
|
_parseEnvelopeAddresses(addresses) {
|
|
1067
1111
|
return this._parseAddresses(addresses).map(entry => {
|
|
@@ -1076,6 +1120,7 @@ class MimeNode {
|
|
|
1076
1120
|
*
|
|
1077
1121
|
* @param key Key to be normalized
|
|
1078
1122
|
* @return key in Camel-Case form
|
|
1123
|
+
* @internal
|
|
1079
1124
|
*/
|
|
1080
1125
|
_normalizeHeaderKey(key) {
|
|
1081
1126
|
key = (key || '')
|
|
@@ -1098,13 +1143,26 @@ class MimeNode {
|
|
|
1098
1143
|
* Doesn't return anything, modifies object argument instead.
|
|
1099
1144
|
*
|
|
1100
1145
|
* @param structured Parsed header value for 'Content-Type' key
|
|
1146
|
+
* @internal
|
|
1101
1147
|
*/
|
|
1102
1148
|
_handleContentType(structured) {
|
|
1103
1149
|
this.contentType = structured.value.trim().toLowerCase();
|
|
1104
1150
|
this.multipart = /^multipart\//i.test(this.contentType) ? this.contentType.substr(this.contentType.indexOf('/') + 1) : false;
|
|
1105
1151
|
if (this.multipart) {
|
|
1152
|
+
// The declared value and the delimiters are assigned from the same expression
|
|
1153
|
+
// here, so whatever the header emitter then does with it, the two sides cannot
|
|
1154
|
+
// disagree about which characters the boundary is made of.
|
|
1155
|
+
//
|
|
1156
|
+
// Stripping runs before the fallback rather than over the whole chain: a
|
|
1157
|
+
// boundary made only of control characters would otherwise strip to '' and
|
|
1158
|
+
// leave the node declaring no boundary and streaming bare '--' delimiters.
|
|
1159
|
+
// _generateBoundary cleans what it builds, but this is the one place the boundary
|
|
1160
|
+
// is written, so it cleans the value it is about to write rather than trusting
|
|
1161
|
+
// where it came from. MimeNode is exported and subclassable, so the generator is
|
|
1162
|
+
// not necessarily the one below. Stripping twice costs nothing, it is idempotent.
|
|
1163
|
+
const declared = _stripBoundaryControls(structured.params.boundary || this.boundary || '');
|
|
1106
1164
|
this.boundary = structured.params.boundary =
|
|
1107
|
-
|
|
1165
|
+
declared || _stripBoundaryControls(this._generateBoundary());
|
|
1108
1166
|
}
|
|
1109
1167
|
else {
|
|
1110
1168
|
this.boundary = false;
|
|
@@ -1114,15 +1172,19 @@ class MimeNode {
|
|
|
1114
1172
|
* Generates a multipart boundary value
|
|
1115
1173
|
*
|
|
1116
1174
|
* @return boundary value
|
|
1175
|
+
* @internal
|
|
1117
1176
|
*/
|
|
1118
1177
|
_generateBoundary() {
|
|
1119
|
-
|
|
1178
|
+
// baseBoundary and boundaryPrefix are public, so they may hold something the
|
|
1179
|
+
// constructor never cleaned, and the -Part_ suffix keeps the result non empty
|
|
1180
|
+
return _stripBoundaryControls(this.rootNode.boundaryPrefix + '-' + this.rootNode.baseBoundary) + '-Part_' + this._nodeId;
|
|
1120
1181
|
}
|
|
1121
1182
|
/**
|
|
1122
1183
|
* Encodes a header value for use in the generated rfc2822 email.
|
|
1123
1184
|
*
|
|
1124
1185
|
* @param key Header key
|
|
1125
1186
|
* @param value Header value
|
|
1187
|
+
* @internal
|
|
1126
1188
|
*/
|
|
1127
1189
|
_encodeHeaderValue(key, value) {
|
|
1128
1190
|
key = this._normalizeHeaderKey(key);
|
|
@@ -1195,6 +1257,7 @@ class MimeNode {
|
|
|
1195
1257
|
* @param addresses An array of address objects
|
|
1196
1258
|
* @param [uniqueList] An array to be populated with addresses
|
|
1197
1259
|
* @return address string
|
|
1260
|
+
* @internal
|
|
1198
1261
|
*/
|
|
1199
1262
|
_convertAddresses(addresses, uniqueList, seenAddresses) {
|
|
1200
1263
|
const values = [];
|
|
@@ -1239,6 +1302,7 @@ class MimeNode {
|
|
|
1239
1302
|
*
|
|
1240
1303
|
* @param address An array of address objects
|
|
1241
1304
|
* @return address string
|
|
1305
|
+
* @internal
|
|
1242
1306
|
*/
|
|
1243
1307
|
_normalizeAddress(address) {
|
|
1244
1308
|
address = (address || '')
|
|
@@ -1285,6 +1349,7 @@ class MimeNode {
|
|
|
1285
1349
|
*
|
|
1286
1350
|
* @param user Local part of an address
|
|
1287
1351
|
* @return Local part as a dot-atom or as a quoted-string
|
|
1352
|
+
* @internal
|
|
1288
1353
|
*/
|
|
1289
1354
|
_normalizeLocalPart(user) {
|
|
1290
1355
|
if (DOT_ATOM.test(user) || QUOTED_STRING.test(user)) {
|
|
@@ -1297,6 +1362,7 @@ class MimeNode {
|
|
|
1297
1362
|
*
|
|
1298
1363
|
* @param name Name part of an address
|
|
1299
1364
|
* @returns Mime word encoded string if needed
|
|
1365
|
+
* @internal
|
|
1300
1366
|
*/
|
|
1301
1367
|
_encodeAddressName(name) {
|
|
1302
1368
|
if (!/^[\w ]*$/.test(name)) {
|
|
@@ -1316,6 +1382,7 @@ class MimeNode {
|
|
|
1316
1382
|
*
|
|
1317
1383
|
* @param value Header value to encode
|
|
1318
1384
|
* @returns Mime word encoded string if needed
|
|
1385
|
+
* @internal
|
|
1319
1386
|
*/
|
|
1320
1387
|
_encodeHeaderText(value) {
|
|
1321
1388
|
return /[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/.test(value)
|
|
@@ -1328,6 +1395,7 @@ class MimeNode {
|
|
|
1328
1395
|
*
|
|
1329
1396
|
* @param name Name part of an address
|
|
1330
1397
|
* @returns Mime word encoded string if needed
|
|
1398
|
+
* @internal
|
|
1331
1399
|
*/
|
|
1332
1400
|
_encodeWords(value) {
|
|
1333
1401
|
// set encodeAll parameter to true even though it is against the recommendation of RFC2047,
|
|
@@ -1340,6 +1408,7 @@ class MimeNode {
|
|
|
1340
1408
|
*
|
|
1341
1409
|
* @param value Value to check for
|
|
1342
1410
|
* @return either 'Q' or 'B'
|
|
1411
|
+
* @internal
|
|
1343
1412
|
*/
|
|
1344
1413
|
_getTextEncoding(value) {
|
|
1345
1414
|
value = (value || '').toString();
|
|
@@ -1367,6 +1436,7 @@ class MimeNode {
|
|
|
1367
1436
|
* Generates a message id
|
|
1368
1437
|
*
|
|
1369
1438
|
* @return Random Message-ID value
|
|
1439
|
+
* @internal
|
|
1370
1440
|
*/
|
|
1371
1441
|
_generateMessageId() {
|
|
1372
1442
|
return ('<' +
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { Transform
|
|
1
|
+
import { Transform } from 'node:stream';
|
|
2
2
|
export default class LastNewline extends Transform {
|
|
3
3
|
lastByte: number | false;
|
|
4
4
|
constructor();
|
|
5
|
-
_transform(chunk: Buffer, encoding: BufferEncoding, done: TransformCallback): void;
|
|
6
|
-
_flush(done: TransformCallback): void;
|
|
7
5
|
}
|
|
@@ -4,6 +4,7 @@ export default class LastNewline extends Transform {
|
|
|
4
4
|
super();
|
|
5
5
|
this.lastByte = false;
|
|
6
6
|
}
|
|
7
|
+
/** @internal */
|
|
7
8
|
_transform(chunk, encoding, done) {
|
|
8
9
|
if (chunk.length) {
|
|
9
10
|
this.lastByte = chunk[chunk.length - 1];
|
|
@@ -11,6 +12,7 @@ export default class LastNewline extends Transform {
|
|
|
11
12
|
this.push(chunk);
|
|
12
13
|
done();
|
|
13
14
|
}
|
|
15
|
+
/** @internal */
|
|
14
16
|
_flush(done) {
|
|
15
17
|
if (this.lastByte === 0x0a) {
|
|
16
18
|
return done();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Transform, type
|
|
1
|
+
import { Transform, type TransformOptions } from 'node:stream';
|
|
2
2
|
/**
|
|
3
3
|
* Ensures that only <LF> is used for linebreaks
|
|
4
4
|
*
|
|
@@ -6,8 +6,4 @@ import { Transform, type TransformCallback, type TransformOptions } from 'node:s
|
|
|
6
6
|
*/
|
|
7
7
|
export default class LeUnix extends Transform {
|
|
8
8
|
constructor(options?: TransformOptions);
|
|
9
|
-
/**
|
|
10
|
-
* Escapes dots
|
|
11
|
-
*/
|
|
12
|
-
_transform(chunk: Buffer, encoding: BufferEncoding, done: TransformCallback): void;
|
|
13
9
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Transform, type
|
|
1
|
+
import { Transform, type TransformOptions } from 'node:stream';
|
|
2
2
|
/**
|
|
3
3
|
* Ensures that only <CR><LF> sequences are used for linebreaks
|
|
4
4
|
*
|
|
@@ -7,8 +7,4 @@ import { Transform, type TransformCallback, type TransformOptions } from 'node:s
|
|
|
7
7
|
export default class LeWindows extends Transform {
|
|
8
8
|
lastByte: number | false;
|
|
9
9
|
constructor(options?: TransformOptions);
|
|
10
|
-
/**
|
|
11
|
-
* Escapes dots
|
|
12
|
-
*/
|
|
13
|
-
_transform(chunk: Buffer, encoding: BufferEncoding, done: TransformCallback): void;
|
|
14
10
|
}
|
|
@@ -25,7 +25,7 @@ export interface TestAccount {
|
|
|
25
25
|
pop3: TestAccountService;
|
|
26
26
|
web: string;
|
|
27
27
|
/** true if the account can also receive external mail */
|
|
28
|
-
mxEnabled?: boolean;
|
|
28
|
+
mxEnabled?: boolean | undefined;
|
|
29
29
|
[key: string]: unknown;
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
@@ -77,7 +77,7 @@ export declare function createTestAccount(apiUrl?: string | false | null): Promi
|
|
|
77
77
|
* @returns URL of the message in the Ethereal web interface, or false if the response does not carry one
|
|
78
78
|
*/
|
|
79
79
|
export declare function getTestMessageUrl(info?: {
|
|
80
|
-
response?: string | Buffer | null;
|
|
80
|
+
response?: string | Buffer | null | undefined;
|
|
81
81
|
} | false | null): string | false;
|
|
82
82
|
declare const nodemailer: {
|
|
83
83
|
createTransport: typeof createTransport;
|