@bobfrankston/mailx 1.0.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.
- package/.tswalk.json +3366 -0
- package/README.md +160 -0
- package/bin/mailx.js +58 -0
- package/client/app.js +431 -0
- package/client/components/folder-tree.js +286 -0
- package/client/components/message-list.js +230 -0
- package/client/components/message-viewer.js +161 -0
- package/client/compose/compose.css +197 -0
- package/client/compose/compose.html +45 -0
- package/client/compose/compose.js +335 -0
- package/client/favicon.svg +11 -0
- package/client/index.html +100 -0
- package/client/lib/api-client.js +67 -0
- package/client/package.json +9 -0
- package/client/styles/components.css +361 -0
- package/client/styles/layout.css +69 -0
- package/launch.ps1 +20 -0
- package/launcher/Cargo.lock +3167 -0
- package/launcher/Cargo.toml +13 -0
- package/launcher/build.cmd +4 -0
- package/launcher/build.rs +8 -0
- package/launcher/mailx.ico +0 -0
- package/launcher/release.cmd +4 -0
- package/launcher/src/main.rs +371 -0
- package/mailx.cmd +2 -0
- package/mailx.db +0 -0
- package/mailx.db-shm +0 -0
- package/mailx.db-wal +0 -0
- package/mailx.json +9 -0
- package/package.json +51 -0
- package/packages/mailx-api/index.d.ts +9 -0
- package/packages/mailx-api/index.js +375 -0
- package/packages/mailx-api/node_modules/nodemailer/.ncurc.js +9 -0
- package/packages/mailx-api/node_modules/nodemailer/.prettierignore +8 -0
- package/packages/mailx-api/node_modules/nodemailer/.prettierrc +12 -0
- package/packages/mailx-api/node_modules/nodemailer/.prettierrc.js +10 -0
- package/packages/mailx-api/node_modules/nodemailer/.release-please-config.json +9 -0
- package/packages/mailx-api/node_modules/nodemailer/LICENSE +16 -0
- package/packages/mailx-api/node_modules/nodemailer/README.md +86 -0
- package/packages/mailx-api/node_modules/nodemailer/SECURITY.txt +22 -0
- package/packages/mailx-api/node_modules/nodemailer/eslint.config.js +88 -0
- package/packages/mailx-api/node_modules/nodemailer/lib/addressparser/index.js +383 -0
- package/packages/mailx-api/node_modules/nodemailer/lib/base64/index.js +139 -0
- package/packages/mailx-api/node_modules/nodemailer/lib/dkim/index.js +253 -0
- package/packages/mailx-api/node_modules/nodemailer/lib/dkim/message-parser.js +155 -0
- package/packages/mailx-api/node_modules/nodemailer/lib/dkim/relaxed-body.js +154 -0
- package/packages/mailx-api/node_modules/nodemailer/lib/dkim/sign.js +117 -0
- package/packages/mailx-api/node_modules/nodemailer/lib/fetch/cookies.js +281 -0
- package/packages/mailx-api/node_modules/nodemailer/lib/fetch/index.js +280 -0
- package/packages/mailx-api/node_modules/nodemailer/lib/json-transport/index.js +82 -0
- package/packages/mailx-api/node_modules/nodemailer/lib/mail-composer/index.js +629 -0
- package/packages/mailx-api/node_modules/nodemailer/lib/mailer/index.js +441 -0
- package/packages/mailx-api/node_modules/nodemailer/lib/mailer/mail-message.js +316 -0
- package/packages/mailx-api/node_modules/nodemailer/lib/mime-funcs/index.js +625 -0
- package/packages/mailx-api/node_modules/nodemailer/lib/mime-funcs/mime-types.js +2113 -0
- package/packages/mailx-api/node_modules/nodemailer/lib/mime-node/index.js +1316 -0
- package/packages/mailx-api/node_modules/nodemailer/lib/mime-node/last-newline.js +33 -0
- package/packages/mailx-api/node_modules/nodemailer/lib/mime-node/le-unix.js +43 -0
- package/packages/mailx-api/node_modules/nodemailer/lib/mime-node/le-windows.js +52 -0
- package/packages/mailx-api/node_modules/nodemailer/lib/nodemailer.js +157 -0
- package/packages/mailx-api/node_modules/nodemailer/lib/punycode/index.js +460 -0
- package/packages/mailx-api/node_modules/nodemailer/lib/qp/index.js +227 -0
- package/packages/mailx-api/node_modules/nodemailer/lib/sendmail-transport/index.js +210 -0
- package/packages/mailx-api/node_modules/nodemailer/lib/ses-transport/index.js +234 -0
- package/packages/mailx-api/node_modules/nodemailer/lib/shared/index.js +754 -0
- package/packages/mailx-api/node_modules/nodemailer/lib/smtp-connection/data-stream.js +108 -0
- package/packages/mailx-api/node_modules/nodemailer/lib/smtp-connection/http-proxy-client.js +143 -0
- package/packages/mailx-api/node_modules/nodemailer/lib/smtp-connection/index.js +1870 -0
- package/packages/mailx-api/node_modules/nodemailer/lib/smtp-pool/index.js +652 -0
- package/packages/mailx-api/node_modules/nodemailer/lib/smtp-pool/pool-resource.js +259 -0
- package/packages/mailx-api/node_modules/nodemailer/lib/smtp-transport/index.js +421 -0
- package/packages/mailx-api/node_modules/nodemailer/lib/stream-transport/index.js +135 -0
- package/packages/mailx-api/node_modules/nodemailer/lib/well-known/index.js +47 -0
- package/packages/mailx-api/node_modules/nodemailer/lib/well-known/services.json +611 -0
- package/packages/mailx-api/node_modules/nodemailer/lib/xoauth2/index.js +427 -0
- package/packages/mailx-api/node_modules/nodemailer/package.json +47 -0
- package/packages/mailx-api/package.json +24 -0
- package/packages/mailx-api/tsconfig.tsbuildinfo +1 -0
- package/packages/mailx-compose/index.d.ts +21 -0
- package/packages/mailx-compose/index.js +61 -0
- package/packages/mailx-compose/package.json +14 -0
- package/packages/mailx-imap/index.d.ts +105 -0
- package/packages/mailx-imap/index.js +1026 -0
- package/packages/mailx-imap/node_modules/nodemailer/.ncurc.js +9 -0
- package/packages/mailx-imap/node_modules/nodemailer/.prettierignore +8 -0
- package/packages/mailx-imap/node_modules/nodemailer/.prettierrc +12 -0
- package/packages/mailx-imap/node_modules/nodemailer/.prettierrc.js +10 -0
- package/packages/mailx-imap/node_modules/nodemailer/.release-please-config.json +9 -0
- package/packages/mailx-imap/node_modules/nodemailer/LICENSE +16 -0
- package/packages/mailx-imap/node_modules/nodemailer/README.md +86 -0
- package/packages/mailx-imap/node_modules/nodemailer/SECURITY.txt +22 -0
- package/packages/mailx-imap/node_modules/nodemailer/eslint.config.js +88 -0
- package/packages/mailx-imap/node_modules/nodemailer/lib/addressparser/index.js +383 -0
- package/packages/mailx-imap/node_modules/nodemailer/lib/base64/index.js +139 -0
- package/packages/mailx-imap/node_modules/nodemailer/lib/dkim/index.js +253 -0
- package/packages/mailx-imap/node_modules/nodemailer/lib/dkim/message-parser.js +155 -0
- package/packages/mailx-imap/node_modules/nodemailer/lib/dkim/relaxed-body.js +154 -0
- package/packages/mailx-imap/node_modules/nodemailer/lib/dkim/sign.js +117 -0
- package/packages/mailx-imap/node_modules/nodemailer/lib/fetch/cookies.js +281 -0
- package/packages/mailx-imap/node_modules/nodemailer/lib/fetch/index.js +280 -0
- package/packages/mailx-imap/node_modules/nodemailer/lib/json-transport/index.js +82 -0
- package/packages/mailx-imap/node_modules/nodemailer/lib/mail-composer/index.js +629 -0
- package/packages/mailx-imap/node_modules/nodemailer/lib/mailer/index.js +441 -0
- package/packages/mailx-imap/node_modules/nodemailer/lib/mailer/mail-message.js +316 -0
- package/packages/mailx-imap/node_modules/nodemailer/lib/mime-funcs/index.js +625 -0
- package/packages/mailx-imap/node_modules/nodemailer/lib/mime-funcs/mime-types.js +2113 -0
- package/packages/mailx-imap/node_modules/nodemailer/lib/mime-node/index.js +1316 -0
- package/packages/mailx-imap/node_modules/nodemailer/lib/mime-node/last-newline.js +33 -0
- package/packages/mailx-imap/node_modules/nodemailer/lib/mime-node/le-unix.js +43 -0
- package/packages/mailx-imap/node_modules/nodemailer/lib/mime-node/le-windows.js +52 -0
- package/packages/mailx-imap/node_modules/nodemailer/lib/nodemailer.js +157 -0
- package/packages/mailx-imap/node_modules/nodemailer/lib/punycode/index.js +460 -0
- package/packages/mailx-imap/node_modules/nodemailer/lib/qp/index.js +227 -0
- package/packages/mailx-imap/node_modules/nodemailer/lib/sendmail-transport/index.js +210 -0
- package/packages/mailx-imap/node_modules/nodemailer/lib/ses-transport/index.js +234 -0
- package/packages/mailx-imap/node_modules/nodemailer/lib/shared/index.js +754 -0
- package/packages/mailx-imap/node_modules/nodemailer/lib/smtp-connection/data-stream.js +108 -0
- package/packages/mailx-imap/node_modules/nodemailer/lib/smtp-connection/http-proxy-client.js +143 -0
- package/packages/mailx-imap/node_modules/nodemailer/lib/smtp-connection/index.js +1870 -0
- package/packages/mailx-imap/node_modules/nodemailer/lib/smtp-pool/index.js +652 -0
- package/packages/mailx-imap/node_modules/nodemailer/lib/smtp-pool/pool-resource.js +259 -0
- package/packages/mailx-imap/node_modules/nodemailer/lib/smtp-transport/index.js +421 -0
- package/packages/mailx-imap/node_modules/nodemailer/lib/stream-transport/index.js +135 -0
- package/packages/mailx-imap/node_modules/nodemailer/lib/well-known/index.js +47 -0
- package/packages/mailx-imap/node_modules/nodemailer/lib/well-known/services.json +611 -0
- package/packages/mailx-imap/node_modules/nodemailer/lib/xoauth2/index.js +427 -0
- package/packages/mailx-imap/node_modules/nodemailer/package.json +47 -0
- package/packages/mailx-imap/package.json +19 -0
- package/packages/mailx-imap/tsconfig.tsbuildinfo +1 -0
- package/packages/mailx-send/README.md +217 -0
- package/packages/mailx-send/cli-queue.d.ts +11 -0
- package/packages/mailx-send/cli-queue.js +59 -0
- package/packages/mailx-send/cli-send.d.ts +17 -0
- package/packages/mailx-send/cli-send.js +75 -0
- package/packages/mailx-send/cli.d.ts +22 -0
- package/packages/mailx-send/cli.js +115 -0
- package/packages/mailx-send/index.d.ts +77 -0
- package/packages/mailx-send/index.js +264 -0
- package/packages/mailx-send/mailsend/README.md +133 -0
- package/packages/mailx-send/mailsend/cli.d.ts +12 -0
- package/packages/mailx-send/mailsend/cli.js +70 -0
- package/packages/mailx-send/mailsend/index.d.ts +77 -0
- package/packages/mailx-send/mailsend/index.js +264 -0
- package/packages/mailx-send/mailsend/node_modules/.package-lock.json +49 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/LICENSE +21 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/README.md +15 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/assert/strict.d.ts +111 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/assert.d.ts +1078 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/async_hooks.d.ts +603 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/buffer.buffer.d.ts +472 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/buffer.d.ts +1934 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/child_process.d.ts +1476 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/cluster.d.ts +578 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/compatibility/disposable.d.ts +14 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/compatibility/index.d.ts +9 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/compatibility/indexable.d.ts +20 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/compatibility/iterators.d.ts +20 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/console.d.ts +452 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/constants.d.ts +21 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/crypto.d.ts +4545 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/dgram.d.ts +600 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/diagnostics_channel.d.ts +578 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/dns/promises.d.ts +503 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/dns.d.ts +923 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/domain.d.ts +170 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/events.d.ts +976 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/fs/promises.d.ts +1295 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/fs.d.ts +4461 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/globals.d.ts +172 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/globals.typedarray.d.ts +38 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/http.d.ts +2089 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/http2.d.ts +2644 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/https.d.ts +579 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/index.d.ts +97 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/inspector.d.ts +253 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/inspector.generated.d.ts +4052 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/module.d.ts +891 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/net.d.ts +1057 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/os.d.ts +506 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/package.json +145 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/path.d.ts +200 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/perf_hooks.d.ts +968 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/process.d.ts +2084 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/punycode.d.ts +117 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/querystring.d.ts +152 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/readline/promises.d.ts +161 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/readline.d.ts +594 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/repl.d.ts +428 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/sea.d.ts +153 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/sqlite.d.ts +721 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/stream/consumers.d.ts +38 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/stream/promises.d.ts +90 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/stream/web.d.ts +622 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/stream.d.ts +1664 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/string_decoder.d.ts +67 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/test.d.ts +2163 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/timers/promises.d.ts +108 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/timers.d.ts +287 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/tls.d.ts +1319 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/trace_events.d.ts +197 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +468 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +34 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/ts5.6/index.d.ts +97 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/tty.d.ts +208 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/url.d.ts +984 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/util.d.ts +2606 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/v8.d.ts +920 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/vm.d.ts +1000 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/wasi.d.ts +181 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/web-globals/abortcontroller.d.ts +34 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/web-globals/events.d.ts +97 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/web-globals/fetch.d.ts +55 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/web-globals/navigator.d.ts +22 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/web-globals/storage.d.ts +24 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/worker_threads.d.ts +784 -0
- package/packages/mailx-send/mailsend/node_modules/@types/node/zlib.d.ts +747 -0
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/LICENSE +21 -0
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/README.md +15 -0
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/index.d.ts +82 -0
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/addressparser/index.d.ts +31 -0
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/base64/index.d.ts +22 -0
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/dkim/index.d.ts +45 -0
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/dkim/message-parser.d.ts +75 -0
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/dkim/relaxed-body.d.ts +75 -0
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/dkim/sign.d.ts +21 -0
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/fetch/cookies.d.ts +54 -0
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/fetch/index.d.ts +38 -0
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/json-transport/index.d.ts +53 -0
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/mail-composer/index.d.ts +25 -0
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/mailer/index.d.ts +283 -0
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/mailer/mail-message.d.ts +32 -0
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/mime-funcs/index.d.ts +87 -0
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/mime-funcs/mime-types.d.ts +2 -0
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/mime-node/index.d.ts +224 -0
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/mime-node/last-newline.d.ts +9 -0
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/qp/index.d.ts +23 -0
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/sendmail-transport/index.d.ts +53 -0
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/sendmail-transport/le-unix.d.ts +7 -0
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/sendmail-transport/le-windows.d.ts +7 -0
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/ses-transport/index.d.ts +146 -0
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/shared/index.d.ts +58 -0
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/smtp-connection/data-stream.d.ts +11 -0
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/smtp-connection/http-proxy-client.d.ts +16 -0
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/smtp-connection/index.d.ts +270 -0
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/smtp-pool/index.d.ts +93 -0
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/smtp-pool/pool-resource.d.ts +66 -0
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/smtp-transport/index.d.ts +115 -0
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/stream-transport/index.d.ts +59 -0
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/well-known/index.d.ts +6 -0
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/xoauth2/index.d.ts +114 -0
- package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/package.json +38 -0
- package/packages/mailx-send/mailsend/node_modules/nodemailer/.ncurc.js +9 -0
- package/packages/mailx-send/mailsend/node_modules/nodemailer/.prettierignore +8 -0
- package/packages/mailx-send/mailsend/node_modules/nodemailer/.prettierrc +12 -0
- package/packages/mailx-send/mailsend/node_modules/nodemailer/.prettierrc.js +10 -0
- package/packages/mailx-send/mailsend/node_modules/nodemailer/.release-please-config.json +9 -0
- package/packages/mailx-send/mailsend/node_modules/nodemailer/LICENSE +16 -0
- package/packages/mailx-send/mailsend/node_modules/nodemailer/README.md +86 -0
- package/packages/mailx-send/mailsend/node_modules/nodemailer/SECURITY.txt +22 -0
- package/packages/mailx-send/mailsend/node_modules/nodemailer/eslint.config.js +88 -0
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/addressparser/index.js +383 -0
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/base64/index.js +139 -0
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/dkim/index.js +253 -0
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/dkim/message-parser.js +155 -0
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/dkim/relaxed-body.js +154 -0
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/dkim/sign.js +117 -0
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/fetch/cookies.js +281 -0
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/fetch/index.js +280 -0
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/json-transport/index.js +82 -0
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mail-composer/index.js +629 -0
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mailer/index.js +441 -0
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mailer/mail-message.js +316 -0
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mime-funcs/index.js +625 -0
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mime-funcs/mime-types.js +2113 -0
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mime-node/index.js +1316 -0
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mime-node/last-newline.js +33 -0
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mime-node/le-unix.js +43 -0
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mime-node/le-windows.js +52 -0
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/nodemailer.js +157 -0
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/punycode/index.js +460 -0
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/qp/index.js +227 -0
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/sendmail-transport/index.js +210 -0
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/ses-transport/index.js +234 -0
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/shared/index.js +754 -0
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/smtp-connection/data-stream.js +108 -0
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/smtp-connection/http-proxy-client.js +143 -0
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/smtp-connection/index.js +1870 -0
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/smtp-pool/index.js +652 -0
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/smtp-pool/pool-resource.js +259 -0
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/smtp-transport/index.js +421 -0
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/stream-transport/index.js +135 -0
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/well-known/index.js +47 -0
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/well-known/services.json +611 -0
- package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/xoauth2/index.js +427 -0
- package/packages/mailx-send/mailsend/node_modules/nodemailer/package.json +47 -0
- package/packages/mailx-send/mailsend/node_modules/undici-types/LICENSE +21 -0
- package/packages/mailx-send/mailsend/node_modules/undici-types/README.md +6 -0
- package/packages/mailx-send/mailsend/node_modules/undici-types/agent.d.ts +31 -0
- package/packages/mailx-send/mailsend/node_modules/undici-types/api.d.ts +43 -0
- package/packages/mailx-send/mailsend/node_modules/undici-types/balanced-pool.d.ts +29 -0
- package/packages/mailx-send/mailsend/node_modules/undici-types/cache.d.ts +36 -0
- package/packages/mailx-send/mailsend/node_modules/undici-types/client.d.ts +108 -0
- package/packages/mailx-send/mailsend/node_modules/undici-types/connector.d.ts +34 -0
- package/packages/mailx-send/mailsend/node_modules/undici-types/content-type.d.ts +21 -0
- package/packages/mailx-send/mailsend/node_modules/undici-types/cookies.d.ts +28 -0
- package/packages/mailx-send/mailsend/node_modules/undici-types/diagnostics-channel.d.ts +66 -0
- package/packages/mailx-send/mailsend/node_modules/undici-types/dispatcher.d.ts +256 -0
- package/packages/mailx-send/mailsend/node_modules/undici-types/env-http-proxy-agent.d.ts +21 -0
- package/packages/mailx-send/mailsend/node_modules/undici-types/errors.d.ts +149 -0
- package/packages/mailx-send/mailsend/node_modules/undici-types/eventsource.d.ts +61 -0
- package/packages/mailx-send/mailsend/node_modules/undici-types/fetch.d.ts +209 -0
- package/packages/mailx-send/mailsend/node_modules/undici-types/file.d.ts +39 -0
- package/packages/mailx-send/mailsend/node_modules/undici-types/filereader.d.ts +54 -0
- package/packages/mailx-send/mailsend/node_modules/undici-types/formdata.d.ts +108 -0
- package/packages/mailx-send/mailsend/node_modules/undici-types/global-dispatcher.d.ts +9 -0
- package/packages/mailx-send/mailsend/node_modules/undici-types/global-origin.d.ts +7 -0
- package/packages/mailx-send/mailsend/node_modules/undici-types/handlers.d.ts +15 -0
- package/packages/mailx-send/mailsend/node_modules/undici-types/header.d.ts +4 -0
- package/packages/mailx-send/mailsend/node_modules/undici-types/index.d.ts +71 -0
- package/packages/mailx-send/mailsend/node_modules/undici-types/interceptors.d.ts +17 -0
- package/packages/mailx-send/mailsend/node_modules/undici-types/mock-agent.d.ts +50 -0
- package/packages/mailx-send/mailsend/node_modules/undici-types/mock-client.d.ts +25 -0
- package/packages/mailx-send/mailsend/node_modules/undici-types/mock-errors.d.ts +12 -0
- package/packages/mailx-send/mailsend/node_modules/undici-types/mock-interceptor.d.ts +93 -0
- package/packages/mailx-send/mailsend/node_modules/undici-types/mock-pool.d.ts +25 -0
- package/packages/mailx-send/mailsend/node_modules/undici-types/package.json +55 -0
- package/packages/mailx-send/mailsend/node_modules/undici-types/patch.d.ts +33 -0
- package/packages/mailx-send/mailsend/node_modules/undici-types/pool-stats.d.ts +19 -0
- package/packages/mailx-send/mailsend/node_modules/undici-types/pool.d.ts +39 -0
- package/packages/mailx-send/mailsend/node_modules/undici-types/proxy-agent.d.ts +28 -0
- package/packages/mailx-send/mailsend/node_modules/undici-types/readable.d.ts +65 -0
- package/packages/mailx-send/mailsend/node_modules/undici-types/retry-agent.d.ts +8 -0
- package/packages/mailx-send/mailsend/node_modules/undici-types/retry-handler.d.ts +116 -0
- package/packages/mailx-send/mailsend/node_modules/undici-types/util.d.ts +18 -0
- package/packages/mailx-send/mailsend/node_modules/undici-types/webidl.d.ts +228 -0
- package/packages/mailx-send/mailsend/node_modules/undici-types/websocket.d.ts +150 -0
- package/packages/mailx-send/mailsend/package.json +26 -0
- package/packages/mailx-send/node_modules/.package-lock.json +49 -0
- package/packages/mailx-send/node_modules/@types/node/LICENSE +21 -0
- package/packages/mailx-send/node_modules/@types/node/README.md +15 -0
- package/packages/mailx-send/node_modules/@types/node/assert/strict.d.ts +111 -0
- package/packages/mailx-send/node_modules/@types/node/assert.d.ts +1078 -0
- package/packages/mailx-send/node_modules/@types/node/async_hooks.d.ts +603 -0
- package/packages/mailx-send/node_modules/@types/node/buffer.buffer.d.ts +472 -0
- package/packages/mailx-send/node_modules/@types/node/buffer.d.ts +1934 -0
- package/packages/mailx-send/node_modules/@types/node/child_process.d.ts +1476 -0
- package/packages/mailx-send/node_modules/@types/node/cluster.d.ts +578 -0
- package/packages/mailx-send/node_modules/@types/node/compatibility/disposable.d.ts +14 -0
- package/packages/mailx-send/node_modules/@types/node/compatibility/index.d.ts +9 -0
- package/packages/mailx-send/node_modules/@types/node/compatibility/indexable.d.ts +20 -0
- package/packages/mailx-send/node_modules/@types/node/compatibility/iterators.d.ts +20 -0
- package/packages/mailx-send/node_modules/@types/node/console.d.ts +452 -0
- package/packages/mailx-send/node_modules/@types/node/constants.d.ts +21 -0
- package/packages/mailx-send/node_modules/@types/node/crypto.d.ts +4545 -0
- package/packages/mailx-send/node_modules/@types/node/dgram.d.ts +600 -0
- package/packages/mailx-send/node_modules/@types/node/diagnostics_channel.d.ts +578 -0
- package/packages/mailx-send/node_modules/@types/node/dns/promises.d.ts +503 -0
- package/packages/mailx-send/node_modules/@types/node/dns.d.ts +923 -0
- package/packages/mailx-send/node_modules/@types/node/domain.d.ts +170 -0
- package/packages/mailx-send/node_modules/@types/node/events.d.ts +976 -0
- package/packages/mailx-send/node_modules/@types/node/fs/promises.d.ts +1295 -0
- package/packages/mailx-send/node_modules/@types/node/fs.d.ts +4461 -0
- package/packages/mailx-send/node_modules/@types/node/globals.d.ts +172 -0
- package/packages/mailx-send/node_modules/@types/node/globals.typedarray.d.ts +38 -0
- package/packages/mailx-send/node_modules/@types/node/http.d.ts +2089 -0
- package/packages/mailx-send/node_modules/@types/node/http2.d.ts +2644 -0
- package/packages/mailx-send/node_modules/@types/node/https.d.ts +579 -0
- package/packages/mailx-send/node_modules/@types/node/index.d.ts +97 -0
- package/packages/mailx-send/node_modules/@types/node/inspector.d.ts +253 -0
- package/packages/mailx-send/node_modules/@types/node/inspector.generated.d.ts +4052 -0
- package/packages/mailx-send/node_modules/@types/node/module.d.ts +891 -0
- package/packages/mailx-send/node_modules/@types/node/net.d.ts +1057 -0
- package/packages/mailx-send/node_modules/@types/node/os.d.ts +506 -0
- package/packages/mailx-send/node_modules/@types/node/package.json +145 -0
- package/packages/mailx-send/node_modules/@types/node/path.d.ts +200 -0
- package/packages/mailx-send/node_modules/@types/node/perf_hooks.d.ts +968 -0
- package/packages/mailx-send/node_modules/@types/node/process.d.ts +2084 -0
- package/packages/mailx-send/node_modules/@types/node/punycode.d.ts +117 -0
- package/packages/mailx-send/node_modules/@types/node/querystring.d.ts +152 -0
- package/packages/mailx-send/node_modules/@types/node/readline/promises.d.ts +161 -0
- package/packages/mailx-send/node_modules/@types/node/readline.d.ts +594 -0
- package/packages/mailx-send/node_modules/@types/node/repl.d.ts +428 -0
- package/packages/mailx-send/node_modules/@types/node/sea.d.ts +153 -0
- package/packages/mailx-send/node_modules/@types/node/sqlite.d.ts +721 -0
- package/packages/mailx-send/node_modules/@types/node/stream/consumers.d.ts +38 -0
- package/packages/mailx-send/node_modules/@types/node/stream/promises.d.ts +90 -0
- package/packages/mailx-send/node_modules/@types/node/stream/web.d.ts +622 -0
- package/packages/mailx-send/node_modules/@types/node/stream.d.ts +1664 -0
- package/packages/mailx-send/node_modules/@types/node/string_decoder.d.ts +67 -0
- package/packages/mailx-send/node_modules/@types/node/test.d.ts +2163 -0
- package/packages/mailx-send/node_modules/@types/node/timers/promises.d.ts +108 -0
- package/packages/mailx-send/node_modules/@types/node/timers.d.ts +287 -0
- package/packages/mailx-send/node_modules/@types/node/tls.d.ts +1319 -0
- package/packages/mailx-send/node_modules/@types/node/trace_events.d.ts +197 -0
- package/packages/mailx-send/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +468 -0
- package/packages/mailx-send/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +34 -0
- package/packages/mailx-send/node_modules/@types/node/ts5.6/index.d.ts +97 -0
- package/packages/mailx-send/node_modules/@types/node/tty.d.ts +208 -0
- package/packages/mailx-send/node_modules/@types/node/url.d.ts +984 -0
- package/packages/mailx-send/node_modules/@types/node/util.d.ts +2606 -0
- package/packages/mailx-send/node_modules/@types/node/v8.d.ts +920 -0
- package/packages/mailx-send/node_modules/@types/node/vm.d.ts +1000 -0
- package/packages/mailx-send/node_modules/@types/node/wasi.d.ts +181 -0
- package/packages/mailx-send/node_modules/@types/node/web-globals/abortcontroller.d.ts +34 -0
- package/packages/mailx-send/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
- package/packages/mailx-send/node_modules/@types/node/web-globals/events.d.ts +97 -0
- package/packages/mailx-send/node_modules/@types/node/web-globals/fetch.d.ts +55 -0
- package/packages/mailx-send/node_modules/@types/node/web-globals/navigator.d.ts +22 -0
- package/packages/mailx-send/node_modules/@types/node/web-globals/storage.d.ts +24 -0
- package/packages/mailx-send/node_modules/@types/node/worker_threads.d.ts +784 -0
- package/packages/mailx-send/node_modules/@types/node/zlib.d.ts +747 -0
- package/packages/mailx-send/node_modules/nodemailer/.ncurc.js +9 -0
- package/packages/mailx-send/node_modules/nodemailer/.prettierignore +8 -0
- package/packages/mailx-send/node_modules/nodemailer/.prettierrc +12 -0
- package/packages/mailx-send/node_modules/nodemailer/.prettierrc.js +10 -0
- package/packages/mailx-send/node_modules/nodemailer/.release-please-config.json +9 -0
- package/packages/mailx-send/node_modules/nodemailer/LICENSE +16 -0
- package/packages/mailx-send/node_modules/nodemailer/README.md +86 -0
- package/packages/mailx-send/node_modules/nodemailer/SECURITY.txt +22 -0
- package/packages/mailx-send/node_modules/nodemailer/eslint.config.js +88 -0
- package/packages/mailx-send/node_modules/nodemailer/lib/addressparser/index.js +383 -0
- package/packages/mailx-send/node_modules/nodemailer/lib/base64/index.js +139 -0
- package/packages/mailx-send/node_modules/nodemailer/lib/dkim/index.js +253 -0
- package/packages/mailx-send/node_modules/nodemailer/lib/dkim/message-parser.js +155 -0
- package/packages/mailx-send/node_modules/nodemailer/lib/dkim/relaxed-body.js +154 -0
- package/packages/mailx-send/node_modules/nodemailer/lib/dkim/sign.js +117 -0
- package/packages/mailx-send/node_modules/nodemailer/lib/fetch/cookies.js +281 -0
- package/packages/mailx-send/node_modules/nodemailer/lib/fetch/index.js +280 -0
- package/packages/mailx-send/node_modules/nodemailer/lib/json-transport/index.js +82 -0
- package/packages/mailx-send/node_modules/nodemailer/lib/mail-composer/index.js +629 -0
- package/packages/mailx-send/node_modules/nodemailer/lib/mailer/index.js +441 -0
- package/packages/mailx-send/node_modules/nodemailer/lib/mailer/mail-message.js +316 -0
- package/packages/mailx-send/node_modules/nodemailer/lib/mime-funcs/index.js +625 -0
- package/packages/mailx-send/node_modules/nodemailer/lib/mime-funcs/mime-types.js +2113 -0
- package/packages/mailx-send/node_modules/nodemailer/lib/mime-node/index.js +1316 -0
- package/packages/mailx-send/node_modules/nodemailer/lib/mime-node/last-newline.js +33 -0
- package/packages/mailx-send/node_modules/nodemailer/lib/mime-node/le-unix.js +43 -0
- package/packages/mailx-send/node_modules/nodemailer/lib/mime-node/le-windows.js +52 -0
- package/packages/mailx-send/node_modules/nodemailer/lib/nodemailer.js +157 -0
- package/packages/mailx-send/node_modules/nodemailer/lib/punycode/index.js +460 -0
- package/packages/mailx-send/node_modules/nodemailer/lib/qp/index.js +227 -0
- package/packages/mailx-send/node_modules/nodemailer/lib/sendmail-transport/index.js +210 -0
- package/packages/mailx-send/node_modules/nodemailer/lib/ses-transport/index.js +234 -0
- package/packages/mailx-send/node_modules/nodemailer/lib/shared/index.js +754 -0
- package/packages/mailx-send/node_modules/nodemailer/lib/smtp-connection/data-stream.js +108 -0
- package/packages/mailx-send/node_modules/nodemailer/lib/smtp-connection/http-proxy-client.js +143 -0
- package/packages/mailx-send/node_modules/nodemailer/lib/smtp-connection/index.js +1870 -0
- package/packages/mailx-send/node_modules/nodemailer/lib/smtp-pool/index.js +652 -0
- package/packages/mailx-send/node_modules/nodemailer/lib/smtp-pool/pool-resource.js +259 -0
- package/packages/mailx-send/node_modules/nodemailer/lib/smtp-transport/index.js +421 -0
- package/packages/mailx-send/node_modules/nodemailer/lib/stream-transport/index.js +135 -0
- package/packages/mailx-send/node_modules/nodemailer/lib/well-known/index.js +47 -0
- package/packages/mailx-send/node_modules/nodemailer/lib/well-known/services.json +611 -0
- package/packages/mailx-send/node_modules/nodemailer/lib/xoauth2/index.js +427 -0
- package/packages/mailx-send/node_modules/nodemailer/package.json +47 -0
- package/packages/mailx-send/node_modules/undici-types/LICENSE +21 -0
- package/packages/mailx-send/node_modules/undici-types/README.md +6 -0
- package/packages/mailx-send/node_modules/undici-types/agent.d.ts +31 -0
- package/packages/mailx-send/node_modules/undici-types/api.d.ts +43 -0
- package/packages/mailx-send/node_modules/undici-types/balanced-pool.d.ts +29 -0
- package/packages/mailx-send/node_modules/undici-types/cache.d.ts +36 -0
- package/packages/mailx-send/node_modules/undici-types/client.d.ts +108 -0
- package/packages/mailx-send/node_modules/undici-types/connector.d.ts +34 -0
- package/packages/mailx-send/node_modules/undici-types/content-type.d.ts +21 -0
- package/packages/mailx-send/node_modules/undici-types/cookies.d.ts +28 -0
- package/packages/mailx-send/node_modules/undici-types/diagnostics-channel.d.ts +66 -0
- package/packages/mailx-send/node_modules/undici-types/dispatcher.d.ts +256 -0
- package/packages/mailx-send/node_modules/undici-types/env-http-proxy-agent.d.ts +21 -0
- package/packages/mailx-send/node_modules/undici-types/errors.d.ts +149 -0
- package/packages/mailx-send/node_modules/undici-types/eventsource.d.ts +61 -0
- package/packages/mailx-send/node_modules/undici-types/fetch.d.ts +209 -0
- package/packages/mailx-send/node_modules/undici-types/file.d.ts +39 -0
- package/packages/mailx-send/node_modules/undici-types/filereader.d.ts +54 -0
- package/packages/mailx-send/node_modules/undici-types/formdata.d.ts +108 -0
- package/packages/mailx-send/node_modules/undici-types/global-dispatcher.d.ts +9 -0
- package/packages/mailx-send/node_modules/undici-types/global-origin.d.ts +7 -0
- package/packages/mailx-send/node_modules/undici-types/handlers.d.ts +15 -0
- package/packages/mailx-send/node_modules/undici-types/header.d.ts +4 -0
- package/packages/mailx-send/node_modules/undici-types/index.d.ts +71 -0
- package/packages/mailx-send/node_modules/undici-types/interceptors.d.ts +17 -0
- package/packages/mailx-send/node_modules/undici-types/mock-agent.d.ts +50 -0
- package/packages/mailx-send/node_modules/undici-types/mock-client.d.ts +25 -0
- package/packages/mailx-send/node_modules/undici-types/mock-errors.d.ts +12 -0
- package/packages/mailx-send/node_modules/undici-types/mock-interceptor.d.ts +93 -0
- package/packages/mailx-send/node_modules/undici-types/mock-pool.d.ts +25 -0
- package/packages/mailx-send/node_modules/undici-types/package.json +55 -0
- package/packages/mailx-send/node_modules/undici-types/patch.d.ts +33 -0
- package/packages/mailx-send/node_modules/undici-types/pool-stats.d.ts +19 -0
- package/packages/mailx-send/node_modules/undici-types/pool.d.ts +39 -0
- package/packages/mailx-send/node_modules/undici-types/proxy-agent.d.ts +28 -0
- package/packages/mailx-send/node_modules/undici-types/readable.d.ts +65 -0
- package/packages/mailx-send/node_modules/undici-types/retry-agent.d.ts +8 -0
- package/packages/mailx-send/node_modules/undici-types/retry-handler.d.ts +116 -0
- package/packages/mailx-send/node_modules/undici-types/util.d.ts +18 -0
- package/packages/mailx-send/node_modules/undici-types/webidl.d.ts +228 -0
- package/packages/mailx-send/node_modules/undici-types/websocket.d.ts +150 -0
- package/packages/mailx-send/package.json +27 -0
- package/packages/mailx-server/index.d.ts +8 -0
- package/packages/mailx-server/index.js +217 -0
- package/packages/mailx-server/package.json +25 -0
- package/packages/mailx-server/tsconfig.tsbuildinfo +1 -0
- package/packages/mailx-settings/index.d.ts +64 -0
- package/packages/mailx-settings/index.js +218 -0
- package/packages/mailx-settings/package.json +16 -0
- package/packages/mailx-settings/tsconfig.tsbuildinfo +1 -0
- package/packages/mailx-store/db.d.ts +100 -0
- package/packages/mailx-store/db.js +461 -0
- package/packages/mailx-store/file-store.d.ts +22 -0
- package/packages/mailx-store/file-store.js +59 -0
- package/packages/mailx-store/index.d.ts +7 -0
- package/packages/mailx-store/index.js +7 -0
- package/packages/mailx-store/package.json +19 -0
- package/packages/mailx-store/tsconfig.tsbuildinfo +1 -0
- package/packages/mailx-types/index.d.ts +195 -0
- package/packages/mailx-types/index.js +7 -0
- package/packages/mailx-types/package.json +12 -0
- package/packages/mailx-types/tsconfig.tsbuildinfo +1 -0
- package/tsconfig.base.json +28 -0
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
# @bobfrankston/mailx-send
|
|
2
|
+
|
|
3
|
+
Queue-based mail sender with SMTP and OAuth2 support. Messages are queued as RFC 822 `.ltr` files and sent via SMTP with automatic retry.
|
|
4
|
+
|
|
5
|
+
Part of the [mailx](../../README.md) email client, but usable standalone by any application.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @bobfrankston/mailx-send
|
|
11
|
+
# or globally for CLI tools:
|
|
12
|
+
npm install -g @bobfrankston/mailx-send
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Two CLI Commands
|
|
16
|
+
|
|
17
|
+
This package provides two commands:
|
|
18
|
+
|
|
19
|
+
- **`mailsend`** — create and queue a new message for sending
|
|
20
|
+
- **`mailq`** — manage the outgoing mail queue (process, retry, status)
|
|
21
|
+
|
|
22
|
+
## Directory Structure
|
|
23
|
+
|
|
24
|
+
Each account has its own queue:
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
{baseDir}/
|
|
28
|
+
{accountId}/
|
|
29
|
+
queue/ pending .ltr files
|
|
30
|
+
sent/ sent messages (YYYY/MM/DD/) — optional log
|
|
31
|
+
fail/ failed messages awaiting retry
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Library API
|
|
35
|
+
|
|
36
|
+
```typescript
|
|
37
|
+
import { initMailSend, queueMessage } from "@bobfrankston/mailx-send";
|
|
38
|
+
|
|
39
|
+
// Initialize once at startup
|
|
40
|
+
initMailSend({
|
|
41
|
+
baseDir: "./mailqueue",
|
|
42
|
+
defaultAccount: "iecc",
|
|
43
|
+
logSent: true,
|
|
44
|
+
retryIntervalMs: 300000, // 5 min
|
|
45
|
+
accounts: {
|
|
46
|
+
iecc: {
|
|
47
|
+
host: "smtp.iecc.com",
|
|
48
|
+
port: 587,
|
|
49
|
+
auth: "password",
|
|
50
|
+
user: "bob",
|
|
51
|
+
password: "secret",
|
|
52
|
+
from: "Bob Frankston <bob@iecc.com>",
|
|
53
|
+
},
|
|
54
|
+
gmail: {
|
|
55
|
+
host: "smtp.gmail.com",
|
|
56
|
+
port: 587,
|
|
57
|
+
auth: "oauth2",
|
|
58
|
+
user: "bob@gmail.com",
|
|
59
|
+
from: "Bob Frankston <bob@gmail.com>",
|
|
60
|
+
tokenProvider: async () => getOAuthToken(),
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
// Queue a message — returns filename, sends in background
|
|
66
|
+
queueMessage({
|
|
67
|
+
from: "Bob Frankston <bob@iecc.com>",
|
|
68
|
+
to: ["alice@example.com"],
|
|
69
|
+
subject: "Hello",
|
|
70
|
+
html: "<p>Rich <b>HTML</b> body</p>",
|
|
71
|
+
accountId: "iecc",
|
|
72
|
+
});
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### MailMessage interface
|
|
76
|
+
|
|
77
|
+
```typescript
|
|
78
|
+
interface MailMessage {
|
|
79
|
+
from: string; // "Name <address>"
|
|
80
|
+
to: string[];
|
|
81
|
+
cc?: string[];
|
|
82
|
+
bcc?: string[];
|
|
83
|
+
subject: string;
|
|
84
|
+
html?: string; // HTML body (preferred for rich email)
|
|
85
|
+
text?: string; // Plain text body
|
|
86
|
+
inReplyTo?: string; // Message-ID for threading
|
|
87
|
+
references?: string; // References header for threading
|
|
88
|
+
accountId?: string; // Queue/account to send from
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Other API functions
|
|
93
|
+
|
|
94
|
+
```typescript
|
|
95
|
+
import { initMailSend, queueMessage, getMailSender } from "@bobfrankston/mailx-send";
|
|
96
|
+
|
|
97
|
+
const sender = initMailSend(config);
|
|
98
|
+
|
|
99
|
+
sender.processQueue("iecc"); // Process one account's queue
|
|
100
|
+
sender.processAllQueues(); // Process all accounts
|
|
101
|
+
sender.getStatus(); // { iecc: { pending: 2, failed: 0 }, gmail: { ... } }
|
|
102
|
+
sender.startWorker(); // Start background retry timer (auto-started by initMailSend)
|
|
103
|
+
sender.stopWorker(); // Stop background processing
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## CLI: mailsend
|
|
107
|
+
|
|
108
|
+
Create and queue a new message:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
# From CLI arguments
|
|
112
|
+
mailsend --to alice@example.com --subject "Hello" --body "Message text"
|
|
113
|
+
mailsend -q gmail --from "Bob <bob@gmail.com>" --to alice@example.com --subject "Test"
|
|
114
|
+
|
|
115
|
+
# From a JSON file
|
|
116
|
+
mailsend --json message.json
|
|
117
|
+
mailsend --json message.json -q gmail
|
|
118
|
+
|
|
119
|
+
# From stdin
|
|
120
|
+
echo '{"to":["alice@example.com"],"subject":"Test","text":"Hello"}' | mailsend --json -
|
|
121
|
+
|
|
122
|
+
# Custom config file
|
|
123
|
+
mailsend --config /path/to/mailsend.json --to ...
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### JSON message format
|
|
127
|
+
|
|
128
|
+
```json
|
|
129
|
+
{
|
|
130
|
+
"to": ["alice@example.com"],
|
|
131
|
+
"cc": ["bob@example.com"],
|
|
132
|
+
"from": "Bob Frankston <bob@iecc.com>",
|
|
133
|
+
"subject": "Hello",
|
|
134
|
+
"html": "<p>Rich body</p>",
|
|
135
|
+
"text": "Plain text fallback",
|
|
136
|
+
"accountId": "iecc"
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## CLI: mailq
|
|
141
|
+
|
|
142
|
+
Manage the outgoing mail queue:
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
mailq # Show queue status (all accounts)
|
|
146
|
+
mailq --process # Process all queues (send pending, retry failed)
|
|
147
|
+
mailq --process -q gmail # Process only the gmail queue
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Configuration
|
|
151
|
+
|
|
152
|
+
Create `mailsend.json`:
|
|
153
|
+
|
|
154
|
+
```json
|
|
155
|
+
{
|
|
156
|
+
"baseDir": "./mailqueue",
|
|
157
|
+
"defaultAccount": "iecc",
|
|
158
|
+
"logSent": true,
|
|
159
|
+
"retryIntervalMs": 300000,
|
|
160
|
+
"accounts": {
|
|
161
|
+
"iecc": {
|
|
162
|
+
"host": "smtp.iecc.com",
|
|
163
|
+
"port": 587,
|
|
164
|
+
"auth": "password",
|
|
165
|
+
"user": "bob",
|
|
166
|
+
"password": "secret",
|
|
167
|
+
"from": "Bob Frankston <bob@iecc.com>"
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
## Queue Format
|
|
174
|
+
|
|
175
|
+
Messages are stored as `.ltr` files — standard RFC 822 format with an `X-MailSend-Account` header for routing. Filenames: `YYYYMMDD_HHMMSS-NNNN.ltr`
|
|
176
|
+
|
|
177
|
+
## Building MIME Messages
|
|
178
|
+
|
|
179
|
+
mailx-send currently builds simple single-part RFC 822 messages (text or HTML). For complex MIME messages (multipart, attachments, inline images), use one of these packages to build the raw message, then pass it to the queue:
|
|
180
|
+
|
|
181
|
+
- **[nodemailer](https://www.npmjs.com/package/nodemailer)** — `MailComposer` class builds full MIME from parts (already a dependency)
|
|
182
|
+
- **[emailjs-mime-builder](https://www.npmjs.com/package/emailjs-mime-builder)** — lightweight MIME builder
|
|
183
|
+
- **[mimetext](https://www.npmjs.com/package/mimetext)** — simple API for building MIME messages: `createMimeMessage()`, add text/html/attachments
|
|
184
|
+
- **[mailcomposer](https://www.npmjs.com/package/mailcomposer)** — standalone MIME composer (from nodemailer's author)
|
|
185
|
+
|
|
186
|
+
Example with nodemailer's MailComposer:
|
|
187
|
+
|
|
188
|
+
```typescript
|
|
189
|
+
import MailComposer from "nodemailer/lib/mail-composer";
|
|
190
|
+
|
|
191
|
+
const mail = new MailComposer({
|
|
192
|
+
from: "Bob <bob@iecc.com>",
|
|
193
|
+
to: "alice@example.com",
|
|
194
|
+
subject: "With attachment",
|
|
195
|
+
html: "<p>See attached</p>",
|
|
196
|
+
attachments: [{ filename: "doc.pdf", path: "/path/to/doc.pdf" }],
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
const raw = await mail.compile().build();
|
|
200
|
+
// Write raw to the queue directory as a .ltr file
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
## Retry
|
|
204
|
+
|
|
205
|
+
Failed messages move to `{accountId}/fail/YYYY/MM/DD/`. The background worker retries at the configured interval (default 5 min) by moving them back to the queue.
|
|
206
|
+
|
|
207
|
+
## OAuth2 (Gmail)
|
|
208
|
+
|
|
209
|
+
Set `auth: "oauth2"` and provide a `tokenProvider` function returning a current access token. Integrates with `@bobfrankston/oauthsupport` or any OAuth2 flow.
|
|
210
|
+
|
|
211
|
+
## Sent Log
|
|
212
|
+
|
|
213
|
+
When `logSent: true`, sent messages are preserved in `{accountId}/sent/YYYY/MM/DD/` for debugging.
|
|
214
|
+
|
|
215
|
+
## License
|
|
216
|
+
|
|
217
|
+
MIT
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* mailq — manage the outgoing mail queue.
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* mailq Show queue status (all accounts)
|
|
7
|
+
* mailq --process Process all queues now (send pending, retry failed)
|
|
8
|
+
* mailq --process -q gmail Process only the gmail queue
|
|
9
|
+
*/
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=cli-queue.d.ts.map
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* mailq — manage the outgoing mail queue.
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* mailq Show queue status (all accounts)
|
|
7
|
+
* mailq --process Process all queues now (send pending, retry failed)
|
|
8
|
+
* mailq --process -q gmail Process only the gmail queue
|
|
9
|
+
*/
|
|
10
|
+
import * as fs from "node:fs";
|
|
11
|
+
import { initMailSend } from "./index.js";
|
|
12
|
+
const args = process.argv.slice(2);
|
|
13
|
+
function getArg(name) {
|
|
14
|
+
const shorts = { q: "queue" };
|
|
15
|
+
const longIdx = args.indexOf(`--${name}`);
|
|
16
|
+
const shortKey = Object.entries(shorts).find(([, v]) => v === name)?.[0];
|
|
17
|
+
const shortIdx = shortKey ? args.indexOf(`-${shortKey}`) : -1;
|
|
18
|
+
const i = Math.max(longIdx, shortIdx);
|
|
19
|
+
if (i === -1 || i + 1 >= args.length)
|
|
20
|
+
return undefined;
|
|
21
|
+
return args[i + 1];
|
|
22
|
+
}
|
|
23
|
+
function hasFlag(name) {
|
|
24
|
+
return args.includes(`--${name}`);
|
|
25
|
+
}
|
|
26
|
+
const configPath = getArg("config") || "mailsend.json";
|
|
27
|
+
if (!fs.existsSync(configPath)) {
|
|
28
|
+
console.error(`Config file not found: ${configPath}`);
|
|
29
|
+
process.exit(1);
|
|
30
|
+
}
|
|
31
|
+
const config = JSON.parse(fs.readFileSync(configPath, "utf-8"));
|
|
32
|
+
const sender = initMailSend(config);
|
|
33
|
+
if (hasFlag("process")) {
|
|
34
|
+
const accountId = getArg("queue");
|
|
35
|
+
if (accountId) {
|
|
36
|
+
await sender.processQueue(accountId);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
await sender.processAllQueues();
|
|
40
|
+
}
|
|
41
|
+
// Show status after processing
|
|
42
|
+
const status = sender.getStatus();
|
|
43
|
+
for (const [id, s] of Object.entries(status)) {
|
|
44
|
+
console.log(` ${id}: ${s.pending} pending, ${s.failed} failed`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
// Default: show status
|
|
49
|
+
const status = sender.getStatus();
|
|
50
|
+
let total = 0;
|
|
51
|
+
for (const [id, s] of Object.entries(status)) {
|
|
52
|
+
console.log(` ${id}: ${s.pending} pending, ${s.failed} failed`);
|
|
53
|
+
total += s.pending + s.failed;
|
|
54
|
+
}
|
|
55
|
+
if (total === 0)
|
|
56
|
+
console.log(" All queues empty");
|
|
57
|
+
}
|
|
58
|
+
process.exit(0);
|
|
59
|
+
//# sourceMappingURL=cli-queue.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* mailsend — create and send an email message.
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* mailsend --to addr --subject "text" --body "text"
|
|
7
|
+
* mailsend -q gmail --from "Bob <bob@gmail.com>" --to addr --subject "text"
|
|
8
|
+
* mailsend --json message.json Read message from JSON file
|
|
9
|
+
* echo '{"to":["a@b.com"],...}' | mailsend --json - Read from stdin
|
|
10
|
+
*
|
|
11
|
+
* JSON format:
|
|
12
|
+
* { "to": ["addr"], "cc": ["addr"], "from": "Name <addr>",
|
|
13
|
+
* "subject": "text", "text": "body", "html": "<p>body</p>",
|
|
14
|
+
* "accountId": "iecc" }
|
|
15
|
+
*/
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=cli-send.d.ts.map
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* mailsend — create and send an email message.
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* mailsend --to addr --subject "text" --body "text"
|
|
7
|
+
* mailsend -q gmail --from "Bob <bob@gmail.com>" --to addr --subject "text"
|
|
8
|
+
* mailsend --json message.json Read message from JSON file
|
|
9
|
+
* echo '{"to":["a@b.com"],...}' | mailsend --json - Read from stdin
|
|
10
|
+
*
|
|
11
|
+
* JSON format:
|
|
12
|
+
* { "to": ["addr"], "cc": ["addr"], "from": "Name <addr>",
|
|
13
|
+
* "subject": "text", "text": "body", "html": "<p>body</p>",
|
|
14
|
+
* "accountId": "iecc" }
|
|
15
|
+
*/
|
|
16
|
+
import * as fs from "node:fs";
|
|
17
|
+
import { initMailSend, queueMessage } from "./index.js";
|
|
18
|
+
const args = process.argv.slice(2);
|
|
19
|
+
function getArg(name) {
|
|
20
|
+
const shorts = { q: "queue" };
|
|
21
|
+
const longIdx = args.indexOf(`--${name}`);
|
|
22
|
+
const shortKey = Object.entries(shorts).find(([, v]) => v === name)?.[0];
|
|
23
|
+
const shortIdx = shortKey ? args.indexOf(`-${shortKey}`) : -1;
|
|
24
|
+
const i = Math.max(longIdx, shortIdx);
|
|
25
|
+
if (i === -1 || i + 1 >= args.length)
|
|
26
|
+
return undefined;
|
|
27
|
+
return args[i + 1];
|
|
28
|
+
}
|
|
29
|
+
const configPath = getArg("config") || "mailsend.json";
|
|
30
|
+
if (!fs.existsSync(configPath)) {
|
|
31
|
+
console.error(`Config file not found: ${configPath}`);
|
|
32
|
+
process.exit(1);
|
|
33
|
+
}
|
|
34
|
+
const config = JSON.parse(fs.readFileSync(configPath, "utf-8"));
|
|
35
|
+
const sender = initMailSend(config);
|
|
36
|
+
const accountId = getArg("queue") || config.defaultAccount || "";
|
|
37
|
+
let msg = {};
|
|
38
|
+
const jsonArg = getArg("json");
|
|
39
|
+
if (jsonArg) {
|
|
40
|
+
const raw = jsonArg === "-"
|
|
41
|
+
? fs.readFileSync(0, "utf-8")
|
|
42
|
+
: fs.readFileSync(jsonArg, "utf-8");
|
|
43
|
+
msg = JSON.parse(raw);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
const to = getArg("to");
|
|
47
|
+
if (!to) {
|
|
48
|
+
console.error("Usage: mailsend --to addr --subject text [--body text] [--from addr] [-q account]");
|
|
49
|
+
console.error(" mailsend --json message.json [-q account]");
|
|
50
|
+
process.exit(1);
|
|
51
|
+
}
|
|
52
|
+
msg = {
|
|
53
|
+
to: to.split(",").map(s => s.trim()),
|
|
54
|
+
subject: getArg("subject") || "(no subject)",
|
|
55
|
+
text: getArg("body") || "",
|
|
56
|
+
html: getArg("html"),
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
const acctId = msg.accountId || accountId;
|
|
60
|
+
const acct = config.accounts[acctId];
|
|
61
|
+
if (!acct) {
|
|
62
|
+
console.error(`Unknown account: ${acctId}`);
|
|
63
|
+
console.error(`Available: ${Object.keys(config.accounts).join(", ")}`);
|
|
64
|
+
process.exit(1);
|
|
65
|
+
}
|
|
66
|
+
msg.from = msg.from || getArg("from") || acct.from || acct.user;
|
|
67
|
+
msg.accountId = acctId;
|
|
68
|
+
if (!msg.to?.length) {
|
|
69
|
+
console.error("Message must have at least one recipient (to)");
|
|
70
|
+
process.exit(1);
|
|
71
|
+
}
|
|
72
|
+
const filename = queueMessage(msg);
|
|
73
|
+
console.log(`Queued: ${filename}`);
|
|
74
|
+
setTimeout(() => process.exit(0), 2000);
|
|
75
|
+
//# sourceMappingURL=cli-send.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* mailx-send CLI — queue and send email.
|
|
4
|
+
*
|
|
5
|
+
* Queue management (process queued .ltr files):
|
|
6
|
+
* mailx-send --process Process all account queues now
|
|
7
|
+
* mailx-send --process -q gmail Process only the gmail queue
|
|
8
|
+
* mailx-send --status Show queue status
|
|
9
|
+
*
|
|
10
|
+
* Create and queue a new message:
|
|
11
|
+
* mailx-send --new --to addr --subject "text" --body "text"
|
|
12
|
+
* mailx-send --new -q gmail --from "Bob <bob@gmail.com>" --to addr --subject "text"
|
|
13
|
+
* mailx-send --new --json message.json Read message from JSON file
|
|
14
|
+
* echo '{"to":["a@b.com"],...}' | mailx-send --new --json - Read from stdin
|
|
15
|
+
*
|
|
16
|
+
* JSON message format:
|
|
17
|
+
* { "to": ["addr"], "cc": ["addr"], "from": "Name <addr>",
|
|
18
|
+
* "subject": "text", "text": "body", "html": "<p>body</p>",
|
|
19
|
+
* "accountId": "iecc" }
|
|
20
|
+
*/
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=cli.d.ts.map
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* mailx-send CLI — queue and send email.
|
|
4
|
+
*
|
|
5
|
+
* Queue management (process queued .ltr files):
|
|
6
|
+
* mailx-send --process Process all account queues now
|
|
7
|
+
* mailx-send --process -q gmail Process only the gmail queue
|
|
8
|
+
* mailx-send --status Show queue status
|
|
9
|
+
*
|
|
10
|
+
* Create and queue a new message:
|
|
11
|
+
* mailx-send --new --to addr --subject "text" --body "text"
|
|
12
|
+
* mailx-send --new -q gmail --from "Bob <bob@gmail.com>" --to addr --subject "text"
|
|
13
|
+
* mailx-send --new --json message.json Read message from JSON file
|
|
14
|
+
* echo '{"to":["a@b.com"],...}' | mailx-send --new --json - Read from stdin
|
|
15
|
+
*
|
|
16
|
+
* JSON message format:
|
|
17
|
+
* { "to": ["addr"], "cc": ["addr"], "from": "Name <addr>",
|
|
18
|
+
* "subject": "text", "text": "body", "html": "<p>body</p>",
|
|
19
|
+
* "accountId": "iecc" }
|
|
20
|
+
*/
|
|
21
|
+
import * as fs from "node:fs";
|
|
22
|
+
import { initMailSend, queueMessage } from "./index.js";
|
|
23
|
+
const args = process.argv.slice(2);
|
|
24
|
+
function getArg(name) {
|
|
25
|
+
const shorts = { q: "queue" };
|
|
26
|
+
const longIdx = args.indexOf(`--${name}`);
|
|
27
|
+
const shortKey = Object.entries(shorts).find(([, v]) => v === name)?.[0];
|
|
28
|
+
const shortIdx = shortKey ? args.indexOf(`-${shortKey}`) : -1;
|
|
29
|
+
const i = Math.max(longIdx, shortIdx);
|
|
30
|
+
if (i === -1 || i + 1 >= args.length)
|
|
31
|
+
return undefined;
|
|
32
|
+
return args[i + 1];
|
|
33
|
+
}
|
|
34
|
+
function hasFlag(name) {
|
|
35
|
+
return args.includes(`--${name}`);
|
|
36
|
+
}
|
|
37
|
+
// Load config
|
|
38
|
+
const configPath = getArg("config") || "mailsend.json";
|
|
39
|
+
if (!fs.existsSync(configPath)) {
|
|
40
|
+
console.error(`Config file not found: ${configPath}`);
|
|
41
|
+
console.error(`Create a mailsend.json with baseDir, accounts, etc.`);
|
|
42
|
+
process.exit(1);
|
|
43
|
+
}
|
|
44
|
+
const config = JSON.parse(fs.readFileSync(configPath, "utf-8"));
|
|
45
|
+
const sender = initMailSend(config);
|
|
46
|
+
const accountId = getArg("queue") || config.defaultAccount || "";
|
|
47
|
+
// ── Queue management ──
|
|
48
|
+
if (hasFlag("status")) {
|
|
49
|
+
const status = sender.getStatus();
|
|
50
|
+
for (const [id, s] of Object.entries(status)) {
|
|
51
|
+
console.log(` ${id}: ${s.pending} pending, ${s.failed} failed`);
|
|
52
|
+
}
|
|
53
|
+
process.exit(0);
|
|
54
|
+
}
|
|
55
|
+
if (hasFlag("process") && !hasFlag("new")) {
|
|
56
|
+
if (accountId && accountId !== config.defaultAccount) {
|
|
57
|
+
await sender.processQueue(accountId);
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
await sender.processAllQueues();
|
|
61
|
+
}
|
|
62
|
+
process.exit(0);
|
|
63
|
+
}
|
|
64
|
+
// ── Create new message ──
|
|
65
|
+
if (hasFlag("new")) {
|
|
66
|
+
let msg = {};
|
|
67
|
+
const jsonArg = getArg("json");
|
|
68
|
+
if (jsonArg) {
|
|
69
|
+
// Load from JSON file or stdin
|
|
70
|
+
const raw = jsonArg === "-"
|
|
71
|
+
? fs.readFileSync(0, "utf-8") // stdin
|
|
72
|
+
: fs.readFileSync(jsonArg, "utf-8");
|
|
73
|
+
msg = JSON.parse(raw);
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
// Build from CLI args
|
|
77
|
+
const to = getArg("to");
|
|
78
|
+
if (!to) {
|
|
79
|
+
console.error("--new requires --to or --json");
|
|
80
|
+
process.exit(1);
|
|
81
|
+
}
|
|
82
|
+
msg = {
|
|
83
|
+
to: to.split(",").map(s => s.trim()),
|
|
84
|
+
subject: getArg("subject") || "(no subject)",
|
|
85
|
+
text: getArg("body") || "",
|
|
86
|
+
html: getArg("html"),
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
// Set from/account
|
|
90
|
+
const acctId = msg.accountId || accountId;
|
|
91
|
+
const acct = config.accounts[acctId];
|
|
92
|
+
if (!acct) {
|
|
93
|
+
console.error(`Unknown account: ${acctId}`);
|
|
94
|
+
console.error(`Available: ${Object.keys(config.accounts).join(", ")}`);
|
|
95
|
+
process.exit(1);
|
|
96
|
+
}
|
|
97
|
+
msg.from = msg.from || getArg("from") || acct.from || acct.user;
|
|
98
|
+
msg.accountId = acctId;
|
|
99
|
+
if (!msg.to?.length) {
|
|
100
|
+
console.error("Message must have at least one recipient (to)");
|
|
101
|
+
process.exit(1);
|
|
102
|
+
}
|
|
103
|
+
const filename = queueMessage(msg);
|
|
104
|
+
console.log(`Queued: ${filename}`);
|
|
105
|
+
setTimeout(() => process.exit(0), 2000);
|
|
106
|
+
}
|
|
107
|
+
else if (!hasFlag("status") && !hasFlag("process")) {
|
|
108
|
+
console.error("Usage:");
|
|
109
|
+
console.error(" mailx-send --new --to addr --subject text [--body text] [-q account]");
|
|
110
|
+
console.error(" mailx-send --new --json message.json [-q account]");
|
|
111
|
+
console.error(" mailx-send --process [-q account]");
|
|
112
|
+
console.error(" mailx-send --status");
|
|
113
|
+
process.exit(1);
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=cli.js.map
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @bobfrankston/mailsend
|
|
3
|
+
* Queue-based mail sender. Each account has its own queue directory.
|
|
4
|
+
* Messages queued as .ltr (RFC 822) files, sent via SMTP with retry.
|
|
5
|
+
* Supports password and OAuth2 (Gmail) authentication.
|
|
6
|
+
*
|
|
7
|
+
* Directory structure:
|
|
8
|
+
* {baseDir}/{accountId}/queue/ — pending .ltr files
|
|
9
|
+
* {baseDir}/{accountId}/sent/ — sent messages (optional, YYYY/MM/DD)
|
|
10
|
+
* {baseDir}/{accountId}/fail/ — failed messages for retry
|
|
11
|
+
*/
|
|
12
|
+
export interface SmtpConfig {
|
|
13
|
+
host: string;
|
|
14
|
+
port: number;
|
|
15
|
+
secure?: boolean;
|
|
16
|
+
auth: "password" | "oauth2";
|
|
17
|
+
user: string;
|
|
18
|
+
password?: string;
|
|
19
|
+
/** Default From address, e.g. "Bob Frankston <bob@iecc.com>" */
|
|
20
|
+
from?: string;
|
|
21
|
+
tokenProvider?: () => Promise<string>;
|
|
22
|
+
}
|
|
23
|
+
export interface MailMessage {
|
|
24
|
+
from: string;
|
|
25
|
+
to: string[];
|
|
26
|
+
cc?: string[];
|
|
27
|
+
bcc?: string[];
|
|
28
|
+
subject: string;
|
|
29
|
+
html?: string;
|
|
30
|
+
text?: string;
|
|
31
|
+
inReplyTo?: string;
|
|
32
|
+
references?: string;
|
|
33
|
+
accountId?: string;
|
|
34
|
+
}
|
|
35
|
+
export interface MailSendConfig {
|
|
36
|
+
/** Base directory for all queues */
|
|
37
|
+
baseDir: string;
|
|
38
|
+
/** SMTP configs keyed by account ID */
|
|
39
|
+
accounts: Record<string, SmtpConfig>;
|
|
40
|
+
/** Log sent messages to sent/ subdirectory */
|
|
41
|
+
logSent?: boolean;
|
|
42
|
+
/** Retry interval in ms (default: 5 minutes) */
|
|
43
|
+
retryIntervalMs?: number;
|
|
44
|
+
/** Default account ID */
|
|
45
|
+
defaultAccount?: string;
|
|
46
|
+
}
|
|
47
|
+
export declare function buildRfc822(msg: MailMessage): string;
|
|
48
|
+
export declare class MailSender {
|
|
49
|
+
private config;
|
|
50
|
+
private processing;
|
|
51
|
+
private retryTimer;
|
|
52
|
+
constructor(config: MailSendConfig);
|
|
53
|
+
private accountDir;
|
|
54
|
+
private queueDir;
|
|
55
|
+
private sentDir;
|
|
56
|
+
private failDir;
|
|
57
|
+
/** Queue a message. Returns the filename. */
|
|
58
|
+
queueMessage(msg: MailMessage): string;
|
|
59
|
+
/** Process pending messages for one account */
|
|
60
|
+
processQueue(accountId: string): Promise<void>;
|
|
61
|
+
/** Process all account queues */
|
|
62
|
+
processAllQueues(): Promise<void>;
|
|
63
|
+
private sendFile;
|
|
64
|
+
/** Start background worker — retries failed, processes queues */
|
|
65
|
+
startWorker(): void;
|
|
66
|
+
private retryFailed;
|
|
67
|
+
stopWorker(): void;
|
|
68
|
+
/** Get queue status per account */
|
|
69
|
+
getStatus(): Record<string, {
|
|
70
|
+
pending: number;
|
|
71
|
+
failed: number;
|
|
72
|
+
}>;
|
|
73
|
+
}
|
|
74
|
+
export declare function initMailSend(config: MailSendConfig): MailSender;
|
|
75
|
+
export declare function getMailSender(): MailSender | null;
|
|
76
|
+
export declare function queueMessage(msg: MailMessage): string;
|
|
77
|
+
//# sourceMappingURL=index.d.ts.map
|