@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,375 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @bobfrankston/mailx-api
|
|
3
|
+
* Express Router with all REST endpoints for the mailx client.
|
|
4
|
+
*/
|
|
5
|
+
import { Router } from "express";
|
|
6
|
+
import { loadSettings, saveSettings, loadAllowlist, saveAllowlist } from "@bobfrankston/mailx-settings";
|
|
7
|
+
import { simpleParser } from "mailparser";
|
|
8
|
+
/** Sanitize HTML email body — strip remote content (images, CSS, scripts, event handlers) */
|
|
9
|
+
function sanitizeHtml(html) {
|
|
10
|
+
let hasRemoteContent = false;
|
|
11
|
+
// Remove <script> tags and content
|
|
12
|
+
let clean = html.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi, "");
|
|
13
|
+
// Remove event handlers (onclick, onload, onerror, etc.)
|
|
14
|
+
clean = clean.replace(/\s+on\w+\s*=\s*("[^"]*"|'[^']*'|[^\s>]+)/gi, "");
|
|
15
|
+
// Replace remote images with placeholder — keep data: and cid: URIs
|
|
16
|
+
clean = clean.replace(/<img\b([^>]*)\bsrc\s*=\s*("[^"]*"|'[^']*')/gi, (match, before, src) => {
|
|
17
|
+
const url = src.slice(1, -1); // remove quotes
|
|
18
|
+
if (url.startsWith("data:") || url.startsWith("cid:"))
|
|
19
|
+
return match;
|
|
20
|
+
hasRemoteContent = true;
|
|
21
|
+
return `<img${before}src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20'%3E%3Crect fill='%23888' width='20' height='20' rx='3'/%3E%3Ctext x='10' y='14' text-anchor='middle' fill='white' font-size='12'%3E⊘%3C/text%3E%3C/svg%3E" data-blocked-src=${src} title="Remote image blocked"`;
|
|
22
|
+
});
|
|
23
|
+
// Block remote CSS via <link> tags
|
|
24
|
+
clean = clean.replace(/<link\b[^>]*rel\s*=\s*["']stylesheet["'][^>]*>/gi, (match) => {
|
|
25
|
+
hasRemoteContent = true;
|
|
26
|
+
return `<!-- blocked: ${match.replace(/--/g, "")} -->`;
|
|
27
|
+
});
|
|
28
|
+
// Block background images in inline styles
|
|
29
|
+
clean = clean.replace(/url\s*\(\s*(['"]?)(https?:\/\/[^)]+)\1\s*\)/gi, (match, _q, url) => {
|
|
30
|
+
hasRemoteContent = true;
|
|
31
|
+
return `url("") /* blocked: ${url} */`;
|
|
32
|
+
});
|
|
33
|
+
// Remove <form> tags
|
|
34
|
+
clean = clean.replace(/<\/?form\b[^>]*>/gi, "");
|
|
35
|
+
// Remove <iframe> tags (within email body)
|
|
36
|
+
clean = clean.replace(/<iframe\b[^>]*>[\s\S]*?<\/iframe>/gi, "");
|
|
37
|
+
return { html: clean, hasRemoteContent };
|
|
38
|
+
}
|
|
39
|
+
export function createApiRouter(db, imapManager) {
|
|
40
|
+
const router = Router();
|
|
41
|
+
router.use((req, res, next) => { res.type("json"); res.set("Cache-Control", "no-store"); next(); });
|
|
42
|
+
// ── Accounts ──
|
|
43
|
+
router.get("/accounts", (req, res) => {
|
|
44
|
+
const accounts = db.getAccounts();
|
|
45
|
+
res.json(accounts);
|
|
46
|
+
});
|
|
47
|
+
// ── Folders ──
|
|
48
|
+
router.get("/folders/:accountId", (req, res) => {
|
|
49
|
+
const folders = db.getFolders(req.params.accountId);
|
|
50
|
+
res.json(folders);
|
|
51
|
+
});
|
|
52
|
+
// ── Messages ──
|
|
53
|
+
// Unified inbox — MUST be before :accountId/:folderId route
|
|
54
|
+
router.get("/messages/unified/inbox", (req, res) => {
|
|
55
|
+
const page = Number(req.query.page) || 1;
|
|
56
|
+
const pageSize = Number(req.query.pageSize) || 50;
|
|
57
|
+
const accounts = db.getAccounts();
|
|
58
|
+
let allItems = [];
|
|
59
|
+
for (const account of accounts) {
|
|
60
|
+
const folders = db.getFolders(account.id);
|
|
61
|
+
const inbox = folders.find(f => f.specialUse === "inbox");
|
|
62
|
+
if (!inbox)
|
|
63
|
+
continue;
|
|
64
|
+
const result = db.getMessages({ accountId: account.id, folderId: inbox.id, page: 1, pageSize: 10000 });
|
|
65
|
+
allItems.push(...result.items);
|
|
66
|
+
}
|
|
67
|
+
// Sort by date descending
|
|
68
|
+
allItems.sort((a, b) => b.date - a.date);
|
|
69
|
+
const total = allItems.length;
|
|
70
|
+
const offset = (page - 1) * pageSize;
|
|
71
|
+
const items = allItems.slice(offset, offset + pageSize);
|
|
72
|
+
res.json({ items, total, page, pageSize });
|
|
73
|
+
});
|
|
74
|
+
// Per-folder messages (after unified to avoid route conflict)
|
|
75
|
+
router.get("/messages/:accountId/:folderId", (req, res) => {
|
|
76
|
+
const result = db.getMessages({
|
|
77
|
+
accountId: req.params.accountId,
|
|
78
|
+
folderId: Number(req.params.folderId),
|
|
79
|
+
page: Number(req.query.page) || 1,
|
|
80
|
+
pageSize: Number(req.query.pageSize) || 50,
|
|
81
|
+
sort: req.query.sort || "date",
|
|
82
|
+
sortDir: req.query.sortDir || "desc",
|
|
83
|
+
search: req.query.search
|
|
84
|
+
});
|
|
85
|
+
res.json(result);
|
|
86
|
+
});
|
|
87
|
+
router.get("/message/:accountId/:uid", async (req, res) => {
|
|
88
|
+
try {
|
|
89
|
+
const { accountId, uid } = req.params;
|
|
90
|
+
let allowRemote = req.query.allowRemote === "true";
|
|
91
|
+
const envelope = db.getMessageByUid(accountId, Number(uid));
|
|
92
|
+
if (!envelope)
|
|
93
|
+
return res.status(404).json({ error: "Message not found" });
|
|
94
|
+
// Load body from store or fetch on demand from IMAP
|
|
95
|
+
let bodyHtml = "";
|
|
96
|
+
let bodyText = "";
|
|
97
|
+
let hasRemoteContent = false;
|
|
98
|
+
let attachments = [];
|
|
99
|
+
const t0 = Date.now();
|
|
100
|
+
const raw = await imapManager.fetchMessageBody(accountId, envelope.folderId, envelope.uid);
|
|
101
|
+
const t1 = Date.now();
|
|
102
|
+
if (raw) {
|
|
103
|
+
const parsed = await simpleParser(raw);
|
|
104
|
+
const t2 = Date.now();
|
|
105
|
+
if (t2 - t0 > 2000)
|
|
106
|
+
console.log(` [slow] Message ${uid}: fetch=${t1 - t0}ms parse=${t2 - t1}ms total=${t2 - t0}ms (${raw.length} bytes)`);
|
|
107
|
+
bodyHtml = parsed.html || "";
|
|
108
|
+
bodyText = parsed.text || "";
|
|
109
|
+
attachments = (parsed.attachments || []).map((a, i) => ({
|
|
110
|
+
id: i,
|
|
111
|
+
filename: a.filename || `attachment-${i}`,
|
|
112
|
+
mimeType: a.contentType || "application/octet-stream",
|
|
113
|
+
size: a.size || 0,
|
|
114
|
+
contentId: a.contentId || ""
|
|
115
|
+
}));
|
|
116
|
+
}
|
|
117
|
+
// Sanitize HTML — block remote content unless allowed or sender is on allow-list
|
|
118
|
+
if (bodyHtml && !allowRemote) {
|
|
119
|
+
const allowList = loadAllowlist();
|
|
120
|
+
const senderAddr = envelope.from?.address || "";
|
|
121
|
+
const senderDomain = senderAddr.split("@")[1] || "";
|
|
122
|
+
const toAddrs = (envelope.to || []).map((a) => a.address);
|
|
123
|
+
const isAllowed = allowList.senders.includes(senderAddr) ||
|
|
124
|
+
allowList.domains.includes(senderDomain) ||
|
|
125
|
+
toAddrs.some((a) => allowList.recipients?.includes(a));
|
|
126
|
+
if (isAllowed) {
|
|
127
|
+
allowRemote = true;
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
const result = sanitizeHtml(bodyHtml);
|
|
131
|
+
bodyHtml = result.html;
|
|
132
|
+
hasRemoteContent = result.hasRemoteContent;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
const message = {
|
|
136
|
+
...envelope,
|
|
137
|
+
bodyHtml,
|
|
138
|
+
bodyText,
|
|
139
|
+
hasRemoteContent,
|
|
140
|
+
attachments
|
|
141
|
+
};
|
|
142
|
+
res.json(message);
|
|
143
|
+
}
|
|
144
|
+
catch (e) {
|
|
145
|
+
res.status(500).json({ error: e.message });
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
router.patch("/message/:accountId/:uid/flags", async (req, res) => {
|
|
149
|
+
const { accountId, uid } = req.params;
|
|
150
|
+
const { flags } = req.body;
|
|
151
|
+
const envelope = db.getMessageByUid(accountId, Number(uid));
|
|
152
|
+
// Local-first: update DB, queue IMAP sync
|
|
153
|
+
await imapManager.updateFlagsLocal(accountId, Number(uid), envelope?.folderId || 0, flags);
|
|
154
|
+
res.json({ ok: true });
|
|
155
|
+
});
|
|
156
|
+
// ── Remote content allow-list ──
|
|
157
|
+
router.post("/settings/allow-remote", (req, res) => {
|
|
158
|
+
const { type, value } = req.body;
|
|
159
|
+
const list = loadAllowlist();
|
|
160
|
+
if (type === "sender" && !list.senders.includes(value)) {
|
|
161
|
+
list.senders.push(value);
|
|
162
|
+
}
|
|
163
|
+
else if (type === "domain" && !list.domains.includes(value)) {
|
|
164
|
+
list.domains.push(value);
|
|
165
|
+
}
|
|
166
|
+
else if (type === "recipient") {
|
|
167
|
+
if (!list.recipients)
|
|
168
|
+
list.recipients = [];
|
|
169
|
+
if (!list.recipients.includes(value))
|
|
170
|
+
list.recipients.push(value);
|
|
171
|
+
}
|
|
172
|
+
saveAllowlist(list);
|
|
173
|
+
console.log(` [allow] Added ${type}: ${value}`);
|
|
174
|
+
res.json({ ok: true });
|
|
175
|
+
});
|
|
176
|
+
// ── Search ──
|
|
177
|
+
router.get("/search", (req, res) => {
|
|
178
|
+
const q = req.query.q || "";
|
|
179
|
+
const page = Number(req.query.page) || 1;
|
|
180
|
+
const pageSize = Number(req.query.pageSize) || 50;
|
|
181
|
+
if (!q.trim())
|
|
182
|
+
return res.json({ items: [], total: 0, page, pageSize });
|
|
183
|
+
const result = db.searchMessages(q, page, pageSize);
|
|
184
|
+
res.json(result);
|
|
185
|
+
});
|
|
186
|
+
router.post("/search/rebuild", (req, res) => {
|
|
187
|
+
const count = db.rebuildSearchIndex();
|
|
188
|
+
console.log(` Rebuilt search index: ${count} messages`);
|
|
189
|
+
res.json({ ok: true, indexed: count });
|
|
190
|
+
});
|
|
191
|
+
// ── Sync status ──
|
|
192
|
+
router.get("/sync/pending", (req, res) => {
|
|
193
|
+
const count = db.getTotalPendingSyncCount();
|
|
194
|
+
res.json({ pending: count });
|
|
195
|
+
});
|
|
196
|
+
// ── Sync ──
|
|
197
|
+
router.post("/sync", async (req, res) => {
|
|
198
|
+
try {
|
|
199
|
+
await imapManager.syncAll();
|
|
200
|
+
res.json({ ok: true });
|
|
201
|
+
}
|
|
202
|
+
catch (e) {
|
|
203
|
+
res.status(500).json({ error: e.message });
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
router.post("/sync/:accountId", async (req, res) => {
|
|
207
|
+
try {
|
|
208
|
+
const folders = await imapManager.syncFolders(req.params.accountId);
|
|
209
|
+
// INBOX first
|
|
210
|
+
folders.sort((a, b) => {
|
|
211
|
+
if (a.specialUse === "inbox")
|
|
212
|
+
return -1;
|
|
213
|
+
if (b.specialUse === "inbox")
|
|
214
|
+
return 1;
|
|
215
|
+
return 0;
|
|
216
|
+
});
|
|
217
|
+
for (const folder of folders) {
|
|
218
|
+
try {
|
|
219
|
+
await imapManager.syncFolder(req.params.accountId, folder.id);
|
|
220
|
+
}
|
|
221
|
+
catch (e) {
|
|
222
|
+
// Non-existent folders handled internally by syncFolder caller
|
|
223
|
+
console.error(` Skipping folder ${folder.path}: ${e.message}`);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
res.json({ ok: true });
|
|
227
|
+
}
|
|
228
|
+
catch (e) {
|
|
229
|
+
res.status(500).json({ error: e.message });
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
// ── Send ──
|
|
233
|
+
router.post("/send", async (req, res) => {
|
|
234
|
+
try {
|
|
235
|
+
const msg = req.body;
|
|
236
|
+
const settings = loadSettings();
|
|
237
|
+
const account = settings.accounts.find(a => a.id === msg.from);
|
|
238
|
+
if (!account)
|
|
239
|
+
return res.status(400).json({ error: `Unknown account: ${msg.from}` });
|
|
240
|
+
// Build RFC 822 message
|
|
241
|
+
const to = msg.to.map(a => a.name ? `${a.name} <${a.address}>` : a.address).join(", ");
|
|
242
|
+
const cc = msg.cc?.map(a => a.name ? `${a.name} <${a.address}>` : a.address).join(", ");
|
|
243
|
+
const bcc = msg.bcc?.map(a => a.name ? `${a.name} <${a.address}>` : a.address).join(", ");
|
|
244
|
+
const headers = [
|
|
245
|
+
`From: ${account.name} <${account.email}>`,
|
|
246
|
+
`To: ${to}`,
|
|
247
|
+
cc ? `Cc: ${cc}` : null,
|
|
248
|
+
bcc ? `Bcc: ${bcc}` : null,
|
|
249
|
+
`Subject: ${msg.subject}`,
|
|
250
|
+
`Date: ${new Date().toUTCString()}`,
|
|
251
|
+
msg.inReplyTo ? `In-Reply-To: ${msg.inReplyTo}` : null,
|
|
252
|
+
msg.references?.length ? `References: ${msg.references.join(" ")}` : null,
|
|
253
|
+
`MIME-Version: 1.0`,
|
|
254
|
+
`Content-Type: text/html; charset=UTF-8`,
|
|
255
|
+
].filter(h => h !== null).join("\r\n");
|
|
256
|
+
const rawMessage = `${headers}\r\n\r\n${msg.bodyHtml || msg.bodyText || ""}`;
|
|
257
|
+
// Local-first: save to sync queue, worker will APPEND to Outbox and send
|
|
258
|
+
imapManager.queueOutgoingLocal(account.id, rawMessage);
|
|
259
|
+
console.log(` Queued locally: ${msg.subject} via ${account.id}`);
|
|
260
|
+
// Record recipient addresses for autocomplete
|
|
261
|
+
for (const addr of msg.to)
|
|
262
|
+
db.recordSentAddress(addr.name, addr.address);
|
|
263
|
+
if (msg.cc)
|
|
264
|
+
for (const addr of msg.cc)
|
|
265
|
+
db.recordSentAddress(addr.name, addr.address);
|
|
266
|
+
if (msg.bcc)
|
|
267
|
+
for (const addr of msg.bcc)
|
|
268
|
+
db.recordSentAddress(addr.name, addr.address);
|
|
269
|
+
res.json({ ok: true, queued: true });
|
|
270
|
+
}
|
|
271
|
+
catch (e) {
|
|
272
|
+
console.error(` Send error: ${e.message}`);
|
|
273
|
+
res.status(500).json({ error: e.message });
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
// ── Delete ──
|
|
277
|
+
router.delete("/message/:accountId/:uid", async (req, res) => {
|
|
278
|
+
try {
|
|
279
|
+
const { accountId, uid } = req.params;
|
|
280
|
+
const envelope = db.getMessageByUid(accountId, Number(uid));
|
|
281
|
+
if (!envelope)
|
|
282
|
+
return res.status(404).json({ error: "Message not found" });
|
|
283
|
+
await imapManager.trashMessage(accountId, envelope.folderId, envelope.uid);
|
|
284
|
+
res.json({ ok: true });
|
|
285
|
+
}
|
|
286
|
+
catch (e) {
|
|
287
|
+
console.error(` Delete error: ${e.message}`);
|
|
288
|
+
res.status(500).json({ error: e.message });
|
|
289
|
+
}
|
|
290
|
+
});
|
|
291
|
+
// ── Undelete (move from Trash back to original folder) ──
|
|
292
|
+
router.post("/message/:accountId/:uid/undelete", async (req, res) => {
|
|
293
|
+
try {
|
|
294
|
+
const { accountId, uid } = req.params;
|
|
295
|
+
const { folderId } = req.body;
|
|
296
|
+
await imapManager.undeleteMessage(accountId, Number(uid), folderId);
|
|
297
|
+
res.json({ ok: true });
|
|
298
|
+
}
|
|
299
|
+
catch (e) {
|
|
300
|
+
console.error(` Undelete error: ${e.message}`);
|
|
301
|
+
res.status(500).json({ error: e.message });
|
|
302
|
+
}
|
|
303
|
+
});
|
|
304
|
+
// ── Drafts ──
|
|
305
|
+
router.post("/draft", async (req, res) => {
|
|
306
|
+
try {
|
|
307
|
+
const { accountId, subject, bodyHtml, bodyText, to, cc, previousDraftUid } = req.body;
|
|
308
|
+
const settings = loadSettings();
|
|
309
|
+
const account = settings.accounts.find(a => a.id === accountId);
|
|
310
|
+
if (!account)
|
|
311
|
+
return res.status(400).json({ error: `Unknown account: ${accountId}` });
|
|
312
|
+
const headers = [
|
|
313
|
+
`From: ${account.name} <${account.email}>`,
|
|
314
|
+
to ? `To: ${to}` : null,
|
|
315
|
+
cc ? `Cc: ${cc}` : null,
|
|
316
|
+
`Subject: ${subject || "(no subject)"}`,
|
|
317
|
+
`Date: ${new Date().toUTCString()}`,
|
|
318
|
+
`MIME-Version: 1.0`,
|
|
319
|
+
`Content-Type: text/html; charset=UTF-8`,
|
|
320
|
+
].filter(h => h !== null).join("\r\n");
|
|
321
|
+
const raw = `${headers}\r\n\r\n${bodyHtml || bodyText || ""}`;
|
|
322
|
+
const uid = await imapManager.saveDraft(accountId, raw, previousDraftUid);
|
|
323
|
+
res.json({ ok: true, draftUid: uid });
|
|
324
|
+
}
|
|
325
|
+
catch (e) {
|
|
326
|
+
console.error(` Draft save error: ${e.message}`);
|
|
327
|
+
res.status(500).json({ error: e.message });
|
|
328
|
+
}
|
|
329
|
+
});
|
|
330
|
+
router.delete("/draft", async (req, res) => {
|
|
331
|
+
try {
|
|
332
|
+
const { accountId, draftUid } = req.body;
|
|
333
|
+
if (accountId && draftUid) {
|
|
334
|
+
await imapManager.deleteDraft(accountId, draftUid);
|
|
335
|
+
}
|
|
336
|
+
res.json({ ok: true });
|
|
337
|
+
}
|
|
338
|
+
catch (e) {
|
|
339
|
+
res.status(500).json({ error: e.message });
|
|
340
|
+
}
|
|
341
|
+
});
|
|
342
|
+
// ── Contacts ──
|
|
343
|
+
router.get("/contacts", (req, res) => {
|
|
344
|
+
const q = req.query.q || "";
|
|
345
|
+
if (q.length < 1)
|
|
346
|
+
return res.json([]);
|
|
347
|
+
const results = db.searchContacts(q);
|
|
348
|
+
res.json(results);
|
|
349
|
+
});
|
|
350
|
+
router.post("/contacts/sync-google", async (req, res) => {
|
|
351
|
+
try {
|
|
352
|
+
await imapManager.syncAllContacts();
|
|
353
|
+
res.json({ ok: true });
|
|
354
|
+
}
|
|
355
|
+
catch (e) {
|
|
356
|
+
res.status(500).json({ error: e.message });
|
|
357
|
+
}
|
|
358
|
+
});
|
|
359
|
+
router.post("/contacts/seed", (req, res) => {
|
|
360
|
+
const added = db.seedContactsFromMessages();
|
|
361
|
+
console.log(` Seeded ${added} contacts from message history`);
|
|
362
|
+
res.json({ ok: true, added });
|
|
363
|
+
});
|
|
364
|
+
// ── Settings ──
|
|
365
|
+
router.get("/settings", (req, res) => {
|
|
366
|
+
const settings = loadSettings();
|
|
367
|
+
res.json(settings);
|
|
368
|
+
});
|
|
369
|
+
router.put("/settings", (req, res) => {
|
|
370
|
+
saveSettings(req.body);
|
|
371
|
+
res.json({ ok: true });
|
|
372
|
+
});
|
|
373
|
+
return router;
|
|
374
|
+
}
|
|
375
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
Copyright (c) 2011-2023 Andris Reinman
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
5
|
+
in the Software without restriction, including without limitation the rights
|
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
furnished to do so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
11
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
12
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
13
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
14
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
15
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
16
|
+
SOFTWARE.
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# Nodemailer
|
|
2
|
+
|
|
3
|
+
[](https://nodemailer.com/about/)
|
|
4
|
+
|
|
5
|
+
Send emails from Node.js – easy as cake! 🍰✉️
|
|
6
|
+
|
|
7
|
+
[](https://nodemailer.com/about/)
|
|
8
|
+
|
|
9
|
+
See [nodemailer.com](https://nodemailer.com/) for documentation and terms.
|
|
10
|
+
|
|
11
|
+
> [!TIP]
|
|
12
|
+
> Check out **[EmailEngine](https://emailengine.app/?utm_source=github-nodemailer&utm_campaign=nodemailer&utm_medium=readme-link)** – a self-hosted email gateway that allows making **REST requests against IMAP and SMTP servers**. EmailEngine also sends webhooks whenever something changes on the registered accounts.\
|
|
13
|
+
> \
|
|
14
|
+
> Using the email accounts registered with EmailEngine, you can receive and [send emails](https://emailengine.app/sending-emails?utm_source=github-nodemailer&utm_campaign=nodemailer&utm_medium=readme-link). EmailEngine supports OAuth2, delayed sends, opens and clicks tracking, bounce detection, etc. All on top of regular email accounts without an external MTA service.
|
|
15
|
+
|
|
16
|
+
## Having an issue?
|
|
17
|
+
|
|
18
|
+
#### First review the docs
|
|
19
|
+
|
|
20
|
+
Documentation for Nodemailer can be found at [nodemailer.com](https://nodemailer.com/about/).
|
|
21
|
+
|
|
22
|
+
#### Nodemailer throws a SyntaxError for "..."
|
|
23
|
+
|
|
24
|
+
You are using an older Node.js version than v6.0. Upgrade Node.js to get support for the spread operator. Nodemailer supports all Node.js versions starting from Node.js@v6.0.0.
|
|
25
|
+
|
|
26
|
+
#### I'm having issues with Gmail
|
|
27
|
+
|
|
28
|
+
Gmail either works well, or it does not work at all. It is probably easier to switch to an alternative service instead of fixing issues with Gmail. If Gmail does not work for you, then don't use it. Read more about it [here](https://nodemailer.com/usage/using-gmail/).
|
|
29
|
+
|
|
30
|
+
#### I get ETIMEDOUT errors
|
|
31
|
+
|
|
32
|
+
Check your firewall settings. Timeout usually occurs when you try to open a connection to a firewalled port either on the server or on your machine. Some ISPs also block email ports to prevent spamming.
|
|
33
|
+
|
|
34
|
+
#### Nodemailer works on one machine but not in another
|
|
35
|
+
|
|
36
|
+
It's either a firewall issue, or your SMTP server blocks authentication attempts from some servers.
|
|
37
|
+
|
|
38
|
+
#### I get TLS errors
|
|
39
|
+
|
|
40
|
+
- If you are running the code on your machine, check your antivirus settings. Antiviruses often mess around with email ports usage. Node.js might not recognize the MITM cert your antivirus is using.
|
|
41
|
+
- Latest Node versions allow only TLS versions 1.2 and higher. Some servers might still use TLS 1.1 or lower. Check Node.js docs on how to get correct TLS support for your app. You can change this with [tls.minVersion](https://nodejs.org/dist/latest-v16.x/docs/api/tls.html#tls_tls_createsecurecontext_options) option
|
|
42
|
+
- You might have the wrong value for the `secure` option. This should be set to `true` only for port 465. For every other port, it should be `false`. Setting it to `false` does not mean that Nodemailer would not use TLS. Nodemailer would still try to upgrade the connection to use TLS if the server supports it.
|
|
43
|
+
- Older Node versions do not fully support the certificate chain of the newest Let's Encrypt certificates. Either set [tls.rejectUnauthorized](https://nodejs.org/dist/latest-v16.x/docs/api/tls.html#tlsconnectoptions-callback) to `false` to skip chain verification or upgrade your Node version
|
|
44
|
+
|
|
45
|
+
```js
|
|
46
|
+
let configOptions = {
|
|
47
|
+
host: 'smtp.example.com',
|
|
48
|
+
port: 587,
|
|
49
|
+
tls: {
|
|
50
|
+
rejectUnauthorized: true,
|
|
51
|
+
minVersion: 'TLSv1.2'
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
#### I have issues with DNS / hosts file
|
|
57
|
+
|
|
58
|
+
Node.js uses [c-ares](https://nodejs.org/en/docs/meta/topics/dependencies/#c-ares) to resolve domain names, not the DNS library provided by the system, so if you have some custom DNS routing set up, it might be ignored. Nodemailer runs [dns.resolve4()](https://nodejs.org/dist/latest-v16.x/docs/api/dns.html#dnsresolve4hostname-options-callback) and [dns.resolve6()](https://nodejs.org/dist/latest-v16.x/docs/api/dns.html#dnsresolve6hostname-options-callback) to resolve hostname into an IP address. If both calls fail, then Nodemailer will fall back to [dns.lookup()](https://nodejs.org/dist/latest-v16.x/docs/api/dns.html#dnslookuphostname-options-callback). If this does not work for you, you can hard code the IP address into the configuration like shown below. In that case, Nodemailer would not perform any DNS lookups.
|
|
59
|
+
|
|
60
|
+
```js
|
|
61
|
+
let configOptions = {
|
|
62
|
+
host: '1.2.3.4',
|
|
63
|
+
port: 465,
|
|
64
|
+
secure: true,
|
|
65
|
+
tls: {
|
|
66
|
+
// must provide server name, otherwise TLS certificate check will fail
|
|
67
|
+
servername: 'example.com'
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
#### I have an issue with TypeScript types
|
|
73
|
+
|
|
74
|
+
Nodemailer has official support for Node.js only. For anything related to TypeScript, you need to directly contact the authors of the [type definitions](https://www.npmjs.com/package/@types/nodemailer).
|
|
75
|
+
|
|
76
|
+
#### I have a different problem
|
|
77
|
+
|
|
78
|
+
If you are having issues with Nodemailer, then the best way to find help would be [Stack Overflow](https://stackoverflow.com/search?q=nodemailer) or revisit the [docs](https://nodemailer.com/about/).
|
|
79
|
+
|
|
80
|
+
### License
|
|
81
|
+
|
|
82
|
+
Nodemailer is licensed under the **MIT No Attribution license**
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
The Nodemailer logo was designed by [Sven Kristjansen](https://www.behance.net/kristjansen).
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
-----BEGIN PGP SIGNED MESSAGE-----
|
|
2
|
+
Hash: SHA256
|
|
3
|
+
|
|
4
|
+
Contact: mailto:andris@reinman.eu
|
|
5
|
+
Encryption: https://keys.openpgp.org/vks/v1/by-fingerprint/5D952A46E1D8C931F6364E01DC6C83F4D584D364
|
|
6
|
+
Preferred-Languages: en, et
|
|
7
|
+
-----BEGIN PGP SIGNATURE-----
|
|
8
|
+
|
|
9
|
+
iQIzBAEBCAAdFiEEXZUqRuHYyTH2Nk4B3GyD9NWE02QFAmFDnUgACgkQ3GyD9NWE
|
|
10
|
+
02RqUA/+MM3afmRYq874C7wp+uN6dTMCvUX5g5zqBZ2yKpFr46L+PYvM7o8TMm5h
|
|
11
|
+
hmLT2I1zZmi+xezOL3zHFizaw0tKkZIz9cWl3Jrgs0FLp0zOsSz1xucp9Q2tYM/Q
|
|
12
|
+
vbiP6ys0gbim4tkDGRmZOEiO23s0BuRnmHt7vZg210O+D105Yd8/Ohzbj6PSLBO5
|
|
13
|
+
W1tA7Xw5t0FQ14NNH5+MKyDIKoCX12n0FmrC6qLTXeojf291UgKhCUPda3LIGTmx
|
|
14
|
+
mTXz0y68149Mw+JikRCYP8HfGRY9eA4XZrYXF7Bl2T9OJpKD3JAH+69P3xBw19Gn
|
|
15
|
+
Csaw3twu8P1bxoVGjY4KRrBOp68W8TwZYjWVWbqY6oV8hb/JfrMxa+kaSxRuloFs
|
|
16
|
+
oL6+phrDSPTWdOj2LlEDBJbPOMeDFzIlsBBcJ/JHCEHTvlHl7LoWr3YuWce9PUwl
|
|
17
|
+
4r3JUovvaeuJxLgC0vu3WCB3Jeocsl3SreqNkrVc1IjvkSomn3YGm5nCNAd/2F0V
|
|
18
|
+
exCGRk/8wbkSjAY38GwQ8K/VuFsefWN3L9sVwIMAMu88KFCAN+GzVFiwvyIXehF5
|
|
19
|
+
eogP9mIXzdQ5YReQjUjApOzGz54XnDyv9RJ3sdvMHosLP+IOg+0q5t9agWv6aqSR
|
|
20
|
+
2HzCpiQnH/gmM5NS0AU4Koq/L7IBeLu1B8+61/+BiHgZJJmPdgU=
|
|
21
|
+
=BUZr
|
|
22
|
+
-----END PGP SIGNATURE-----
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const globals = require('globals');
|
|
4
|
+
|
|
5
|
+
module.exports = [
|
|
6
|
+
{
|
|
7
|
+
ignores: ['node_modules/**', 'coverage/**', 'dist/**', 'build/**', '.nyc_output/**']
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
files: ['**/*.js'],
|
|
11
|
+
languageOptions: {
|
|
12
|
+
ecmaVersion: 2017,
|
|
13
|
+
sourceType: 'script',
|
|
14
|
+
globals: Object.assign({}, globals.node, globals.es2017, {
|
|
15
|
+
it: true,
|
|
16
|
+
describe: true,
|
|
17
|
+
beforeEach: true,
|
|
18
|
+
afterEach: true
|
|
19
|
+
})
|
|
20
|
+
},
|
|
21
|
+
rules: {
|
|
22
|
+
// Error detection
|
|
23
|
+
'for-direction': 'error',
|
|
24
|
+
'no-await-in-loop': 'error',
|
|
25
|
+
'no-div-regex': 'error',
|
|
26
|
+
eqeqeq: 'error',
|
|
27
|
+
'dot-notation': 'error',
|
|
28
|
+
curly: 'error',
|
|
29
|
+
'no-fallthrough': 'error',
|
|
30
|
+
'no-unused-expressions': [
|
|
31
|
+
'error',
|
|
32
|
+
{
|
|
33
|
+
allowShortCircuit: true
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
'no-unused-vars': [
|
|
37
|
+
'error',
|
|
38
|
+
{
|
|
39
|
+
varsIgnorePattern: '^_',
|
|
40
|
+
argsIgnorePattern: '^_',
|
|
41
|
+
caughtErrorsIgnorePattern: '^_'
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
'handle-callback-err': 'error',
|
|
45
|
+
'no-new': 'error',
|
|
46
|
+
'new-cap': 'error',
|
|
47
|
+
'no-eval': 'error',
|
|
48
|
+
'no-invalid-this': 'error',
|
|
49
|
+
radix: ['error', 'always'],
|
|
50
|
+
'no-use-before-define': ['error', 'nofunc'],
|
|
51
|
+
'callback-return': ['error', ['callback', 'cb', 'done']],
|
|
52
|
+
'no-regex-spaces': 'error',
|
|
53
|
+
'no-empty': 'error',
|
|
54
|
+
'no-duplicate-case': 'error',
|
|
55
|
+
'no-empty-character-class': 'error',
|
|
56
|
+
'no-redeclare': 'off', // Disabled per project preference
|
|
57
|
+
'block-scoped-var': 'error',
|
|
58
|
+
'no-sequences': 'error',
|
|
59
|
+
'no-throw-literal': 'error',
|
|
60
|
+
'no-useless-call': 'error',
|
|
61
|
+
'no-useless-concat': 'error',
|
|
62
|
+
'no-void': 'error',
|
|
63
|
+
yoda: 'error',
|
|
64
|
+
'no-undef': 'error',
|
|
65
|
+
'global-require': 'error',
|
|
66
|
+
'no-var': 'error',
|
|
67
|
+
'no-bitwise': 'error',
|
|
68
|
+
'no-lonely-if': 'error',
|
|
69
|
+
'no-mixed-spaces-and-tabs': 'error',
|
|
70
|
+
'arrow-body-style': ['error', 'as-needed'],
|
|
71
|
+
'arrow-parens': ['error', 'as-needed'],
|
|
72
|
+
'prefer-arrow-callback': 'error',
|
|
73
|
+
'object-shorthand': 'error',
|
|
74
|
+
'prefer-spread': 'error',
|
|
75
|
+
'no-prototype-builtins': 'off', // Disabled per project preference
|
|
76
|
+
strict: ['error', 'global'],
|
|
77
|
+
|
|
78
|
+
// Disable all formatting rules (handled by Prettier)
|
|
79
|
+
indent: 'off',
|
|
80
|
+
quotes: 'off',
|
|
81
|
+
'linebreak-style': 'off',
|
|
82
|
+
semi: 'off',
|
|
83
|
+
'quote-props': 'off',
|
|
84
|
+
'comma-dangle': 'off',
|
|
85
|
+
'comma-style': 'off'
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
];
|