@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,210 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const spawn = require('child_process').spawn;
|
|
4
|
-
const packageData = require('../../package.json');
|
|
5
|
-
const shared = require('../shared');
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Generates a Transport object for Sendmail
|
|
9
|
-
*
|
|
10
|
-
* Possible options can be the following:
|
|
11
|
-
*
|
|
12
|
-
* * **path** optional path to sendmail binary
|
|
13
|
-
* * **newline** either 'windows' or 'unix'
|
|
14
|
-
* * **args** an array of arguments for the sendmail binary
|
|
15
|
-
*
|
|
16
|
-
* @constructor
|
|
17
|
-
* @param {Object} optional config parameter for Sendmail
|
|
18
|
-
*/
|
|
19
|
-
class SendmailTransport {
|
|
20
|
-
constructor(options) {
|
|
21
|
-
options = options || {};
|
|
22
|
-
|
|
23
|
-
// use a reference to spawn for mocking purposes
|
|
24
|
-
this._spawn = spawn;
|
|
25
|
-
|
|
26
|
-
this.options = options || {};
|
|
27
|
-
|
|
28
|
-
this.name = 'Sendmail';
|
|
29
|
-
this.version = packageData.version;
|
|
30
|
-
|
|
31
|
-
this.path = 'sendmail';
|
|
32
|
-
this.args = false;
|
|
33
|
-
this.winbreak = false;
|
|
34
|
-
|
|
35
|
-
this.logger = shared.getLogger(this.options, {
|
|
36
|
-
component: this.options.component || 'sendmail'
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
if (options) {
|
|
40
|
-
if (typeof options === 'string') {
|
|
41
|
-
this.path = options;
|
|
42
|
-
} else if (typeof options === 'object') {
|
|
43
|
-
if (options.path) {
|
|
44
|
-
this.path = options.path;
|
|
45
|
-
}
|
|
46
|
-
if (Array.isArray(options.args)) {
|
|
47
|
-
this.args = options.args;
|
|
48
|
-
}
|
|
49
|
-
this.winbreak = ['win', 'windows', 'dos', '\r\n'].includes((options.newline || '').toString().toLowerCase());
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* <p>Compiles a mailcomposer message and forwards it to handler that sends it.</p>
|
|
56
|
-
*
|
|
57
|
-
* @param {Object} emailMessage MailComposer object
|
|
58
|
-
* @param {Function} callback Callback function to run when the sending is completed
|
|
59
|
-
*/
|
|
60
|
-
send(mail, done) {
|
|
61
|
-
// Sendmail strips this header line by itself
|
|
62
|
-
mail.message.keepBcc = true;
|
|
63
|
-
|
|
64
|
-
let envelope = mail.data.envelope || mail.message.getEnvelope();
|
|
65
|
-
let messageId = mail.message.messageId();
|
|
66
|
-
let args;
|
|
67
|
-
let sendmail;
|
|
68
|
-
let returned;
|
|
69
|
-
|
|
70
|
-
const hasInvalidAddresses = []
|
|
71
|
-
.concat(envelope.from || [])
|
|
72
|
-
.concat(envelope.to || [])
|
|
73
|
-
.some(addr => /^-/.test(addr));
|
|
74
|
-
if (hasInvalidAddresses) {
|
|
75
|
-
return done(new Error('Can not send mail. Invalid envelope addresses.'));
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
if (this.args) {
|
|
79
|
-
// force -i to keep single dots
|
|
80
|
-
args = ['-i'].concat(this.args).concat(envelope.to);
|
|
81
|
-
} else {
|
|
82
|
-
args = ['-i'].concat(envelope.from ? ['-f', envelope.from] : []).concat(envelope.to);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
let callback = err => {
|
|
86
|
-
if (returned) {
|
|
87
|
-
// ignore any additional responses, already done
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
returned = true;
|
|
91
|
-
if (typeof done === 'function') {
|
|
92
|
-
if (err) {
|
|
93
|
-
return done(err);
|
|
94
|
-
} else {
|
|
95
|
-
return done(null, {
|
|
96
|
-
envelope: mail.data.envelope || mail.message.getEnvelope(),
|
|
97
|
-
messageId,
|
|
98
|
-
response: 'Messages queued for delivery'
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
try {
|
|
105
|
-
sendmail = this._spawn(this.path, args);
|
|
106
|
-
} catch (E) {
|
|
107
|
-
this.logger.error(
|
|
108
|
-
{
|
|
109
|
-
err: E,
|
|
110
|
-
tnx: 'spawn',
|
|
111
|
-
messageId
|
|
112
|
-
},
|
|
113
|
-
'Error occurred while spawning sendmail. %s',
|
|
114
|
-
E.message
|
|
115
|
-
);
|
|
116
|
-
return callback(E);
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
if (sendmail) {
|
|
120
|
-
sendmail.on('error', err => {
|
|
121
|
-
this.logger.error(
|
|
122
|
-
{
|
|
123
|
-
err,
|
|
124
|
-
tnx: 'spawn',
|
|
125
|
-
messageId
|
|
126
|
-
},
|
|
127
|
-
'Error occurred when sending message %s. %s',
|
|
128
|
-
messageId,
|
|
129
|
-
err.message
|
|
130
|
-
);
|
|
131
|
-
callback(err);
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
sendmail.once('exit', code => {
|
|
135
|
-
if (!code) {
|
|
136
|
-
return callback();
|
|
137
|
-
}
|
|
138
|
-
let err;
|
|
139
|
-
if (code === 127) {
|
|
140
|
-
err = new Error('Sendmail command not found, process exited with code ' + code);
|
|
141
|
-
} else {
|
|
142
|
-
err = new Error('Sendmail exited with code ' + code);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
this.logger.error(
|
|
146
|
-
{
|
|
147
|
-
err,
|
|
148
|
-
tnx: 'stdin',
|
|
149
|
-
messageId
|
|
150
|
-
},
|
|
151
|
-
'Error sending message %s to sendmail. %s',
|
|
152
|
-
messageId,
|
|
153
|
-
err.message
|
|
154
|
-
);
|
|
155
|
-
callback(err);
|
|
156
|
-
});
|
|
157
|
-
sendmail.once('close', callback);
|
|
158
|
-
|
|
159
|
-
sendmail.stdin.on('error', err => {
|
|
160
|
-
this.logger.error(
|
|
161
|
-
{
|
|
162
|
-
err,
|
|
163
|
-
tnx: 'stdin',
|
|
164
|
-
messageId
|
|
165
|
-
},
|
|
166
|
-
'Error occurred when piping message %s to sendmail. %s',
|
|
167
|
-
messageId,
|
|
168
|
-
err.message
|
|
169
|
-
);
|
|
170
|
-
callback(err);
|
|
171
|
-
});
|
|
172
|
-
|
|
173
|
-
let recipients = [].concat(envelope.to || []);
|
|
174
|
-
if (recipients.length > 3) {
|
|
175
|
-
recipients.push('...and ' + recipients.splice(2).length + ' more');
|
|
176
|
-
}
|
|
177
|
-
this.logger.info(
|
|
178
|
-
{
|
|
179
|
-
tnx: 'send',
|
|
180
|
-
messageId
|
|
181
|
-
},
|
|
182
|
-
'Sending message %s to <%s>',
|
|
183
|
-
messageId,
|
|
184
|
-
recipients.join(', ')
|
|
185
|
-
);
|
|
186
|
-
|
|
187
|
-
let sourceStream = mail.message.createReadStream();
|
|
188
|
-
sourceStream.once('error', err => {
|
|
189
|
-
this.logger.error(
|
|
190
|
-
{
|
|
191
|
-
err,
|
|
192
|
-
tnx: 'stdin',
|
|
193
|
-
messageId
|
|
194
|
-
},
|
|
195
|
-
'Error occurred when generating message %s. %s',
|
|
196
|
-
messageId,
|
|
197
|
-
err.message
|
|
198
|
-
);
|
|
199
|
-
sendmail.kill('SIGINT'); // do not deliver the message
|
|
200
|
-
callback(err);
|
|
201
|
-
});
|
|
202
|
-
|
|
203
|
-
sourceStream.pipe(sendmail.stdin);
|
|
204
|
-
} else {
|
|
205
|
-
return callback(new Error('sendmail was not found'));
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
module.exports = SendmailTransport;
|
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const EventEmitter = require('events');
|
|
4
|
-
const packageData = require('../../package.json');
|
|
5
|
-
const shared = require('../shared');
|
|
6
|
-
const LeWindows = require('../mime-node/le-windows');
|
|
7
|
-
const MimeNode = require('../mime-node');
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Generates a Transport object for AWS SES
|
|
11
|
-
*
|
|
12
|
-
* @constructor
|
|
13
|
-
* @param {Object} optional config parameter
|
|
14
|
-
*/
|
|
15
|
-
class SESTransport extends EventEmitter {
|
|
16
|
-
constructor(options) {
|
|
17
|
-
super();
|
|
18
|
-
options = options || {};
|
|
19
|
-
|
|
20
|
-
this.options = options || {};
|
|
21
|
-
this.ses = this.options.SES;
|
|
22
|
-
|
|
23
|
-
this.name = 'SESTransport';
|
|
24
|
-
this.version = packageData.version;
|
|
25
|
-
|
|
26
|
-
this.logger = shared.getLogger(this.options, {
|
|
27
|
-
component: this.options.component || 'ses-transport'
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
getRegion(cb) {
|
|
32
|
-
if (this.ses.sesClient.config && typeof this.ses.sesClient.config.region === 'function') {
|
|
33
|
-
// promise
|
|
34
|
-
return this.ses.sesClient.config
|
|
35
|
-
.region()
|
|
36
|
-
.then(region => cb(null, region))
|
|
37
|
-
.catch(err => cb(err));
|
|
38
|
-
}
|
|
39
|
-
return cb(null, false);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Compiles a mailcomposer message and forwards it to SES
|
|
44
|
-
*
|
|
45
|
-
* @param {Object} emailMessage MailComposer object
|
|
46
|
-
* @param {Function} callback Callback function to run when the sending is completed
|
|
47
|
-
*/
|
|
48
|
-
send(mail, callback) {
|
|
49
|
-
let statObject = {
|
|
50
|
-
ts: Date.now(),
|
|
51
|
-
pending: true
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
let fromHeader = mail.message._headers.find(header => /^from$/i.test(header.key));
|
|
55
|
-
if (fromHeader) {
|
|
56
|
-
let mimeNode = new MimeNode('text/plain');
|
|
57
|
-
fromHeader = mimeNode._convertAddresses(mimeNode._parseAddresses(fromHeader.value));
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
let envelope = mail.data.envelope || mail.message.getEnvelope();
|
|
61
|
-
let messageId = mail.message.messageId();
|
|
62
|
-
|
|
63
|
-
let recipients = [].concat(envelope.to || []);
|
|
64
|
-
if (recipients.length > 3) {
|
|
65
|
-
recipients.push('...and ' + recipients.splice(2).length + ' more');
|
|
66
|
-
}
|
|
67
|
-
this.logger.info(
|
|
68
|
-
{
|
|
69
|
-
tnx: 'send',
|
|
70
|
-
messageId
|
|
71
|
-
},
|
|
72
|
-
'Sending message %s to <%s>',
|
|
73
|
-
messageId,
|
|
74
|
-
recipients.join(', ')
|
|
75
|
-
);
|
|
76
|
-
|
|
77
|
-
let getRawMessage = next => {
|
|
78
|
-
// do not use Message-ID and Date in DKIM signature
|
|
79
|
-
if (!mail.data._dkim) {
|
|
80
|
-
mail.data._dkim = {};
|
|
81
|
-
}
|
|
82
|
-
if (mail.data._dkim.skipFields && typeof mail.data._dkim.skipFields === 'string') {
|
|
83
|
-
mail.data._dkim.skipFields += ':date:message-id';
|
|
84
|
-
} else {
|
|
85
|
-
mail.data._dkim.skipFields = 'date:message-id';
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
let sourceStream = mail.message.createReadStream();
|
|
89
|
-
let stream = sourceStream.pipe(new LeWindows());
|
|
90
|
-
let chunks = [];
|
|
91
|
-
let chunklen = 0;
|
|
92
|
-
|
|
93
|
-
stream.on('readable', () => {
|
|
94
|
-
let chunk;
|
|
95
|
-
while ((chunk = stream.read()) !== null) {
|
|
96
|
-
chunks.push(chunk);
|
|
97
|
-
chunklen += chunk.length;
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
sourceStream.once('error', err => stream.emit('error', err));
|
|
102
|
-
|
|
103
|
-
stream.once('error', err => {
|
|
104
|
-
next(err);
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
stream.once('end', () => next(null, Buffer.concat(chunks, chunklen)));
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
setImmediate(() =>
|
|
111
|
-
getRawMessage((err, raw) => {
|
|
112
|
-
if (err) {
|
|
113
|
-
this.logger.error(
|
|
114
|
-
{
|
|
115
|
-
err,
|
|
116
|
-
tnx: 'send',
|
|
117
|
-
messageId
|
|
118
|
-
},
|
|
119
|
-
'Failed creating message for %s. %s',
|
|
120
|
-
messageId,
|
|
121
|
-
err.message
|
|
122
|
-
);
|
|
123
|
-
statObject.pending = false;
|
|
124
|
-
return callback(err);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
let sesMessage = {
|
|
128
|
-
Content: {
|
|
129
|
-
Raw: {
|
|
130
|
-
// required
|
|
131
|
-
Data: raw // required
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
FromEmailAddress: fromHeader ? fromHeader : envelope.from,
|
|
135
|
-
Destination: {
|
|
136
|
-
ToAddresses: envelope.to
|
|
137
|
-
}
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
Object.keys(mail.data.ses || {}).forEach(key => {
|
|
141
|
-
sesMessage[key] = mail.data.ses[key];
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
this.getRegion((err, region) => {
|
|
145
|
-
if (err || !region) {
|
|
146
|
-
region = 'us-east-1';
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
const command = new this.ses.SendEmailCommand(sesMessage);
|
|
150
|
-
const sendPromise = this.ses.sesClient.send(command);
|
|
151
|
-
|
|
152
|
-
sendPromise
|
|
153
|
-
.then(data => {
|
|
154
|
-
if (region === 'us-east-1') {
|
|
155
|
-
region = 'email';
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
statObject.pending = true;
|
|
159
|
-
callback(null, {
|
|
160
|
-
envelope: {
|
|
161
|
-
from: envelope.from,
|
|
162
|
-
to: envelope.to
|
|
163
|
-
},
|
|
164
|
-
messageId: '<' + data.MessageId + (!/@/.test(data.MessageId) ? '@' + region + '.amazonses.com' : '') + '>',
|
|
165
|
-
response: data.MessageId,
|
|
166
|
-
raw
|
|
167
|
-
});
|
|
168
|
-
})
|
|
169
|
-
.catch(err => {
|
|
170
|
-
this.logger.error(
|
|
171
|
-
{
|
|
172
|
-
err,
|
|
173
|
-
tnx: 'send'
|
|
174
|
-
},
|
|
175
|
-
'Send error for %s: %s',
|
|
176
|
-
messageId,
|
|
177
|
-
err.message
|
|
178
|
-
);
|
|
179
|
-
statObject.pending = false;
|
|
180
|
-
callback(err);
|
|
181
|
-
});
|
|
182
|
-
});
|
|
183
|
-
})
|
|
184
|
-
);
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
* Verifies SES configuration
|
|
189
|
-
*
|
|
190
|
-
* @param {Function} callback Callback function
|
|
191
|
-
*/
|
|
192
|
-
verify(callback) {
|
|
193
|
-
let promise;
|
|
194
|
-
if (!callback) {
|
|
195
|
-
promise = new Promise((resolve, reject) => {
|
|
196
|
-
callback = shared.callbackPromise(resolve, reject);
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
const cb = err => {
|
|
201
|
-
if (err && !['InvalidParameterValue', 'MessageRejected'].includes(err.code || err.Code || err.name)) {
|
|
202
|
-
return callback(err);
|
|
203
|
-
}
|
|
204
|
-
return callback(null, true);
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
const sesMessage = {
|
|
208
|
-
Content: {
|
|
209
|
-
Raw: {
|
|
210
|
-
Data: Buffer.from('From: <invalid@invalid>\r\nTo: <invalid@invalid>\r\n Subject: Invalid\r\n\r\nInvalid')
|
|
211
|
-
}
|
|
212
|
-
},
|
|
213
|
-
FromEmailAddress: 'invalid@invalid',
|
|
214
|
-
Destination: {
|
|
215
|
-
ToAddresses: ['invalid@invalid']
|
|
216
|
-
}
|
|
217
|
-
};
|
|
218
|
-
|
|
219
|
-
this.getRegion((err, region) => {
|
|
220
|
-
if (err || !region) {
|
|
221
|
-
region = 'us-east-1';
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
const command = new this.ses.SendEmailCommand(sesMessage);
|
|
225
|
-
const sendPromise = this.ses.sesClient.send(command);
|
|
226
|
-
|
|
227
|
-
sendPromise.then(data => cb(null, data)).catch(err => cb(err));
|
|
228
|
-
});
|
|
229
|
-
|
|
230
|
-
return promise;
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
module.exports = SESTransport;
|