@nocobase/plugin-notifications 0.14.0-alpha.7 → 0.15.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/externalVersion.js +3 -3
  2. package/dist/node_modules/nodemailer/.gitattributes +6 -0
  3. package/dist/node_modules/nodemailer/.ncurc.js +7 -0
  4. package/dist/node_modules/nodemailer/.prettierrc.js +8 -0
  5. package/dist/node_modules/nodemailer/LICENSE +16 -0
  6. package/dist/node_modules/nodemailer/SECURITY.txt +22 -0
  7. package/dist/node_modules/nodemailer/lib/addressparser/index.js +313 -0
  8. package/dist/node_modules/nodemailer/lib/base64/index.js +142 -0
  9. package/dist/node_modules/nodemailer/lib/dkim/index.js +251 -0
  10. package/dist/node_modules/nodemailer/lib/dkim/message-parser.js +155 -0
  11. package/dist/node_modules/nodemailer/lib/dkim/relaxed-body.js +154 -0
  12. package/dist/node_modules/nodemailer/lib/dkim/sign.js +117 -0
  13. package/dist/node_modules/nodemailer/lib/fetch/cookies.js +281 -0
  14. package/dist/node_modules/nodemailer/lib/fetch/index.js +274 -0
  15. package/dist/node_modules/nodemailer/lib/json-transport/index.js +82 -0
  16. package/dist/node_modules/nodemailer/lib/mail-composer/index.js +558 -0
  17. package/dist/node_modules/nodemailer/lib/mailer/index.js +427 -0
  18. package/dist/node_modules/nodemailer/lib/mailer/mail-message.js +315 -0
  19. package/dist/node_modules/nodemailer/lib/mime-funcs/index.js +625 -0
  20. package/dist/node_modules/nodemailer/lib/mime-funcs/mime-types.js +2102 -0
  21. package/dist/node_modules/nodemailer/lib/mime-node/index.js +1305 -0
  22. package/dist/node_modules/nodemailer/lib/mime-node/last-newline.js +33 -0
  23. package/dist/node_modules/nodemailer/lib/mime-node/le-unix.js +43 -0
  24. package/dist/node_modules/nodemailer/lib/mime-node/le-windows.js +52 -0
  25. package/dist/node_modules/nodemailer/lib/nodemailer.js +1 -0
  26. package/dist/node_modules/nodemailer/lib/qp/index.js +219 -0
  27. package/dist/node_modules/nodemailer/lib/sendmail-transport/index.js +210 -0
  28. package/dist/node_modules/nodemailer/lib/ses-transport/index.js +349 -0
  29. package/dist/node_modules/nodemailer/lib/shared/index.js +638 -0
  30. package/dist/node_modules/nodemailer/lib/smtp-connection/data-stream.js +108 -0
  31. package/dist/node_modules/nodemailer/lib/smtp-connection/http-proxy-client.js +143 -0
  32. package/dist/node_modules/nodemailer/lib/smtp-connection/index.js +1812 -0
  33. package/dist/node_modules/nodemailer/lib/smtp-pool/index.js +648 -0
  34. package/dist/node_modules/nodemailer/lib/smtp-pool/pool-resource.js +253 -0
  35. package/dist/node_modules/nodemailer/lib/smtp-transport/index.js +416 -0
  36. package/dist/node_modules/nodemailer/lib/stream-transport/index.js +135 -0
  37. package/dist/node_modules/nodemailer/lib/well-known/index.js +47 -0
  38. package/dist/node_modules/nodemailer/lib/well-known/services.json +294 -0
  39. package/dist/node_modules/nodemailer/lib/xoauth2/index.js +376 -0
  40. package/dist/node_modules/nodemailer/package.json +1 -0
  41. package/dist/node_modules/nodemailer/postinstall.js +101 -0
  42. package/package.json +2 -2
