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