@bobfrankston/mailx 1.0.9 → 1.0.13
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/bin/mailx.js +47 -29
- package/bin/postinstall.js +41 -0
- package/client/app.js +93 -13
- package/client/components/folder-tree.js +84 -3
- package/client/components/message-list.js +134 -8
- package/client/components/message-viewer.js +130 -13
- package/client/compose/compose.html +4 -4
- package/client/compose/compose.js +53 -34
- package/client/index.html +33 -9
- package/client/lib/api-client.js +102 -30
- package/client/lib/mailxapi.js +123 -0
- package/client/package.json +5 -1
- package/client/styles/components.css +188 -15
- package/client/styles/layout.css +2 -1
- package/killmail.cmd +6 -0
- package/launch.ps1 +48 -3
- package/launcher/bin/mailx-app.exe +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Breadcrumbs +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Crashpad/metadata +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Crashpad/settings.dat +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Crashpad/throttle_store.dat +1 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/CrashpadMetrics-active.pma +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/BrowsingTopicsSiteData +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Cache/No_Vary_Search/journal.baj +1 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/DIPS +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/DashTrackerDatabase +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/EdgeJourneys/EdgeJourneys.db +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Extension Rules/LOCK +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Extension Rules/LOG +3 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Extension Rules/MANIFEST-000001 +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Extension Scripts/LOCK +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Extension Scripts/LOG +3 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Extension Scripts/MANIFEST-000001 +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Extension State/LOCK +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Extension State/LOG +3 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Extension State/MANIFEST-000001 +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/ExtensionActivityComp +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/ExtensionActivityEdge +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Favicons +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/History +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/History-journal +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/IndexedDB/devtools_devtools_0.indexeddb.leveldb/LOCK +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/IndexedDB/devtools_devtools_0.indexeddb.leveldb/LOG +3 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/IndexedDB/devtools_devtools_0.indexeddb.leveldb/MANIFEST-000001 +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Local Storage/leveldb/LOCK +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Local Storage/leveldb/LOG +3 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Local Storage/leveldb/MANIFEST-000001 +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Login Data +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Login Data For Account +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Network/Cookies +0 -0
- NEL +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Network/Trust Tokens +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Network Action Predictor +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Preferences +1 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Safe Browsing Network/Safe Browsing Cookies +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/ServerCertificate +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Session Storage/LOCK +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Session Storage/LOG +3 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Session Storage/MANIFEST-000001 +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Shared Dictionary/db +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/SharedStorage +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Shortcuts +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Site Characteristics Database/LOCK +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Site Characteristics Database/LOG +3 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Site Characteristics Database/MANIFEST-000001 +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Sync Data/LevelDB/LOCK +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Sync Data/LevelDB/LOG +3 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Sync Data/LevelDB/MANIFEST-000001 +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Top Sites +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Vpn Tokens +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Web Data +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/Web Data-journal +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/WebStorage/QuotaManager +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/WebStorage/QuotaManager-journal +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/heavy_ad_intervention_opt_out.db +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/shared_proto_db/LOCK +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/shared_proto_db/LOG +3 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/shared_proto_db/MANIFEST-000001 +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/shared_proto_db/metadata/LOCK +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/shared_proto_db/metadata/LOG +3 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Default/shared_proto_db/metadata/MANIFEST-000001 +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/DeferredBrowserMetrics/BrowserMetrics-69CAD063-BE24.pma +0 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Local State +1 -0
- package/launcher/bin/mailx-app.exe.WebView2/EBWebView/Variations +1 -0
- package/launcher/bin/mailx-app.old.exe +0 -0
- package/launcher/mailx.ico +0 -0
- package/npmg.bat +6 -0
- package/package.json +9 -3
- package/packages/mailx-api/index.js +79 -26
- package/packages/mailx-api/package.json +5 -1
- package/packages/mailx-compose/package.json +5 -1
- package/packages/mailx-core/index.d.ts +129 -0
- package/packages/mailx-core/index.js +323 -0
- package/packages/mailx-core/ipc.d.ts +13 -0
- package/packages/mailx-core/ipc.js +56 -0
- package/packages/mailx-core/package.json +18 -0
- package/packages/mailx-imap/index.d.ts +5 -1
- package/packages/mailx-imap/index.js +76 -14
- package/packages/mailx-imap/package.json +5 -1
- package/packages/mailx-send/package.json +12 -2
- package/packages/mailx-server/index.js +42 -31
- package/packages/mailx-server/package.json +5 -2
- package/packages/mailx-settings/index.d.ts +1 -1
- package/packages/mailx-settings/index.js +21 -12
- package/packages/mailx-settings/package.json +5 -1
- package/packages/mailx-store/db.d.ts +5 -1
- package/packages/mailx-store/db.js +64 -12
- package/packages/mailx-store/file-store.d.ts +2 -8
- package/packages/mailx-store/file-store.js +7 -31
- package/packages/mailx-store/package.json +5 -1
- package/packages/mailx-types/index.d.ts +3 -1
- package/packages/mailx-types/package.json +6 -2
- package/.tswalk.json +0 -3366
- package/mailx.json +0 -9
- package/packages/mailx-api/node_modules/nodemailer/.ncurc.js +0 -9
- package/packages/mailx-api/node_modules/nodemailer/.prettierignore +0 -8
- package/packages/mailx-api/node_modules/nodemailer/.prettierrc +0 -12
- package/packages/mailx-api/node_modules/nodemailer/.prettierrc.js +0 -10
- package/packages/mailx-api/node_modules/nodemailer/.release-please-config.json +0 -9
- package/packages/mailx-api/node_modules/nodemailer/LICENSE +0 -16
- package/packages/mailx-api/node_modules/nodemailer/README.md +0 -86
- package/packages/mailx-api/node_modules/nodemailer/SECURITY.txt +0 -22
- package/packages/mailx-api/node_modules/nodemailer/eslint.config.js +0 -88
- package/packages/mailx-api/node_modules/nodemailer/lib/addressparser/index.js +0 -383
- package/packages/mailx-api/node_modules/nodemailer/lib/base64/index.js +0 -139
- package/packages/mailx-api/node_modules/nodemailer/lib/dkim/index.js +0 -253
- package/packages/mailx-api/node_modules/nodemailer/lib/dkim/message-parser.js +0 -155
- package/packages/mailx-api/node_modules/nodemailer/lib/dkim/relaxed-body.js +0 -154
- package/packages/mailx-api/node_modules/nodemailer/lib/dkim/sign.js +0 -117
- package/packages/mailx-api/node_modules/nodemailer/lib/fetch/cookies.js +0 -281
- package/packages/mailx-api/node_modules/nodemailer/lib/fetch/index.js +0 -280
- package/packages/mailx-api/node_modules/nodemailer/lib/json-transport/index.js +0 -82
- package/packages/mailx-api/node_modules/nodemailer/lib/mail-composer/index.js +0 -629
- package/packages/mailx-api/node_modules/nodemailer/lib/mailer/index.js +0 -441
- package/packages/mailx-api/node_modules/nodemailer/lib/mailer/mail-message.js +0 -316
- package/packages/mailx-api/node_modules/nodemailer/lib/mime-funcs/index.js +0 -625
- package/packages/mailx-api/node_modules/nodemailer/lib/mime-funcs/mime-types.js +0 -2113
- package/packages/mailx-api/node_modules/nodemailer/lib/mime-node/index.js +0 -1316
- package/packages/mailx-api/node_modules/nodemailer/lib/mime-node/last-newline.js +0 -33
- package/packages/mailx-api/node_modules/nodemailer/lib/mime-node/le-unix.js +0 -43
- package/packages/mailx-api/node_modules/nodemailer/lib/mime-node/le-windows.js +0 -52
- package/packages/mailx-api/node_modules/nodemailer/lib/nodemailer.js +0 -157
- package/packages/mailx-api/node_modules/nodemailer/lib/punycode/index.js +0 -460
- package/packages/mailx-api/node_modules/nodemailer/lib/qp/index.js +0 -227
- package/packages/mailx-api/node_modules/nodemailer/lib/sendmail-transport/index.js +0 -210
- package/packages/mailx-api/node_modules/nodemailer/lib/ses-transport/index.js +0 -234
- package/packages/mailx-api/node_modules/nodemailer/lib/shared/index.js +0 -754
- package/packages/mailx-api/node_modules/nodemailer/lib/smtp-connection/data-stream.js +0 -108
- package/packages/mailx-api/node_modules/nodemailer/lib/smtp-connection/http-proxy-client.js +0 -143
- package/packages/mailx-api/node_modules/nodemailer/lib/smtp-connection/index.js +0 -1870
- package/packages/mailx-api/node_modules/nodemailer/lib/smtp-pool/index.js +0 -652
- package/packages/mailx-api/node_modules/nodemailer/lib/smtp-pool/pool-resource.js +0 -259
- package/packages/mailx-api/node_modules/nodemailer/lib/smtp-transport/index.js +0 -421
- package/packages/mailx-api/node_modules/nodemailer/lib/stream-transport/index.js +0 -135
- package/packages/mailx-api/node_modules/nodemailer/lib/well-known/index.js +0 -47
- package/packages/mailx-api/node_modules/nodemailer/lib/well-known/services.json +0 -611
- package/packages/mailx-api/node_modules/nodemailer/lib/xoauth2/index.js +0 -427
- package/packages/mailx-api/node_modules/nodemailer/package.json +0 -47
- package/packages/mailx-imap/node_modules/nodemailer/.ncurc.js +0 -9
- package/packages/mailx-imap/node_modules/nodemailer/.prettierignore +0 -8
- package/packages/mailx-imap/node_modules/nodemailer/.prettierrc +0 -12
- package/packages/mailx-imap/node_modules/nodemailer/.prettierrc.js +0 -10
- package/packages/mailx-imap/node_modules/nodemailer/.release-please-config.json +0 -9
- package/packages/mailx-imap/node_modules/nodemailer/LICENSE +0 -16
- package/packages/mailx-imap/node_modules/nodemailer/README.md +0 -86
- package/packages/mailx-imap/node_modules/nodemailer/SECURITY.txt +0 -22
- package/packages/mailx-imap/node_modules/nodemailer/eslint.config.js +0 -88
- package/packages/mailx-imap/node_modules/nodemailer/lib/addressparser/index.js +0 -383
- package/packages/mailx-imap/node_modules/nodemailer/lib/base64/index.js +0 -139
- package/packages/mailx-imap/node_modules/nodemailer/lib/dkim/index.js +0 -253
- package/packages/mailx-imap/node_modules/nodemailer/lib/dkim/message-parser.js +0 -155
- package/packages/mailx-imap/node_modules/nodemailer/lib/dkim/relaxed-body.js +0 -154
- package/packages/mailx-imap/node_modules/nodemailer/lib/dkim/sign.js +0 -117
- package/packages/mailx-imap/node_modules/nodemailer/lib/fetch/cookies.js +0 -281
- package/packages/mailx-imap/node_modules/nodemailer/lib/fetch/index.js +0 -280
- package/packages/mailx-imap/node_modules/nodemailer/lib/json-transport/index.js +0 -82
- package/packages/mailx-imap/node_modules/nodemailer/lib/mail-composer/index.js +0 -629
- package/packages/mailx-imap/node_modules/nodemailer/lib/mailer/index.js +0 -441
- package/packages/mailx-imap/node_modules/nodemailer/lib/mailer/mail-message.js +0 -316
- package/packages/mailx-imap/node_modules/nodemailer/lib/mime-funcs/index.js +0 -625
- package/packages/mailx-imap/node_modules/nodemailer/lib/mime-funcs/mime-types.js +0 -2113
- package/packages/mailx-imap/node_modules/nodemailer/lib/mime-node/index.js +0 -1316
- package/packages/mailx-imap/node_modules/nodemailer/lib/mime-node/last-newline.js +0 -33
- package/packages/mailx-imap/node_modules/nodemailer/lib/mime-node/le-unix.js +0 -43
- package/packages/mailx-imap/node_modules/nodemailer/lib/mime-node/le-windows.js +0 -52
- package/packages/mailx-imap/node_modules/nodemailer/lib/nodemailer.js +0 -157
- package/packages/mailx-imap/node_modules/nodemailer/lib/punycode/index.js +0 -460
- package/packages/mailx-imap/node_modules/nodemailer/lib/qp/index.js +0 -227
- package/packages/mailx-imap/node_modules/nodemailer/lib/sendmail-transport/index.js +0 -210
- package/packages/mailx-imap/node_modules/nodemailer/lib/ses-transport/index.js +0 -234
- package/packages/mailx-imap/node_modules/nodemailer/lib/shared/index.js +0 -754
- package/packages/mailx-imap/node_modules/nodemailer/lib/smtp-connection/data-stream.js +0 -108
- package/packages/mailx-imap/node_modules/nodemailer/lib/smtp-connection/http-proxy-client.js +0 -143
- package/packages/mailx-imap/node_modules/nodemailer/lib/smtp-connection/index.js +0 -1870
- package/packages/mailx-imap/node_modules/nodemailer/lib/smtp-pool/index.js +0 -652
- package/packages/mailx-imap/node_modules/nodemailer/lib/smtp-pool/pool-resource.js +0 -259
- package/packages/mailx-imap/node_modules/nodemailer/lib/smtp-transport/index.js +0 -421
- package/packages/mailx-imap/node_modules/nodemailer/lib/stream-transport/index.js +0 -135
- package/packages/mailx-imap/node_modules/nodemailer/lib/well-known/index.js +0 -47
- package/packages/mailx-imap/node_modules/nodemailer/lib/well-known/services.json +0 -611
- package/packages/mailx-imap/node_modules/nodemailer/lib/xoauth2/index.js +0 -427
- package/packages/mailx-imap/node_modules/nodemailer/package.json +0 -47
- package/packages/mailx-send/node_modules/nodemailer/.ncurc.js +0 -9
- package/packages/mailx-send/node_modules/nodemailer/.prettierignore +0 -8
- package/packages/mailx-send/node_modules/nodemailer/.prettierrc +0 -12
- package/packages/mailx-send/node_modules/nodemailer/.prettierrc.js +0 -10
- package/packages/mailx-send/node_modules/nodemailer/.release-please-config.json +0 -9
- package/packages/mailx-send/node_modules/nodemailer/LICENSE +0 -16
- package/packages/mailx-send/node_modules/nodemailer/README.md +0 -86
- package/packages/mailx-send/node_modules/nodemailer/SECURITY.txt +0 -22
- package/packages/mailx-send/node_modules/nodemailer/eslint.config.js +0 -88
- package/packages/mailx-send/node_modules/nodemailer/lib/addressparser/index.js +0 -383
- package/packages/mailx-send/node_modules/nodemailer/lib/base64/index.js +0 -139
- package/packages/mailx-send/node_modules/nodemailer/lib/dkim/index.js +0 -253
- package/packages/mailx-send/node_modules/nodemailer/lib/dkim/message-parser.js +0 -155
- package/packages/mailx-send/node_modules/nodemailer/lib/dkim/relaxed-body.js +0 -154
- package/packages/mailx-send/node_modules/nodemailer/lib/dkim/sign.js +0 -117
- package/packages/mailx-send/node_modules/nodemailer/lib/fetch/cookies.js +0 -281
- package/packages/mailx-send/node_modules/nodemailer/lib/fetch/index.js +0 -280
- package/packages/mailx-send/node_modules/nodemailer/lib/json-transport/index.js +0 -82
- package/packages/mailx-send/node_modules/nodemailer/lib/mail-composer/index.js +0 -629
- package/packages/mailx-send/node_modules/nodemailer/lib/mailer/index.js +0 -441
- package/packages/mailx-send/node_modules/nodemailer/lib/mailer/mail-message.js +0 -316
- package/packages/mailx-send/node_modules/nodemailer/lib/mime-funcs/index.js +0 -625
- package/packages/mailx-send/node_modules/nodemailer/lib/mime-funcs/mime-types.js +0 -2113
- package/packages/mailx-send/node_modules/nodemailer/lib/mime-node/index.js +0 -1316
- package/packages/mailx-send/node_modules/nodemailer/lib/mime-node/last-newline.js +0 -33
- package/packages/mailx-send/node_modules/nodemailer/lib/mime-node/le-unix.js +0 -43
- package/packages/mailx-send/node_modules/nodemailer/lib/mime-node/le-windows.js +0 -52
- package/packages/mailx-send/node_modules/nodemailer/lib/nodemailer.js +0 -157
- package/packages/mailx-send/node_modules/nodemailer/lib/punycode/index.js +0 -460
- package/packages/mailx-send/node_modules/nodemailer/lib/qp/index.js +0 -227
- package/packages/mailx-send/node_modules/nodemailer/lib/sendmail-transport/index.js +0 -210
- package/packages/mailx-send/node_modules/nodemailer/lib/ses-transport/index.js +0 -234
- package/packages/mailx-send/node_modules/nodemailer/lib/shared/index.js +0 -754
- package/packages/mailx-send/node_modules/nodemailer/lib/smtp-connection/data-stream.js +0 -108
- package/packages/mailx-send/node_modules/nodemailer/lib/smtp-connection/http-proxy-client.js +0 -143
- package/packages/mailx-send/node_modules/nodemailer/lib/smtp-connection/index.js +0 -1870
- package/packages/mailx-send/node_modules/nodemailer/lib/smtp-pool/index.js +0 -652
- package/packages/mailx-send/node_modules/nodemailer/lib/smtp-pool/pool-resource.js +0 -259
- package/packages/mailx-send/node_modules/nodemailer/lib/smtp-transport/index.js +0 -421
- package/packages/mailx-send/node_modules/nodemailer/lib/stream-transport/index.js +0 -135
- package/packages/mailx-send/node_modules/nodemailer/lib/well-known/index.js +0 -47
- package/packages/mailx-send/node_modules/nodemailer/lib/well-known/services.json +0 -611
- package/packages/mailx-send/node_modules/nodemailer/lib/xoauth2/index.js +0 -427
- package/packages/mailx-send/node_modules/nodemailer/package.json +0 -47
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const Transform = require('stream').Transform;
|
|
4
|
-
|
|
5
|
-
class LastNewline extends Transform {
|
|
6
|
-
constructor() {
|
|
7
|
-
super();
|
|
8
|
-
this.lastByte = false;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
_transform(chunk, encoding, done) {
|
|
12
|
-
if (chunk.length) {
|
|
13
|
-
this.lastByte = chunk[chunk.length - 1];
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
this.push(chunk);
|
|
17
|
-
done();
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
_flush(done) {
|
|
21
|
-
if (this.lastByte === 0x0a) {
|
|
22
|
-
return done();
|
|
23
|
-
}
|
|
24
|
-
if (this.lastByte === 0x0d) {
|
|
25
|
-
this.push(Buffer.from('\n'));
|
|
26
|
-
return done();
|
|
27
|
-
}
|
|
28
|
-
this.push(Buffer.from('\r\n'));
|
|
29
|
-
return done();
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
module.exports = LastNewline;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const stream = require('stream');
|
|
4
|
-
const Transform = stream.Transform;
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Ensures that only <LF> is used for linebreaks
|
|
8
|
-
*
|
|
9
|
-
* @param {Object} options Stream options
|
|
10
|
-
*/
|
|
11
|
-
class LeWindows extends Transform {
|
|
12
|
-
constructor(options) {
|
|
13
|
-
super(options);
|
|
14
|
-
// init Transform
|
|
15
|
-
this.options = options || {};
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Escapes dots
|
|
20
|
-
*/
|
|
21
|
-
_transform(chunk, encoding, done) {
|
|
22
|
-
let buf;
|
|
23
|
-
let lastPos = 0;
|
|
24
|
-
|
|
25
|
-
for (let i = 0, len = chunk.length; i < len; i++) {
|
|
26
|
-
if (chunk[i] === 0x0d) {
|
|
27
|
-
// \n
|
|
28
|
-
buf = chunk.slice(lastPos, i);
|
|
29
|
-
lastPos = i + 1;
|
|
30
|
-
this.push(buf);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
if (lastPos && lastPos < chunk.length) {
|
|
34
|
-
buf = chunk.slice(lastPos);
|
|
35
|
-
this.push(buf);
|
|
36
|
-
} else if (!lastPos) {
|
|
37
|
-
this.push(chunk);
|
|
38
|
-
}
|
|
39
|
-
done();
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
module.exports = LeWindows;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const stream = require('stream');
|
|
4
|
-
const Transform = stream.Transform;
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Ensures that only <CR><LF> sequences are used for linebreaks
|
|
8
|
-
*
|
|
9
|
-
* @param {Object} options Stream options
|
|
10
|
-
*/
|
|
11
|
-
class LeWindows extends Transform {
|
|
12
|
-
constructor(options) {
|
|
13
|
-
super(options);
|
|
14
|
-
// init Transform
|
|
15
|
-
this.options = options || {};
|
|
16
|
-
this.lastByte = false;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Escapes dots
|
|
21
|
-
*/
|
|
22
|
-
_transform(chunk, encoding, done) {
|
|
23
|
-
let buf;
|
|
24
|
-
let lastPos = 0;
|
|
25
|
-
|
|
26
|
-
for (let i = 0, len = chunk.length; i < len; i++) {
|
|
27
|
-
if (chunk[i] === 0x0a) {
|
|
28
|
-
// \n
|
|
29
|
-
if ((i && chunk[i - 1] !== 0x0d) || (!i && this.lastByte !== 0x0d)) {
|
|
30
|
-
if (i > lastPos) {
|
|
31
|
-
buf = chunk.slice(lastPos, i);
|
|
32
|
-
this.push(buf);
|
|
33
|
-
}
|
|
34
|
-
this.push(Buffer.from('\r\n'));
|
|
35
|
-
lastPos = i + 1;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
if (lastPos && lastPos < chunk.length) {
|
|
41
|
-
buf = chunk.slice(lastPos);
|
|
42
|
-
this.push(buf);
|
|
43
|
-
} else if (!lastPos) {
|
|
44
|
-
this.push(chunk);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
this.lastByte = chunk[chunk.length - 1];
|
|
48
|
-
done();
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
module.exports = LeWindows;
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const Mailer = require('./mailer');
|
|
4
|
-
const shared = require('./shared');
|
|
5
|
-
const SMTPPool = require('./smtp-pool');
|
|
6
|
-
const SMTPTransport = require('./smtp-transport');
|
|
7
|
-
const SendmailTransport = require('./sendmail-transport');
|
|
8
|
-
const StreamTransport = require('./stream-transport');
|
|
9
|
-
const JSONTransport = require('./json-transport');
|
|
10
|
-
const SESTransport = require('./ses-transport');
|
|
11
|
-
const nmfetch = require('./fetch');
|
|
12
|
-
const packageData = require('../package.json');
|
|
13
|
-
|
|
14
|
-
const ETHEREAL_API = (process.env.ETHEREAL_API || 'https://api.nodemailer.com').replace(/\/+$/, '');
|
|
15
|
-
const ETHEREAL_WEB = (process.env.ETHEREAL_WEB || 'https://ethereal.email').replace(/\/+$/, '');
|
|
16
|
-
const ETHEREAL_API_KEY = (process.env.ETHEREAL_API_KEY || '').replace(/\s*/g, '') || null;
|
|
17
|
-
const ETHEREAL_CACHE = ['true', 'yes', 'y', '1'].includes((process.env.ETHEREAL_CACHE || 'yes').toString().trim().toLowerCase());
|
|
18
|
-
|
|
19
|
-
let testAccount = false;
|
|
20
|
-
|
|
21
|
-
module.exports.createTransport = function (transporter, defaults) {
|
|
22
|
-
let urlConfig;
|
|
23
|
-
let options;
|
|
24
|
-
let mailer;
|
|
25
|
-
|
|
26
|
-
if (
|
|
27
|
-
// provided transporter is a configuration object, not transporter plugin
|
|
28
|
-
(typeof transporter === 'object' && typeof transporter.send !== 'function') ||
|
|
29
|
-
// provided transporter looks like a connection url
|
|
30
|
-
(typeof transporter === 'string' && /^(smtps?|direct):/i.test(transporter))
|
|
31
|
-
) {
|
|
32
|
-
if ((urlConfig = typeof transporter === 'string' ? transporter : transporter.url)) {
|
|
33
|
-
// parse a configuration URL into configuration options
|
|
34
|
-
options = shared.parseConnectionUrl(urlConfig);
|
|
35
|
-
} else {
|
|
36
|
-
options = transporter;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
if (options.pool) {
|
|
40
|
-
transporter = new SMTPPool(options);
|
|
41
|
-
} else if (options.sendmail) {
|
|
42
|
-
transporter = new SendmailTransport(options);
|
|
43
|
-
} else if (options.streamTransport) {
|
|
44
|
-
transporter = new StreamTransport(options);
|
|
45
|
-
} else if (options.jsonTransport) {
|
|
46
|
-
transporter = new JSONTransport(options);
|
|
47
|
-
} else if (options.SES) {
|
|
48
|
-
if (options.SES.ses && options.SES.aws) {
|
|
49
|
-
let error = new Error(
|
|
50
|
-
'Using legacy SES configuration, expecting @aws-sdk/client-sesv2, see https://nodemailer.com/transports/ses/'
|
|
51
|
-
);
|
|
52
|
-
error.code = 'LegacyConfig';
|
|
53
|
-
throw error;
|
|
54
|
-
}
|
|
55
|
-
transporter = new SESTransport(options);
|
|
56
|
-
} else {
|
|
57
|
-
transporter = new SMTPTransport(options);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
mailer = new Mailer(transporter, options, defaults);
|
|
62
|
-
|
|
63
|
-
return mailer;
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
module.exports.createTestAccount = function (apiUrl, callback) {
|
|
67
|
-
let promise;
|
|
68
|
-
|
|
69
|
-
if (!callback && typeof apiUrl === 'function') {
|
|
70
|
-
callback = apiUrl;
|
|
71
|
-
apiUrl = false;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
if (!callback) {
|
|
75
|
-
promise = new Promise((resolve, reject) => {
|
|
76
|
-
callback = shared.callbackPromise(resolve, reject);
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
if (ETHEREAL_CACHE && testAccount) {
|
|
81
|
-
setImmediate(() => callback(null, testAccount));
|
|
82
|
-
return promise;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
apiUrl = apiUrl || ETHEREAL_API;
|
|
86
|
-
|
|
87
|
-
let chunks = [];
|
|
88
|
-
let chunklen = 0;
|
|
89
|
-
|
|
90
|
-
let requestHeaders = {};
|
|
91
|
-
let requestBody = {
|
|
92
|
-
requestor: packageData.name,
|
|
93
|
-
version: packageData.version
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
if (ETHEREAL_API_KEY) {
|
|
97
|
-
requestHeaders.Authorization = 'Bearer ' + ETHEREAL_API_KEY;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
let req = nmfetch(apiUrl + '/user', {
|
|
101
|
-
contentType: 'application/json',
|
|
102
|
-
method: 'POST',
|
|
103
|
-
headers: requestHeaders,
|
|
104
|
-
body: Buffer.from(JSON.stringify(requestBody))
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
req.on('readable', () => {
|
|
108
|
-
let chunk;
|
|
109
|
-
while ((chunk = req.read()) !== null) {
|
|
110
|
-
chunks.push(chunk);
|
|
111
|
-
chunklen += chunk.length;
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
req.once('error', err => callback(err));
|
|
116
|
-
|
|
117
|
-
req.once('end', () => {
|
|
118
|
-
let res = Buffer.concat(chunks, chunklen);
|
|
119
|
-
let data;
|
|
120
|
-
let err;
|
|
121
|
-
try {
|
|
122
|
-
data = JSON.parse(res.toString());
|
|
123
|
-
} catch (E) {
|
|
124
|
-
err = E;
|
|
125
|
-
}
|
|
126
|
-
if (err) {
|
|
127
|
-
return callback(err);
|
|
128
|
-
}
|
|
129
|
-
if (data.status !== 'success' || data.error) {
|
|
130
|
-
return callback(new Error(data.error || 'Request failed'));
|
|
131
|
-
}
|
|
132
|
-
delete data.status;
|
|
133
|
-
testAccount = data;
|
|
134
|
-
callback(null, testAccount);
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
return promise;
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
module.exports.getTestMessageUrl = function (info) {
|
|
141
|
-
if (!info || !info.response) {
|
|
142
|
-
return false;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
let infoProps = new Map();
|
|
146
|
-
info.response.replace(/\[([^\]]+)\]$/, (m, props) => {
|
|
147
|
-
props.replace(/\b([A-Z0-9]+)=([^\s]+)/g, (m, key, value) => {
|
|
148
|
-
infoProps.set(key, value);
|
|
149
|
-
});
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
if (infoProps.has('STATUS') && infoProps.has('MSGID')) {
|
|
153
|
-
return (testAccount.web || ETHEREAL_WEB) + '/message/' + infoProps.get('MSGID');
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
return false;
|
|
157
|
-
};
|