@nocobase/plugin-workflow-mailer 2.3.0-beta.12 → 2.3.0-beta.14
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/dist/externalVersion.js +6 -6
- package/dist/node_modules/joi/dist/joi-browser.min.js +1 -1
- package/dist/node_modules/joi/lib/index.js +1 -1
- package/dist/node_modules/joi/lib/messages.js +35 -6
- package/dist/node_modules/joi/lib/types/keys.js +18 -1
- package/dist/node_modules/joi/lib/types/link.js +18 -2
- package/dist/node_modules/joi/lib/types/string.js +2 -2
- package/dist/node_modules/joi/package.json +1 -1
- package/dist/node_modules/nodemailer/dist/cjs/addressparser/index.d.ts +59 -0
- package/dist/node_modules/nodemailer/dist/cjs/addressparser/index.js +790 -0
- package/dist/node_modules/nodemailer/dist/cjs/base64/index.d.ts +36 -0
- package/dist/node_modules/nodemailer/dist/cjs/base64/index.js +119 -0
- package/dist/node_modules/nodemailer/dist/cjs/dkim/index.d.ts +52 -0
- package/dist/node_modules/nodemailer/dist/cjs/dkim/index.js +228 -0
- package/dist/node_modules/nodemailer/dist/cjs/dkim/message-parser.d.ts +48 -0
- package/dist/node_modules/nodemailer/dist/cjs/dkim/message-parser.js +180 -0
- package/dist/node_modules/nodemailer/dist/cjs/dkim/relaxed-body.d.ts +36 -0
- package/dist/node_modules/nodemailer/dist/cjs/dkim/relaxed-body.js +148 -0
- package/dist/node_modules/nodemailer/dist/cjs/dkim/sign.d.ts +52 -0
- package/dist/node_modules/nodemailer/dist/cjs/dkim/sign.js +165 -0
- package/dist/node_modules/nodemailer/dist/cjs/errors.d.ts +96 -0
- package/dist/node_modules/nodemailer/dist/cjs/errors.js +70 -0
- package/dist/node_modules/nodemailer/dist/cjs/fetch/cookies.d.ts +107 -0
- package/dist/node_modules/nodemailer/dist/cjs/fetch/cookies.js +282 -0
- package/dist/node_modules/nodemailer/dist/cjs/fetch/index.d.ts +65 -0
- package/dist/node_modules/nodemailer/dist/cjs/fetch/index.js +384 -0
- package/dist/node_modules/nodemailer/dist/cjs/json-transport/index.d.ts +64 -0
- package/dist/node_modules/nodemailer/dist/cjs/json-transport/index.js +99 -0
- package/dist/node_modules/nodemailer/dist/cjs/mail-composer/index.d.ts +174 -0
- package/dist/node_modules/nodemailer/dist/cjs/mail-composer/index.js +613 -0
- package/dist/node_modules/nodemailer/dist/cjs/mailer/index.d.ts +237 -0
- package/dist/node_modules/nodemailer/dist/cjs/mailer/index.js +415 -0
- package/dist/node_modules/nodemailer/dist/cjs/mailer/mail-message.d.ts +97 -0
- package/dist/node_modules/nodemailer/dist/cjs/mailer/mail-message.js +342 -0
- package/dist/node_modules/nodemailer/dist/cjs/mime-funcs/index.d.ts +161 -0
- package/dist/node_modules/nodemailer/dist/cjs/mime-funcs/index.js +787 -0
- package/dist/node_modules/nodemailer/dist/cjs/mime-funcs/mime-types.d.ts +2 -0
- package/dist/node_modules/nodemailer/dist/cjs/mime-funcs/mime-types.js +2103 -0
- package/dist/node_modules/nodemailer/dist/cjs/mime-node/index.d.ts +333 -0
- package/dist/node_modules/nodemailer/dist/cjs/mime-node/index.js +1493 -0
- package/dist/node_modules/nodemailer/dist/cjs/mime-node/last-newline.d.ts +5 -0
- package/dist/node_modules/nodemailer/dist/cjs/mime-node/last-newline.js +32 -0
- package/dist/node_modules/nodemailer/dist/cjs/mime-node/le-unix.d.ts +9 -0
- package/dist/node_modules/nodemailer/dist/cjs/mime-node/le-unix.js +40 -0
- package/dist/node_modules/nodemailer/dist/cjs/mime-node/le-windows.d.ts +10 -0
- package/dist/node_modules/nodemailer/dist/cjs/mime-node/le-windows.js +47 -0
- package/dist/node_modules/nodemailer/dist/cjs/nodemailer.d.ts +124 -0
- package/dist/node_modules/nodemailer/dist/cjs/nodemailer.js +1 -0
- package/dist/node_modules/nodemailer/dist/cjs/package-info.d.ts +3 -0
- package/dist/node_modules/nodemailer/dist/cjs/package-info.js +7 -0
- package/dist/node_modules/nodemailer/dist/cjs/package.json +3 -0
- package/dist/node_modules/nodemailer/dist/cjs/punycode/index.d.ts +73 -0
- package/dist/node_modules/nodemailer/{lib → dist/cjs}/punycode/index.js +63 -112
- package/dist/node_modules/nodemailer/dist/cjs/qp/index.d.ts +32 -0
- package/dist/node_modules/nodemailer/dist/cjs/qp/index.js +207 -0
- package/dist/node_modules/nodemailer/dist/cjs/sendmail-transport/index.d.ts +69 -0
- package/dist/node_modules/nodemailer/dist/cjs/sendmail-transport/index.js +210 -0
- package/dist/node_modules/nodemailer/dist/cjs/ses-transport/index.d.ts +112 -0
- package/dist/node_modules/nodemailer/dist/cjs/ses-transport/index.js +252 -0
- package/dist/node_modules/nodemailer/dist/cjs/shared/index.d.ts +260 -0
- package/dist/node_modules/nodemailer/dist/cjs/shared/index.js +680 -0
- package/dist/node_modules/nodemailer/dist/cjs/shared/objects.d.ts +23 -0
- package/dist/node_modules/nodemailer/dist/cjs/shared/objects.js +43 -0
- package/dist/node_modules/nodemailer/dist/cjs/shared/url.d.ts +21 -0
- package/dist/node_modules/nodemailer/dist/cjs/shared/url.js +255 -0
- package/dist/node_modules/nodemailer/dist/cjs/smtp-connection/data-stream.d.ts +15 -0
- package/dist/node_modules/nodemailer/dist/cjs/smtp-connection/data-stream.js +108 -0
- package/dist/node_modules/nodemailer/dist/cjs/smtp-connection/http-proxy-client.d.ts +47 -0
- package/dist/node_modules/nodemailer/dist/cjs/smtp-connection/http-proxy-client.js +189 -0
- package/dist/node_modules/nodemailer/dist/cjs/smtp-connection/index.d.ts +416 -0
- package/dist/node_modules/nodemailer/dist/cjs/smtp-connection/index.js +1837 -0
- package/dist/node_modules/nodemailer/dist/cjs/smtp-pool/index.d.ts +133 -0
- package/dist/node_modules/nodemailer/dist/cjs/smtp-pool/index.js +569 -0
- package/dist/node_modules/nodemailer/dist/cjs/smtp-pool/pool-resource.d.ts +62 -0
- package/dist/node_modules/nodemailer/dist/cjs/smtp-pool/pool-resource.js +257 -0
- package/dist/node_modules/nodemailer/dist/cjs/smtp-transport/index.d.ts +156 -0
- package/dist/node_modules/nodemailer/dist/cjs/smtp-transport/index.js +371 -0
- package/dist/node_modules/nodemailer/dist/cjs/stream-transport/index.d.ts +65 -0
- package/dist/node_modules/nodemailer/dist/cjs/stream-transport/index.js +146 -0
- package/dist/node_modules/nodemailer/dist/cjs/well-known/index.d.ts +35 -0
- package/dist/node_modules/nodemailer/dist/cjs/well-known/index.js +41 -0
- package/dist/node_modules/nodemailer/dist/cjs/well-known/services.d.ts +2 -0
- package/dist/node_modules/nodemailer/dist/cjs/well-known/services.js +674 -0
- package/dist/node_modules/nodemailer/dist/cjs/xoauth2/index.d.ts +201 -0
- package/dist/node_modules/nodemailer/dist/cjs/xoauth2/index.js +426 -0
- package/dist/node_modules/nodemailer/dist/esm/addressparser/index.d.ts +59 -0
- package/dist/node_modules/nodemailer/dist/esm/addressparser/index.js +786 -0
- package/dist/node_modules/nodemailer/dist/esm/base64/index.d.ts +36 -0
- package/dist/node_modules/nodemailer/{lib → dist/esm}/base64/index.js +39 -68
- package/dist/node_modules/nodemailer/dist/esm/dkim/index.d.ts +52 -0
- package/dist/node_modules/nodemailer/{lib → dist/esm}/dkim/index.js +62 -92
- package/dist/node_modules/nodemailer/dist/esm/dkim/message-parser.d.ts +48 -0
- package/dist/node_modules/nodemailer/dist/esm/dkim/message-parser.js +176 -0
- package/dist/node_modules/nodemailer/dist/esm/dkim/relaxed-body.d.ts +36 -0
- package/dist/node_modules/nodemailer/dist/esm/dkim/relaxed-body.js +141 -0
- package/dist/node_modules/nodemailer/dist/esm/dkim/sign.d.ts +52 -0
- package/dist/node_modules/nodemailer/dist/esm/dkim/sign.js +125 -0
- package/dist/node_modules/nodemailer/dist/esm/errors.d.ts +96 -0
- package/dist/node_modules/nodemailer/dist/esm/errors.js +67 -0
- package/dist/node_modules/nodemailer/dist/esm/fetch/cookies.d.ts +107 -0
- package/dist/node_modules/nodemailer/dist/esm/fetch/cookies.js +242 -0
- package/dist/node_modules/nodemailer/dist/esm/fetch/index.d.ts +65 -0
- package/dist/node_modules/nodemailer/dist/esm/fetch/index.js +344 -0
- package/dist/node_modules/nodemailer/dist/esm/json-transport/index.d.ts +64 -0
- package/dist/node_modules/nodemailer/dist/esm/json-transport/index.js +62 -0
- package/dist/node_modules/nodemailer/dist/esm/mail-composer/index.d.ts +174 -0
- package/dist/node_modules/nodemailer/{lib → dist/esm}/mail-composer/index.js +283 -275
- package/dist/node_modules/nodemailer/dist/esm/mailer/index.d.ts +237 -0
- package/dist/node_modules/nodemailer/{lib → dist/esm}/mailer/index.js +151 -205
- package/dist/node_modules/nodemailer/dist/esm/mailer/mail-message.d.ts +97 -0
- package/dist/node_modules/nodemailer/{lib → dist/esm}/mailer/mail-message.js +111 -125
- package/dist/node_modules/nodemailer/dist/esm/mime-funcs/index.d.ts +161 -0
- package/dist/node_modules/nodemailer/dist/esm/mime-funcs/index.js +738 -0
- package/dist/node_modules/nodemailer/dist/esm/mime-funcs/mime-types.d.ts +2 -0
- package/dist/node_modules/nodemailer/{lib → dist/esm}/mime-funcs/mime-types.js +43 -49
- package/dist/node_modules/nodemailer/dist/esm/mime-node/index.d.ts +333 -0
- package/dist/node_modules/nodemailer/{lib → dist/esm}/mime-node/index.js +576 -437
- package/dist/node_modules/nodemailer/dist/esm/mime-node/last-newline.d.ts +5 -0
- package/dist/node_modules/nodemailer/{lib → dist/esm}/mime-node/last-newline.js +4 -10
- package/dist/node_modules/nodemailer/dist/esm/mime-node/le-unix.d.ts +9 -0
- package/dist/node_modules/nodemailer/{lib → dist/esm}/mime-node/le-unix.js +7 -15
- package/dist/node_modules/nodemailer/dist/esm/mime-node/le-windows.d.ts +10 -0
- package/dist/node_modules/nodemailer/{lib → dist/esm}/mime-node/le-windows.js +6 -16
- package/dist/node_modules/nodemailer/dist/esm/nodemailer.d.ts +124 -0
- package/dist/node_modules/nodemailer/dist/esm/nodemailer.js +166 -0
- package/dist/node_modules/nodemailer/dist/esm/package-info.d.ts +3 -0
- package/dist/node_modules/nodemailer/dist/esm/package-info.js +4 -0
- package/dist/node_modules/nodemailer/dist/esm/package.json +3 -0
- package/dist/node_modules/nodemailer/dist/esm/punycode/index.d.ts +73 -0
- package/dist/node_modules/nodemailer/dist/esm/punycode/index.js +405 -0
- package/dist/node_modules/nodemailer/dist/esm/qp/index.d.ts +32 -0
- package/dist/node_modules/nodemailer/{lib → dist/esm}/qp/index.js +59 -77
- package/dist/node_modules/nodemailer/dist/esm/sendmail-transport/index.d.ts +69 -0
- package/dist/node_modules/nodemailer/dist/esm/sendmail-transport/index.js +170 -0
- package/dist/node_modules/nodemailer/dist/esm/ses-transport/index.d.ts +112 -0
- package/dist/node_modules/nodemailer/dist/esm/ses-transport/index.js +212 -0
- package/dist/node_modules/nodemailer/dist/esm/shared/index.d.ts +260 -0
- package/dist/node_modules/nodemailer/dist/esm/shared/index.js +631 -0
- package/dist/node_modules/nodemailer/dist/esm/shared/objects.d.ts +23 -0
- package/dist/node_modules/nodemailer/dist/esm/shared/objects.js +38 -0
- package/dist/node_modules/nodemailer/dist/esm/shared/url.d.ts +21 -0
- package/dist/node_modules/nodemailer/dist/esm/shared/url.js +214 -0
- package/dist/node_modules/nodemailer/dist/esm/smtp-connection/data-stream.d.ts +15 -0
- package/dist/node_modules/nodemailer/dist/esm/smtp-connection/data-stream.js +103 -0
- package/dist/node_modules/nodemailer/dist/esm/smtp-connection/http-proxy-client.d.ts +47 -0
- package/dist/node_modules/nodemailer/dist/esm/smtp-connection/http-proxy-client.js +149 -0
- package/dist/node_modules/nodemailer/dist/esm/smtp-connection/index.d.ts +416 -0
- package/dist/node_modules/nodemailer/dist/esm/smtp-connection/index.js +1797 -0
- package/dist/node_modules/nodemailer/dist/esm/smtp-pool/index.d.ts +133 -0
- package/dist/node_modules/nodemailer/{lib → dist/esm}/smtp-pool/index.js +195 -314
- package/dist/node_modules/nodemailer/dist/esm/smtp-pool/pool-resource.d.ts +62 -0
- package/dist/node_modules/nodemailer/{lib → dist/esm}/smtp-pool/pool-resource.js +70 -107
- package/dist/node_modules/nodemailer/dist/esm/smtp-transport/index.d.ts +156 -0
- package/dist/node_modules/nodemailer/dist/esm/smtp-transport/index.js +331 -0
- package/dist/node_modules/nodemailer/dist/esm/stream-transport/index.d.ts +65 -0
- package/dist/node_modules/nodemailer/dist/esm/stream-transport/index.js +106 -0
- package/dist/node_modules/nodemailer/dist/esm/well-known/index.d.ts +35 -0
- package/dist/node_modules/nodemailer/{lib → dist/esm}/well-known/index.js +12 -23
- package/dist/node_modules/nodemailer/dist/esm/well-known/services.d.ts +2 -0
- package/dist/node_modules/nodemailer/dist/esm/well-known/services.js +671 -0
- package/dist/node_modules/nodemailer/dist/esm/xoauth2/index.d.ts +201 -0
- package/dist/node_modules/nodemailer/dist/esm/xoauth2/index.js +386 -0
- package/dist/node_modules/nodemailer/dist/well-known/services.json +640 -0
- package/dist/node_modules/nodemailer/package.json +1 -1
- package/package.json +4 -4
- package/dist/node_modules/nodemailer/.gitattributes +0 -6
- package/dist/node_modules/nodemailer/.ncurc.js +0 -7
- package/dist/node_modules/nodemailer/.prettierrc.js +0 -8
- package/dist/node_modules/nodemailer/lib/addressparser/index.js +0 -313
- package/dist/node_modules/nodemailer/lib/dkim/message-parser.js +0 -155
- package/dist/node_modules/nodemailer/lib/dkim/relaxed-body.js +0 -154
- package/dist/node_modules/nodemailer/lib/dkim/sign.js +0 -117
- package/dist/node_modules/nodemailer/lib/fetch/cookies.js +0 -281
- package/dist/node_modules/nodemailer/lib/fetch/index.js +0 -274
- package/dist/node_modules/nodemailer/lib/json-transport/index.js +0 -82
- package/dist/node_modules/nodemailer/lib/mime-funcs/index.js +0 -625
- package/dist/node_modules/nodemailer/lib/nodemailer.js +0 -1
- package/dist/node_modules/nodemailer/lib/sendmail-transport/index.js +0 -210
- package/dist/node_modules/nodemailer/lib/ses-transport/index.js +0 -349
- package/dist/node_modules/nodemailer/lib/shared/index.js +0 -688
- package/dist/node_modules/nodemailer/lib/smtp-connection/data-stream.js +0 -108
- package/dist/node_modules/nodemailer/lib/smtp-connection/http-proxy-client.js +0 -143
- package/dist/node_modules/nodemailer/lib/smtp-connection/index.js +0 -1825
- package/dist/node_modules/nodemailer/lib/smtp-transport/index.js +0 -416
- package/dist/node_modules/nodemailer/lib/stream-transport/index.js +0 -135
- package/dist/node_modules/nodemailer/lib/well-known/services.json +0 -343
- package/dist/node_modules/nodemailer/lib/xoauth2/index.js +0 -376
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Encoder = void 0;
|
|
4
|
+
exports.encode = encode;
|
|
5
|
+
exports.wrap = wrap;
|
|
6
|
+
const node_stream_1 = require("node:stream");
|
|
7
|
+
/**
|
|
8
|
+
* Encodes a Buffer into a Quoted-Printable encoded string
|
|
9
|
+
*
|
|
10
|
+
* @param buffer Buffer to convert
|
|
11
|
+
* @returns Quoted-Printable encoded string
|
|
12
|
+
*/
|
|
13
|
+
// the shortest line wrap() can make progress with: a complete =XX sequence and the soft break
|
|
14
|
+
const MIN_LINE_LENGTH = 4;
|
|
15
|
+
// usable characters that do not need encoding
|
|
16
|
+
// https://tools.ietf.org/html/rfc2045#section-6.7
|
|
17
|
+
const QP_RANGES = [
|
|
18
|
+
[0x09], // <TAB>
|
|
19
|
+
[0x0a], // <LF>
|
|
20
|
+
[0x0d], // <CR>
|
|
21
|
+
[0x20, 0x3c], // <SP>!"#$%&'()*+,-./0123456789:;
|
|
22
|
+
[0x3e, 0x7e] // >?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}
|
|
23
|
+
];
|
|
24
|
+
function encode(buffer) {
|
|
25
|
+
if (typeof buffer === 'string') {
|
|
26
|
+
buffer = Buffer.from(buffer, 'utf-8');
|
|
27
|
+
}
|
|
28
|
+
let result = '';
|
|
29
|
+
let ord;
|
|
30
|
+
for (let i = 0, len = buffer.length; i < len; i++) {
|
|
31
|
+
ord = buffer[i];
|
|
32
|
+
// if the char is in allowed range, then keep as is, unless it is a WS in the end of a line
|
|
33
|
+
if (checkRanges(ord, QP_RANGES) &&
|
|
34
|
+
!((ord === 0x20 || ord === 0x09) && (i === len - 1 || buffer[i + 1] === 0x0a || buffer[i + 1] === 0x0d))) {
|
|
35
|
+
result += String.fromCharCode(ord);
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
result += '=' + (ord < 0x10 ? '0' : '') + ord.toString(16).toUpperCase();
|
|
39
|
+
}
|
|
40
|
+
return result;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Adds soft line breaks to a Quoted-Printable string
|
|
44
|
+
*
|
|
45
|
+
* @param str Quoted-Printable encoded string that might need line wrapping
|
|
46
|
+
* @param [lineLength=76] Maximum allowed length for a line
|
|
47
|
+
* @returns Soft-wrapped Quoted-Printable encoded string
|
|
48
|
+
*/
|
|
49
|
+
function wrap(str, lineLength) {
|
|
50
|
+
str = (str || '').toString();
|
|
51
|
+
// a line has to hold a complete =XX sequence plus the soft break, shorter lengths
|
|
52
|
+
// (or a negative one) would loop without consuming input
|
|
53
|
+
lineLength = Math.max(Number(lineLength) || 76, MIN_LINE_LENGTH);
|
|
54
|
+
if (str.length <= lineLength) {
|
|
55
|
+
return str;
|
|
56
|
+
}
|
|
57
|
+
let pos = 0;
|
|
58
|
+
const len = str.length;
|
|
59
|
+
let match, code, line;
|
|
60
|
+
const lineMargin = Math.floor(lineLength / 3);
|
|
61
|
+
let result = '';
|
|
62
|
+
// insert soft linebreaks where needed
|
|
63
|
+
while (pos < len) {
|
|
64
|
+
line = str.substr(pos, lineLength);
|
|
65
|
+
if ((match = line.match(/\r\n/))) {
|
|
66
|
+
line = line.substr(0, match.index + match[0].length);
|
|
67
|
+
result += line;
|
|
68
|
+
pos += line.length;
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
if (line.substr(-1) === '\n') {
|
|
72
|
+
result += line;
|
|
73
|
+
pos += line.length;
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
if ((match = line.substr(-lineMargin).match(/\n.*?$/))) {
|
|
77
|
+
// truncate to nearest line break
|
|
78
|
+
line = line.substr(0, line.length - (match[0].length - 1));
|
|
79
|
+
result += line;
|
|
80
|
+
pos += line.length;
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
if (line.length > lineLength - lineMargin && (match = line.substr(-lineMargin).match(/[ \t.,!?][^ \t.,!?]*$/))) {
|
|
84
|
+
// truncate to nearest space
|
|
85
|
+
line = line.substr(0, line.length - (match[0].length - 1));
|
|
86
|
+
}
|
|
87
|
+
else if (line.match(/[=][\da-f]{0,2}$/i)) {
|
|
88
|
+
// push incomplete encoding sequences to the next line
|
|
89
|
+
if ((match = line.match(/[=][\da-f]{0,1}$/i))) {
|
|
90
|
+
line = line.substr(0, line.length - match[0].length);
|
|
91
|
+
}
|
|
92
|
+
// ensure that utf-8 sequences are not split
|
|
93
|
+
while (line.length > 3 &&
|
|
94
|
+
line.length < len - pos &&
|
|
95
|
+
!line.match(/^(?:=[\da-f]{2}){1,4}$/i) &&
|
|
96
|
+
(match = line.match(/[=][\da-f]{2}$/gi))) {
|
|
97
|
+
code = parseInt(match[0].substr(1, 2), 16);
|
|
98
|
+
if (code < 128) {
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
101
|
+
line = line.substr(0, line.length - 3);
|
|
102
|
+
if (code >= 0xc0) {
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
if (!line.length) {
|
|
108
|
+
// the trimming above emptied the line, which only happens for an incomplete
|
|
109
|
+
// escape at the very end of the input. Take it as is rather than loop on it
|
|
110
|
+
line = str.substr(pos, lineLength);
|
|
111
|
+
}
|
|
112
|
+
if (pos + line.length < len && line.substr(-1) !== '\n') {
|
|
113
|
+
if (line.length === lineLength && line.match(/[=][\da-f]{2}$/i)) {
|
|
114
|
+
line = line.substr(0, line.length - 3);
|
|
115
|
+
}
|
|
116
|
+
else if (line.length === lineLength) {
|
|
117
|
+
line = line.substr(0, line.length - 1);
|
|
118
|
+
}
|
|
119
|
+
pos += line.length;
|
|
120
|
+
line += '=\r\n';
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
pos += line.length;
|
|
124
|
+
}
|
|
125
|
+
result += line;
|
|
126
|
+
}
|
|
127
|
+
return result;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Helper function to check if a number is inside provided ranges
|
|
131
|
+
*
|
|
132
|
+
* @param nr Number to check for
|
|
133
|
+
* @param ranges An Array of allowed values
|
|
134
|
+
* @returns True if the value was found inside allowed ranges, false otherwise
|
|
135
|
+
*/
|
|
136
|
+
function checkRanges(nr, ranges) {
|
|
137
|
+
for (let i = ranges.length - 1; i >= 0; i--) {
|
|
138
|
+
const range = ranges[i];
|
|
139
|
+
if (!range.length) {
|
|
140
|
+
continue;
|
|
141
|
+
}
|
|
142
|
+
if (range.length === 1 && nr === range[0]) {
|
|
143
|
+
return true;
|
|
144
|
+
}
|
|
145
|
+
if (range.length === 2 && nr >= range[0] && nr <= range[1]) {
|
|
146
|
+
return true;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return false;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Creates a transform stream for encoding data to Quoted-Printable encoding
|
|
153
|
+
*
|
|
154
|
+
* @constructor
|
|
155
|
+
* @param options Stream options
|
|
156
|
+
* @param [options.lineLength=76] Maximum length for lines, set to false to disable wrapping
|
|
157
|
+
*/
|
|
158
|
+
class Encoder extends node_stream_1.Transform {
|
|
159
|
+
constructor(options) {
|
|
160
|
+
super();
|
|
161
|
+
this.options = options || {};
|
|
162
|
+
if (this.options.lineLength !== false) {
|
|
163
|
+
this.options.lineLength = this.options.lineLength || 76;
|
|
164
|
+
}
|
|
165
|
+
this._curLine = '';
|
|
166
|
+
this.inputBytes = 0;
|
|
167
|
+
this.outputBytes = 0;
|
|
168
|
+
}
|
|
169
|
+
/** @internal */
|
|
170
|
+
_transform(chunk, encoding, done) {
|
|
171
|
+
let qp;
|
|
172
|
+
if (encoding !== 'buffer') {
|
|
173
|
+
chunk = Buffer.from(chunk, encoding);
|
|
174
|
+
}
|
|
175
|
+
if (!chunk || !chunk.length) {
|
|
176
|
+
return done();
|
|
177
|
+
}
|
|
178
|
+
this.inputBytes += chunk.length;
|
|
179
|
+
if (this.options.lineLength) {
|
|
180
|
+
qp = this._curLine + encode(chunk);
|
|
181
|
+
qp = wrap(qp, this.options.lineLength);
|
|
182
|
+
qp = qp.replace(/(^|\n)([^\n]*)$/, (match, lineBreak, lastLine) => {
|
|
183
|
+
this._curLine = lastLine;
|
|
184
|
+
return lineBreak;
|
|
185
|
+
});
|
|
186
|
+
if (qp) {
|
|
187
|
+
this.outputBytes += qp.length;
|
|
188
|
+
this.push(qp);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
qp = encode(chunk);
|
|
193
|
+
this.outputBytes += qp.length;
|
|
194
|
+
this.push(qp, 'ascii');
|
|
195
|
+
}
|
|
196
|
+
done();
|
|
197
|
+
}
|
|
198
|
+
/** @internal */
|
|
199
|
+
_flush(done) {
|
|
200
|
+
if (this._curLine) {
|
|
201
|
+
this.outputBytes += this._curLine.length;
|
|
202
|
+
this.push(this._curLine, 'ascii');
|
|
203
|
+
}
|
|
204
|
+
done();
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
exports.Encoder = Encoder;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { Logger } from '../shared/index.js';
|
|
2
|
+
import type { MimeNodeEnvelope } from '../mime-node/index.js';
|
|
3
|
+
import type MailMessage from '../mailer/mail-message.js';
|
|
4
|
+
import type { default as Mail, SentMessageInfo, SendMailOptions, TransportOptions } from '../mailer/index.js';
|
|
5
|
+
/**
|
|
6
|
+
* Options for the Sendmail transport
|
|
7
|
+
*/
|
|
8
|
+
export interface SendmailTransportOptions extends TransportOptions {
|
|
9
|
+
/** Selects this transport in createTransport, the binary itself is set with `path` */
|
|
10
|
+
sendmail?: boolean | string | undefined;
|
|
11
|
+
/** Path to the sendmail binary, defaults to 'sendmail' */
|
|
12
|
+
path?: string | undefined;
|
|
13
|
+
/** Either 'windows' or 'unix', the line ending of the message piped to sendmail */
|
|
14
|
+
newline?: string | undefined;
|
|
15
|
+
/** Arguments for the sendmail binary, replaces the default '-f <sender>' */
|
|
16
|
+
args?: string[] | undefined;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The value the Sendmail transport hands to the send callback
|
|
20
|
+
*/
|
|
21
|
+
export interface SendmailSentMessageInfo extends SentMessageInfo {
|
|
22
|
+
/** The envelope the message was sent with */
|
|
23
|
+
envelope: MimeNodeEnvelope;
|
|
24
|
+
/** Message-ID value of the message */
|
|
25
|
+
messageId: string;
|
|
26
|
+
/** Always 'Messages queued for delivery' */
|
|
27
|
+
response: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Generates a Transport object for Sendmail
|
|
31
|
+
*
|
|
32
|
+
* Possible options can be the following:
|
|
33
|
+
*
|
|
34
|
+
* * **path** optional path to sendmail binary
|
|
35
|
+
* * **newline** either 'windows' or 'unix'
|
|
36
|
+
* * **args** an array of arguments for the sendmail binary
|
|
37
|
+
*
|
|
38
|
+
* @constructor
|
|
39
|
+
* @param optional config parameter for Sendmail
|
|
40
|
+
*/
|
|
41
|
+
declare class SendmailTransport {
|
|
42
|
+
mailer: Mail<SendmailSentMessageInfo>;
|
|
43
|
+
options: SendmailTransportOptions;
|
|
44
|
+
name: string;
|
|
45
|
+
version: string;
|
|
46
|
+
path: string;
|
|
47
|
+
args: string[] | false;
|
|
48
|
+
logger: Logger;
|
|
49
|
+
winbreak: boolean;
|
|
50
|
+
constructor(options?: SendmailTransportOptions | string);
|
|
51
|
+
/**
|
|
52
|
+
* <p>Compiles a mailcomposer message and forwards it to handler that sends it.</p>
|
|
53
|
+
*
|
|
54
|
+
* @param mail MailComposer object
|
|
55
|
+
* @param done Callback function to run when the sending is completed
|
|
56
|
+
*/
|
|
57
|
+
send(mail: MailMessage<SendmailSentMessageInfo>, done: (err: Error | null, info?: SendmailSentMessageInfo) => void): void;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Type aliases in the layout of @types/nodemailer, so `SendmailTransport.Options` style references keep working
|
|
61
|
+
*/
|
|
62
|
+
declare namespace SendmailTransport {
|
|
63
|
+
type Options = SendmailTransportOptions;
|
|
64
|
+
type MailOptions = SendMailOptions;
|
|
65
|
+
type SentMessageInfo = SendmailSentMessageInfo;
|
|
66
|
+
}
|
|
67
|
+
/** The same aliases as module level exports, for `import * as SendmailTransport` and `import SendmailTransport = require()` */
|
|
68
|
+
export type { SendmailTransportOptions as Options, SendMailOptions as MailOptions, SendmailSentMessageInfo as SentMessageInfo };
|
|
69
|
+
export default SendmailTransport;
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
const node_child_process_1 = require("node:child_process");
|
|
40
|
+
const packageData = __importStar(require("../package-info.js"));
|
|
41
|
+
const shared = __importStar(require("../shared/index.js"));
|
|
42
|
+
const errors = __importStar(require("../errors.js"));
|
|
43
|
+
const le_windows_js_1 = __importDefault(require("../mime-node/le-windows.js"));
|
|
44
|
+
const le_unix_js_1 = __importDefault(require("../mime-node/le-unix.js"));
|
|
45
|
+
/**
|
|
46
|
+
* Generates a Transport object for Sendmail
|
|
47
|
+
*
|
|
48
|
+
* Possible options can be the following:
|
|
49
|
+
*
|
|
50
|
+
* * **path** optional path to sendmail binary
|
|
51
|
+
* * **newline** either 'windows' or 'unix'
|
|
52
|
+
* * **args** an array of arguments for the sendmail binary
|
|
53
|
+
*
|
|
54
|
+
* @constructor
|
|
55
|
+
* @param optional config parameter for Sendmail
|
|
56
|
+
*/
|
|
57
|
+
class SendmailTransport {
|
|
58
|
+
constructor(options) {
|
|
59
|
+
options = options || {};
|
|
60
|
+
// use a reference to spawn for mocking purposes
|
|
61
|
+
this._spawn = node_child_process_1.spawn;
|
|
62
|
+
this.options = options;
|
|
63
|
+
this.name = 'Sendmail';
|
|
64
|
+
this.version = packageData.version;
|
|
65
|
+
this.path = 'sendmail';
|
|
66
|
+
this.args = false;
|
|
67
|
+
this.logger = shared.getLogger(this.options, {
|
|
68
|
+
component: this.options.component || 'sendmail'
|
|
69
|
+
});
|
|
70
|
+
if (typeof options === 'string') {
|
|
71
|
+
this.path = options;
|
|
72
|
+
}
|
|
73
|
+
else if (typeof options === 'object') {
|
|
74
|
+
if (options.path) {
|
|
75
|
+
this.path = options.path;
|
|
76
|
+
}
|
|
77
|
+
if (Array.isArray(options.args)) {
|
|
78
|
+
this.args = options.args;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
this.winbreak = ['win', 'windows', 'dos', '\r\n'].includes((options.newline || '').toString().toLowerCase());
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* <p>Compiles a mailcomposer message and forwards it to handler that sends it.</p>
|
|
85
|
+
*
|
|
86
|
+
* @param mail MailComposer object
|
|
87
|
+
* @param done Callback function to run when the sending is completed
|
|
88
|
+
*/
|
|
89
|
+
send(mail, done) {
|
|
90
|
+
// Sendmail strips this header line by itself. send() runs after the message was
|
|
91
|
+
// compiled, so mail.message is set
|
|
92
|
+
mail.message.keepBcc = true;
|
|
93
|
+
const envelope = mail.message.getEnvelope();
|
|
94
|
+
const messageId = mail.message.messageId();
|
|
95
|
+
let returned;
|
|
96
|
+
const hasInvalidAddresses = []
|
|
97
|
+
.concat(envelope.from || [])
|
|
98
|
+
.concat(envelope.to || [])
|
|
99
|
+
// a local part is either a dot-atom or a quoted-string, so a leading dash sits at
|
|
100
|
+
// offset 0 or, behind the opening quote, at offset 1. Only the first shape is read
|
|
101
|
+
// as an option by sendmail, but both are the address this guard keeps out of argv
|
|
102
|
+
.some(addr => /^"?-/.test(addr));
|
|
103
|
+
if (hasInvalidAddresses) {
|
|
104
|
+
const err = new Error('Can not send mail. Invalid envelope addresses.');
|
|
105
|
+
err.code = errors.ESENDMAIL;
|
|
106
|
+
return done(err);
|
|
107
|
+
}
|
|
108
|
+
// force -i to keep single dots
|
|
109
|
+
const args = this.args
|
|
110
|
+
? ['-i'].concat(this.args).concat(envelope.to)
|
|
111
|
+
: ['-i'].concat(envelope.from ? ['-f', envelope.from] : []).concat(envelope.to);
|
|
112
|
+
const callback = (err) => {
|
|
113
|
+
if (returned) {
|
|
114
|
+
// ignore any additional responses, already done
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
returned = true;
|
|
118
|
+
if (typeof done === 'function') {
|
|
119
|
+
if (err) {
|
|
120
|
+
return done(err);
|
|
121
|
+
}
|
|
122
|
+
return done(null, {
|
|
123
|
+
envelope,
|
|
124
|
+
messageId,
|
|
125
|
+
response: 'Messages queued for delivery'
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
let sendmail;
|
|
130
|
+
try {
|
|
131
|
+
sendmail = this._spawn(this.path, args);
|
|
132
|
+
}
|
|
133
|
+
catch (E) {
|
|
134
|
+
this.logger.error({
|
|
135
|
+
err: E,
|
|
136
|
+
tnx: 'spawn',
|
|
137
|
+
messageId
|
|
138
|
+
}, 'Error occurred while spawning sendmail. %s', E.message);
|
|
139
|
+
return callback(E);
|
|
140
|
+
}
|
|
141
|
+
if (sendmail) {
|
|
142
|
+
sendmail.on('error', err => {
|
|
143
|
+
this.logger.error({
|
|
144
|
+
err,
|
|
145
|
+
tnx: 'spawn',
|
|
146
|
+
messageId
|
|
147
|
+
}, 'Error occurred when sending message %s. %s', messageId, err.message);
|
|
148
|
+
callback(err);
|
|
149
|
+
});
|
|
150
|
+
sendmail.once('exit', code => {
|
|
151
|
+
if (!code) {
|
|
152
|
+
return callback();
|
|
153
|
+
}
|
|
154
|
+
const err = new Error(code === 127 ? 'Sendmail command not found, process exited with code ' + code : 'Sendmail exited with code ' + code);
|
|
155
|
+
err.code = errors.ESENDMAIL;
|
|
156
|
+
this.logger.error({
|
|
157
|
+
err,
|
|
158
|
+
tnx: 'stdin',
|
|
159
|
+
messageId
|
|
160
|
+
}, 'Error sending message %s to sendmail. %s', messageId, err.message);
|
|
161
|
+
callback(err);
|
|
162
|
+
});
|
|
163
|
+
// the close listener is handed the exit code as its first argument, so a non-zero
|
|
164
|
+
// code reaching it before the exit listener did counts as the error value
|
|
165
|
+
sendmail.once('close', callback);
|
|
166
|
+
sendmail.stdin.on('error', err => {
|
|
167
|
+
this.logger.error({
|
|
168
|
+
err,
|
|
169
|
+
tnx: 'stdin',
|
|
170
|
+
messageId
|
|
171
|
+
}, 'Error occurred when piping message %s to sendmail. %s', messageId, err.message);
|
|
172
|
+
callback(err);
|
|
173
|
+
});
|
|
174
|
+
const recipients = [].concat(envelope.to || []);
|
|
175
|
+
if (recipients.length > 3) {
|
|
176
|
+
recipients.push('...and ' + recipients.splice(2).length + ' more');
|
|
177
|
+
}
|
|
178
|
+
this.logger.info({
|
|
179
|
+
tnx: 'send',
|
|
180
|
+
messageId
|
|
181
|
+
}, 'Sending message %s to <%s>', messageId, recipients.join(', '));
|
|
182
|
+
const sourceStream = mail.message.createReadStream();
|
|
183
|
+
let stream = sourceStream;
|
|
184
|
+
if (this.options.newline) {
|
|
185
|
+
// apply the transport-level line ending transform; the message-level
|
|
186
|
+
// `newline` option is handled by MimeNode in createReadStream()
|
|
187
|
+
stream = sourceStream.pipe(this.winbreak ? new le_windows_js_1.default() : new le_unix_js_1.default());
|
|
188
|
+
sourceStream.once('error', err => stream.emit('error', err));
|
|
189
|
+
}
|
|
190
|
+
stream.once('error', err => {
|
|
191
|
+
this.logger.error({
|
|
192
|
+
err,
|
|
193
|
+
tnx: 'stdin',
|
|
194
|
+
messageId
|
|
195
|
+
}, 'Error occurred when generating message %s. %s', messageId, err.message);
|
|
196
|
+
sendmail.kill('SIGINT'); // do not deliver the message
|
|
197
|
+
callback(err);
|
|
198
|
+
});
|
|
199
|
+
stream.pipe(sendmail.stdin);
|
|
200
|
+
}
|
|
201
|
+
else {
|
|
202
|
+
const err = new Error('sendmail was not found');
|
|
203
|
+
err.code = errors.ESENDMAIL;
|
|
204
|
+
return callback(err);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
exports.default = SendmailTransport;
|
|
209
|
+
module.exports = exports.default;
|
|
210
|
+
Object.defineProperty(module.exports, 'default', { value: exports.default, enumerable: false, writable: true, configurable: true });
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import EventEmitter from 'node:events';
|
|
2
|
+
import type { Logger } from '../shared/index.js';
|
|
3
|
+
import { type MimeNodeEnvelope } from '../mime-node/index.js';
|
|
4
|
+
import type MailMessage from '../mailer/mail-message.js';
|
|
5
|
+
import type { default as Mail, SentMessageInfo, SendMailOptions, TransportOptions, VerifyCallback } from '../mailer/index.js';
|
|
6
|
+
/**
|
|
7
|
+
* Options for the SES transport
|
|
8
|
+
*/
|
|
9
|
+
export interface SESTransportOptions extends TransportOptions {
|
|
10
|
+
/** The AWS SDK v3 objects to send with, `{ sesClient, SendEmailCommand }` from @aws-sdk/client-sesv2 */
|
|
11
|
+
SES: {
|
|
12
|
+
/** SESv2Client instance. Its config.region provider is resolved for the domain of the returned Message-ID */
|
|
13
|
+
sesClient: {
|
|
14
|
+
config?: {
|
|
15
|
+
region?: (() => Promise<string>) | undefined;
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
} | undefined;
|
|
18
|
+
send(command: unknown): Promise<any>;
|
|
19
|
+
};
|
|
20
|
+
/** SendEmailCommand class, constructed with the SendEmailCommandInput of every message */
|
|
21
|
+
SendEmailCommand: new (input: any) => unknown;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/** The SESv2Client shape the transport needs */
|
|
25
|
+
export type SESTransportClient = SESTransportOptions['SES']['sesClient'];
|
|
26
|
+
/** The SendEmailCommand constructor shape the transport needs */
|
|
27
|
+
export type SESTransportSendEmailCommand = SESTransportOptions['SES']['SendEmailCommand'];
|
|
28
|
+
/**
|
|
29
|
+
* SendEmailCommand parameters, the shape of the `ses` message option that is merged into
|
|
30
|
+
* the API call. Any further SendEmailCommandInput field is accepted as well
|
|
31
|
+
*/
|
|
32
|
+
export interface SESSendEmailRequest {
|
|
33
|
+
FromEmailAddress?: string | undefined;
|
|
34
|
+
Destination?: {
|
|
35
|
+
ToAddresses?: string[] | undefined;
|
|
36
|
+
CcAddresses?: string[] | undefined;
|
|
37
|
+
BccAddresses?: string[] | undefined;
|
|
38
|
+
} | undefined;
|
|
39
|
+
ReplyToAddresses?: string[] | undefined;
|
|
40
|
+
Content?: unknown;
|
|
41
|
+
EmailTags?: Array<{
|
|
42
|
+
Name?: string | undefined;
|
|
43
|
+
Value?: string | undefined;
|
|
44
|
+
}> | undefined;
|
|
45
|
+
ConfigurationSetName?: string | undefined;
|
|
46
|
+
ListManagementOptions?: unknown;
|
|
47
|
+
FeedbackForwardingEmailAddress?: string | undefined;
|
|
48
|
+
[key: string]: unknown;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* The value the SES transport hands to the send callback
|
|
52
|
+
*/
|
|
53
|
+
export interface SESSentMessageInfo extends SentMessageInfo {
|
|
54
|
+
/** The envelope the message was sent with */
|
|
55
|
+
envelope: MimeNodeEnvelope;
|
|
56
|
+
/** Message-ID built from the MessageId SES returned */
|
|
57
|
+
messageId: string;
|
|
58
|
+
/** The MessageId SES returned */
|
|
59
|
+
response: string;
|
|
60
|
+
/** The raw RFC822 message that was sent */
|
|
61
|
+
raw: Buffer;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Generates a Transport object for AWS SES
|
|
65
|
+
*
|
|
66
|
+
* @constructor
|
|
67
|
+
* @param optional config parameter
|
|
68
|
+
*/
|
|
69
|
+
declare class SESTransport extends EventEmitter {
|
|
70
|
+
mailer: Mail<SESSentMessageInfo>;
|
|
71
|
+
options: SESTransportOptions;
|
|
72
|
+
ses: SESTransportOptions['SES'];
|
|
73
|
+
name: string;
|
|
74
|
+
version: string;
|
|
75
|
+
logger: Logger;
|
|
76
|
+
constructor(options: SESTransportOptions);
|
|
77
|
+
getRegion(cb: (err: Error | null, region?: string | false) => void): void;
|
|
78
|
+
/**
|
|
79
|
+
* Compiles a mailcomposer message and forwards it to SES
|
|
80
|
+
*
|
|
81
|
+
* @param mail MailComposer object
|
|
82
|
+
* @param callback Callback function to run when the sending is completed
|
|
83
|
+
*/
|
|
84
|
+
send(mail: MailMessage<SESSentMessageInfo>, callback: (err: Error | null, info?: SESSentMessageInfo) => void): void;
|
|
85
|
+
/**
|
|
86
|
+
* Verifies SES configuration
|
|
87
|
+
*
|
|
88
|
+
* @returns Promise that resolves to true if the configuration is usable
|
|
89
|
+
*/
|
|
90
|
+
verify(): Promise<true>;
|
|
91
|
+
/**
|
|
92
|
+
* Verifies SES configuration
|
|
93
|
+
*
|
|
94
|
+
* @param callback Callback function
|
|
95
|
+
*/
|
|
96
|
+
verify(callback: VerifyCallback): void;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Type aliases in the layout of @types/nodemailer, so `SESTransport.Options` style references keep working
|
|
100
|
+
*/
|
|
101
|
+
declare namespace SESTransport {
|
|
102
|
+
type Options = SESTransportOptions;
|
|
103
|
+
type MailOptions = SendMailOptions;
|
|
104
|
+
type SentMessageInfo = SESSentMessageInfo;
|
|
105
|
+
type SESv2ClientLike = SESTransportClient;
|
|
106
|
+
type SendEmailCommandConstructorLike = SESTransportSendEmailCommand;
|
|
107
|
+
type SendEmailRequestLike = SESSendEmailRequest;
|
|
108
|
+
type MailSesOptions = SESSendEmailRequest;
|
|
109
|
+
}
|
|
110
|
+
/** The same aliases as module level exports, for `import * as SESTransport` and `import SESTransport = require()` */
|
|
111
|
+
export type { SESTransportOptions as Options, SendMailOptions as MailOptions, SESSentMessageInfo as SentMessageInfo, SESTransportClient as SESv2ClientLike, SESTransportSendEmailCommand as SendEmailCommandConstructorLike, SESSendEmailRequest as SendEmailRequestLike, SESSendEmailRequest as MailSesOptions };
|
|
112
|
+
export default SESTransport;
|