@@ -0,0 +1,135 @@
1
+ 'use strict';
2
+
3
+ const packageData = require('../../package.json');
4
+ const shared = require('../shared');
5
+
6
+ /**
7
+ * Generates a Transport object for streaming
8
+ *
9
+ * Possible options can be the following:
10
+ *
11
+ * * **buffer** if true, then returns the message as a Buffer object instead of a stream
12
+ * * **newline** either 'windows' or 'unix'
13
+ *
14
+ * @constructor
15
+ * @param {Object} optional config parameter
16
+ */
17
+ class StreamTransport {
18
+ constructor(options) {
19
+ options = options || {};
20
+
21
+ this.options = options || {};
22
+
23
+ this.name = 'StreamTransport';
24
+ this.version = packageData.version;
25
+
26
+ this.logger = shared.getLogger(this.options, {
27
+ component: this.options.component || 'stream-transport'
28
+ });
29
+
30
+ this.winbreak = ['win', 'windows', 'dos', '\r\n'].includes((options.newline || '').toString().toLowerCase());
31
+ }
32
+
33
+ /**
34
+ * Compiles a mailcomposer message and forwards it to handler that sends it
35
+ *
36
+ * @param {Object} emailMessage MailComposer object
37
+ * @param {Function} callback Callback function to run when the sending is completed
38
+ */
39
+ send(mail, done) {
40
+ // We probably need this in the output
41
+ mail.message.keepBcc = true;
42
+
43
+ let envelope = mail.data.envelope || mail.message.getEnvelope();
44
+ let messageId = mail.message.messageId();
45
+
46
+ let recipients = [].concat(envelope.to || []);
47
+ if (recipients.length > 3) {
48
+ recipients.push('...and ' + recipients.splice(2).length + ' more');
49
+ }
50
+ this.logger.info(
51
+ {
52
+ tnx: 'send',
53
+ messageId
54
+ },
55
+ 'Sending message %s to <%s> using %s line breaks',
56
+ messageId,
57
+ recipients.join(', '),
58
+ this.winbreak ? '<CR><LF>' : '<LF>'
59
+ );
60
+
61
+ setImmediate(() => {
62
+ let stream;
63
+
64
+ try {
65
+ stream = mail.message.createReadStream();
66
+ } catch (E) {
67
+ this.logger.error(
68
+ {
69
+ err: E,
70
+ tnx: 'send',
71
+ messageId
72
+ },
73
+ 'Creating send stream failed for %s. %s',
74
+ messageId,
75
+ E.message
76
+ );
77
+ return done(E);
78
+ }
79
+
80
+ if (!this.options.buffer) {
81
+ stream.once('error', err => {
82
+ this.logger.error(
83
+ {
84
+ err,
85
+ tnx: 'send',
86
+ messageId
87
+ },
88
+ 'Failed creating message for %s. %s',
89
+ messageId,
90
+ err.message
91
+ );
92
+ });
93
+ return done(null, {
94
+ envelope: mail.data.envelope || mail.message.getEnvelope(),
95
+ messageId,
96
+ message: stream
97
+ });
98
+ }
99
+
100
+ let chunks = [];
101
+ let chunklen = 0;
102
+ stream.on('readable', () => {
103
+ let chunk;
104
+ while ((chunk = stream.read()) !== null) {
105
+ chunks.push(chunk);
106
+ chunklen += chunk.length;
107
+ }
108
+ });
109
+
110
+ stream.once('error', err => {
111
+ this.logger.error(
112
+ {
113
+ err,
114
+ tnx: 'send',
115
+ messageId
116
+ },
117
+ 'Failed creating message for %s. %s',
118
+ messageId,
119
+ err.message
120
+ );
121
+ return done(err);
122
+ });
123
+
124
+ stream.on('end', () =>
125
+ done(null, {
126
+ envelope: mail.data.envelope || mail.message.getEnvelope(),
127
+ messageId,
128
+ message: Buffer.concat(chunks, chunklen)
129
+ })
130
+ );
131
+ });
132
+ }
133
+ }
134
+
135
+ module.exports = StreamTransport;
@@ -0,0 +1,47 @@
1
+ 'use strict';
2
+
3
+ const services = require('./services.json');
4
+ const normalized = {};
5
+
6
+ Object.keys(services).forEach(key => {
7
+ let service = services[key];
8
+
9
+ normalized[normalizeKey(key)] = normalizeService(service);
10
+
11
+ [].concat(service.aliases || []).forEach(alias => {
12
+ normalized[normalizeKey(alias)] = normalizeService(service);
13
+ });
14
+
15
+ [].concat(service.domains || []).forEach(domain => {
16
+ normalized[normalizeKey(domain)] = normalizeService(service);
17
+ });
18
+ });
19
+
20
+ function normalizeKey(key) {
21
+ return key.replace(/[^a-zA-Z0-9.-]/g, '').toLowerCase();
22
+ }
23
+
24
+ function normalizeService(service) {
25
+ let filter = ['domains', 'aliases'];
26
+ let response = {};
27
+
28
+ Object.keys(service).forEach(key => {
29
+ if (filter.indexOf(key) < 0) {
30
+ response[key] = service[key];
31
+ }
32
+ });
33
+
34
+ return response;
35
+ }
36
+
37
+ /**
38
+ * Resolves SMTP config for given key. Key can be a name (like 'Gmail'), alias (like 'Google Mail') or
39
+ * an email address (like 'test@googlemail.com').
40
+ *
41
+ * @param {String} key [description]
42
+ * @returns {Object} SMTP config or false if not found
43
+ */
44
+ module.exports = function (key) {
45
+ key = normalizeKey(key.split('@').pop());
46
+ return normalized[key] || false;
47
+ };
@@ -0,0 +1,294 @@
1
+ {
2
+ "1und1": {
3
+ "host": "smtp.1und1.de",
4
+ "port": 465,
5
+ "secure": true,
6
+ "authMethod": "LOGIN"
7
+ },
8
+
9
+ "AOL": {
10
+ "domains": ["aol.com"],
11
+ "host": "smtp.aol.com",
12
+ "port": 587
13
+ },
14
+
15
+ "Bluewin": {
16
+ "host": "smtpauths.bluewin.ch",
17
+ "domains": ["bluewin.ch"],
18
+ "port": 465
19
+ },
20
+
21
+ "DebugMail": {
22
+ "host": "debugmail.io",
23
+ "port": 25
24
+ },
25
+
26
+ "DynectEmail": {
27
+ "aliases": ["Dynect"],
28
+ "host": "smtp.dynect.net",
29
+ "port": 25
30
+ },
31
+
32
+ "Ethereal": {
33
+ "aliases": ["ethereal.email"],
34
+ "host": "smtp.ethereal.email",
35
+ "port": 587
36
+ },
37
+
38
+ "FastMail": {
39
+ "domains": ["fastmail.fm"],
40
+ "host": "smtp.fastmail.com",
41
+ "port": 465,
42
+ "secure": true
43
+ },
44
+
45
+ "Forward Email": {
46
+ "aliases": ["FE", "ForwardEmail"],
47
+ "domains": ["forwardemail.net"],
48
+ "host": "smtp.forwardemail.net",
49
+ "port": 465,
50
+ "secure": true
51
+ },
52
+
53
+ "GandiMail": {
54
+ "aliases": ["Gandi", "Gandi Mail"],
55
+ "host": "mail.gandi.net",
56
+ "port": 587
57
+ },
58
+
59
+ "Gmail": {
60
+ "aliases": ["Google Mail"],
61
+ "domains": ["gmail.com", "googlemail.com"],
62
+ "host": "smtp.gmail.com",
63
+ "port": 465,
64
+ "secure": true
65
+ },
66
+
67
+ "Godaddy": {
68
+ "host": "smtpout.secureserver.net",
69
+ "port": 25
70
+ },
71
+
72
+ "GodaddyAsia": {
73
+ "host": "smtp.asia.secureserver.net",
74
+ "port": 25
75
+ },
76
+
77
+ "GodaddyEurope": {
78
+ "host": "smtp.europe.secureserver.net",
79
+ "port": 25
80
+ },
81
+
82
+ "hot.ee": {
83
+ "host": "mail.hot.ee"
84
+ },
85
+
86
+ "Hotmail": {
87
+ "aliases": ["Outlook", "Outlook.com", "Hotmail.com"],
88
+ "domains": ["hotmail.com", "outlook.com"],
89
+ "host": "smtp-mail.outlook.com",
90
+ "port": 587
91
+ },
92
+
93
+ "iCloud": {
94
+ "aliases": ["Me", "Mac"],
95
+ "domains": ["me.com", "mac.com"],
96
+ "host": "smtp.mail.me.com",
97
+ "port": 587
98
+ },
99
+
100
+ "Infomaniak": {
101
+ "host": "mail.infomaniak.com",
102
+ "domains": ["ik.me", "ikmail.com", "etik.com"],
103
+ "port": 587
104
+ },
105
+
106
+ "mail.ee": {
107
+ "host": "smtp.mail.ee"
108
+ },
109
+
110
+ "Mail.ru": {
111
+ "host": "smtp.mail.ru",
112
+ "port": 465,
113
+ "secure": true
114
+ },
115
+
116
+ "Maildev": {
117
+ "port": 1025,
118
+ "ignoreTLS": true
119
+ },
120
+
121
+ "Mailgun": {
122
+ "host": "smtp.mailgun.org",
123
+ "port": 465,
124
+ "secure": true
125
+ },
126
+
127
+ "Mailjet": {
128
+ "host": "in.mailjet.com",
129
+ "port": 587
130
+ },
131
+
132
+ "Mailosaur": {
133
+ "host": "mailosaur.io",
134
+ "port": 25
135
+ },
136
+
137
+ "Mailtrap": {
138
+ "host": "smtp.mailtrap.io",
139
+ "port": 2525
140
+ },
141
+
142
+ "Mandrill": {
143
+ "host": "smtp.mandrillapp.com",
144
+ "port": 587
145
+ },
146
+
147
+ "Naver": {
148
+ "host": "smtp.naver.com",
149
+ "port": 587
150
+ },
151
+
152
+ "One": {
153
+ "host": "send.one.com",
154
+ "port": 465,
155
+ "secure": true
156
+ },
157
+
158
+ "OpenMailBox": {
159
+ "aliases": ["OMB", "openmailbox.org"],
160
+ "host": "smtp.openmailbox.org",
161
+ "port": 465,
162
+ "secure": true
163
+ },
164
+
165
+ "Outlook365": {
166
+ "host": "smtp.office365.com",
167
+ "port": 587,
168
+ "secure": false
169
+ },
170
+
171
+ "OhMySMTP": {
172
+ "host": "smtp.ohmysmtp.com",
173
+ "port": 587,
174
+ "secure": false
175
+ },
176
+
177
+ "Postmark": {
178
+ "aliases": ["PostmarkApp"],
179
+ "host": "smtp.postmarkapp.com",
180
+ "port": 2525
181
+ },
182
+
183
+ "qiye.aliyun": {
184
+ "host": "smtp.mxhichina.com",
185
+ "port": "465",
186
+ "secure": true
187
+ },
188
+
189
+ "QQ": {
190
+ "domains": ["qq.com"],
191
+ "host": "smtp.qq.com",
192
+ "port": 465,
193
+ "secure": true
194
+ },
195
+
196
+ "QQex": {
197
+ "aliases": ["QQ Enterprise"],
198
+ "domains": ["exmail.qq.com"],
199
+ "host": "smtp.exmail.qq.com",
200
+ "port": 465,
201
+ "secure": true
202
+ },
203
+
204
+ "SendCloud": {
205
+ "host": "smtp.sendcloud.net",
206
+ "port": 2525
207
+ },
208
+
209
+ "SendGrid": {
210
+ "host": "smtp.sendgrid.net",
211
+ "port": 587
212
+ },
213
+
214
+ "SendinBlue": {
215
+ "host": "smtp-relay.sendinblue.com",
216
+ "port": 587
217
+ },
218
+
219
+ "SendPulse": {
220
+ "host": "smtp-pulse.com",
221
+ "port": 465,
222
+ "secure": true
223
+ },
224
+
225
+ "SES": {
226
+ "host": "email-smtp.us-east-1.amazonaws.com",
227
+ "port": 465,
228
+ "secure": true
229
+ },
230
+
231
+ "SES-US-EAST-1": {
232
+ "host": "email-smtp.us-east-1.amazonaws.com",
233
+ "port": 465,
234
+ "secure": true
235
+ },
236
+
237
+ "SES-US-WEST-2": {
238
+ "host": "email-smtp.us-west-2.amazonaws.com",
239
+ "port": 465,
240
+ "secure": true
241
+ },
242
+
243
+ "SES-EU-WEST-1": {
244
+ "host": "email-smtp.eu-west-1.amazonaws.com",
245
+ "port": 465,
246
+ "secure": true
247
+ },
248
+
249
+ "Sparkpost": {
250
+ "aliases": ["SparkPost", "SparkPost Mail"],
251
+ "domains": ["sparkpost.com"],
252
+ "host": "smtp.sparkpostmail.com",
253
+ "port": 587,
254
+ "secure": false
255
+ },
256
+
257
+ "Tipimail": {
258
+ "host": "smtp.tipimail.com",
259
+ "port": 587
260
+ },
261
+
262
+ "Yahoo": {
263
+ "domains": ["yahoo.com"],
264
+ "host": "smtp.mail.yahoo.com",
265
+ "port": 465,
266
+ "secure": true
267
+ },
268
+
269
+ "Yandex": {
270
+ "domains": ["yandex.ru"],
271
+ "host": "smtp.yandex.ru",
272
+ "port": 465,
273
+ "secure": true
274
+ },
275
+
276
+ "Zoho": {
277
+ "host": "smtp.zoho.com",
278
+ "port": 465,
279
+ "secure": true,
280
+ "authMethod": "LOGIN"
281
+ },
282
+
283
+ "126": {
284
+ "host": "smtp.126.com",
285
+ "port": 465,
286
+ "secure": true
287
+ },
288
+
289
+ "163": {
290
+ "host": "smtp.163.com",
291
+ "port": 465,
292
+ "secure": true
293
+ }
294
+ }