@bobfrankston/mailx 1.0.466 → 1.0.500
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/.globalize.json5 +25 -0
- package/README.md +17 -420
- package/bin/mailx.js +87 -84
- package/bin/mailx.js.map +1 -1
- package/bin/mailx.ts +87 -84
- package/client/android.html +5 -5
- package/client/app.js +42 -38
- package/client/components/folder-tree.js +7 -5
- package/client/components/message-list.js +485 -448
- package/client/components/message-viewer.js +36 -41
- package/client/index.html +8 -8
- package/client/lib/message-state.js +46 -65
- package/index.js +59 -0
- package/package.json +12 -114
- package/packages/mailx-send/mailsend/{package-lock.json → node_modules/.package-lock.json} +0 -16
- 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-server/index.js +1 -1
- package/packages/mailx-settings/cloud.js +12 -7
- package/packages/mailx-settings/index.js +22 -1
- package/client/.gitattributes +0 -10
- package/client/app.js.map +0 -1
- package/client/app.ts +0 -3190
- package/client/components/address-book.js.map +0 -1
- package/client/components/address-book.ts +0 -204
- package/client/components/alarms.js.map +0 -1
- package/client/components/alarms.ts +0 -276
- package/client/components/calendar-sidebar.js.map +0 -1
- package/client/components/calendar-sidebar.ts +0 -474
- package/client/components/calendar.js.map +0 -1
- package/client/components/calendar.ts +0 -211
- package/client/components/context-menu.js.map +0 -1
- package/client/components/context-menu.ts +0 -95
- package/client/components/folder-picker.js.map +0 -1
- package/client/components/folder-picker.ts +0 -127
- package/client/components/folder-tree.js.map +0 -1
- package/client/components/folder-tree.ts +0 -1069
- package/client/components/message-list.js.map +0 -1
- package/client/components/message-list.ts +0 -1129
- package/client/components/message-viewer.js.map +0 -1
- package/client/components/message-viewer.ts +0 -1257
- package/client/components/outbox-view.js.map +0 -1
- package/client/components/outbox-view.ts +0 -102
- package/client/components/tasks.js.map +0 -1
- package/client/components/tasks.ts +0 -234
- package/client/compose/compose.js.map +0 -1
- package/client/compose/compose.ts +0 -1231
- package/client/compose/editor.js.map +0 -1
- package/client/compose/editor.ts +0 -599
- package/client/compose/ghost-text.js.map +0 -1
- package/client/compose/ghost-text.ts +0 -140
- package/client/lib/android-bootstrap.js.map +0 -1
- package/client/lib/android-bootstrap.ts +0 -9
- package/client/lib/api-client.js.map +0 -1
- package/client/lib/api-client.ts +0 -439
- package/client/lib/local-service.js.map +0 -1
- package/client/lib/local-service.ts +0 -646
- package/client/lib/local-store.js.map +0 -1
- package/client/lib/local-store.ts +0 -283
- package/client/lib/message-state.js.map +0 -1
- package/client/lib/message-state.ts +0 -160
- package/client/tsconfig.json +0 -19
- package/packages/mailx-api/.gitattributes +0 -10
- package/packages/mailx-api/index.d.ts.map +0 -1
- package/packages/mailx-api/index.js.map +0 -1
- package/packages/mailx-api/index.ts +0 -283
- package/packages/mailx-api/tsconfig.json +0 -9
- package/packages/mailx-compose/.gitattributes +0 -10
- package/packages/mailx-compose/index.d.ts.map +0 -1
- package/packages/mailx-compose/index.js.map +0 -1
- package/packages/mailx-compose/index.ts +0 -85
- package/packages/mailx-compose/tsconfig.json +0 -9
- package/packages/mailx-host/.gitattributes +0 -10
- package/packages/mailx-host/index.d.ts +0 -21
- package/packages/mailx-host/index.d.ts.map +0 -1
- package/packages/mailx-host/index.js +0 -29
- package/packages/mailx-host/index.js.map +0 -1
- package/packages/mailx-host/index.ts +0 -38
- package/packages/mailx-host/package.json +0 -23
- package/packages/mailx-host/tsconfig.json +0 -9
- package/packages/mailx-host/types-shim.d.ts +0 -14
- package/packages/mailx-imap/.gitattributes +0 -10
- package/packages/mailx-imap/index.d.ts +0 -442
- package/packages/mailx-imap/index.d.ts.map +0 -1
- package/packages/mailx-imap/index.js +0 -3684
- package/packages/mailx-imap/index.js.map +0 -1
- package/packages/mailx-imap/index.ts +0 -3652
- package/packages/mailx-imap/package-lock.json +0 -131
- package/packages/mailx-imap/package.json +0 -28
- package/packages/mailx-imap/providers/gmail-api.d.ts +0 -8
- package/packages/mailx-imap/providers/gmail-api.d.ts.map +0 -1
- package/packages/mailx-imap/providers/gmail-api.js +0 -8
- package/packages/mailx-imap/providers/gmail-api.js.map +0 -1
- package/packages/mailx-imap/providers/gmail-api.ts +0 -8
- package/packages/mailx-imap/providers/outlook-api.ts +0 -7
- package/packages/mailx-imap/providers/types.d.ts +0 -9
- package/packages/mailx-imap/providers/types.d.ts.map +0 -1
- package/packages/mailx-imap/providers/types.js +0 -9
- package/packages/mailx-imap/providers/types.js.map +0 -1
- package/packages/mailx-imap/providers/types.ts +0 -9
- package/packages/mailx-imap/tsconfig.json +0 -9
- package/packages/mailx-imap/tsconfig.tsbuildinfo +0 -1
- package/packages/mailx-send/.gitattributes +0 -10
- package/packages/mailx-send/cli-queue.d.ts.map +0 -1
- package/packages/mailx-send/cli-queue.js.map +0 -1
- package/packages/mailx-send/cli-queue.ts +0 -62
- package/packages/mailx-send/cli-send.d.ts.map +0 -1
- package/packages/mailx-send/cli-send.js.map +0 -1
- package/packages/mailx-send/cli-send.ts +0 -83
- package/packages/mailx-send/cli.d.ts.map +0 -1
- package/packages/mailx-send/cli.js.map +0 -1
- package/packages/mailx-send/cli.ts +0 -126
- package/packages/mailx-send/index.d.ts.map +0 -1
- package/packages/mailx-send/index.js.map +0 -1
- package/packages/mailx-send/index.ts +0 -333
- package/packages/mailx-send/mailsend/cli.d.ts.map +0 -1
- package/packages/mailx-send/mailsend/cli.js.map +0 -1
- package/packages/mailx-send/mailsend/cli.ts +0 -81
- package/packages/mailx-send/mailsend/index.d.ts.map +0 -1
- package/packages/mailx-send/mailsend/index.js.map +0 -1
- package/packages/mailx-send/mailsend/index.ts +0 -333
- package/packages/mailx-send/mailsend/tsconfig.json +0 -21
- package/packages/mailx-send/package-lock.json +0 -65
- package/packages/mailx-send/tsconfig.json +0 -21
- package/packages/mailx-server/.gitattributes +0 -10
- package/packages/mailx-server/index.d.ts.map +0 -1
- package/packages/mailx-server/index.js.map +0 -1
- package/packages/mailx-server/index.ts +0 -429
- package/packages/mailx-server/tsconfig.json +0 -9
- package/packages/mailx-settings/.gitattributes +0 -10
- package/packages/mailx-settings/cloud.d.ts.map +0 -1
- package/packages/mailx-settings/cloud.js.map +0 -1
- package/packages/mailx-settings/cloud.ts +0 -388
- package/packages/mailx-settings/index.d.ts.map +0 -1
- package/packages/mailx-settings/index.js.map +0 -1
- package/packages/mailx-settings/index.ts +0 -892
- package/packages/mailx-settings/tsconfig.json +0 -9
- package/packages/mailx-store/.gitattributes +0 -10
- package/packages/mailx-store/db.d.ts.map +0 -1
- package/packages/mailx-store/db.js.map +0 -1
- package/packages/mailx-store/db.ts +0 -2007
- package/packages/mailx-store/file-store.d.ts.map +0 -1
- package/packages/mailx-store/file-store.js.map +0 -1
- package/packages/mailx-store/file-store.ts +0 -82
- package/packages/mailx-store/index.d.ts.map +0 -1
- package/packages/mailx-store/index.js.map +0 -1
- package/packages/mailx-store/index.ts +0 -7
- package/packages/mailx-store/tsconfig.json +0 -9
- package/packages/mailx-types/.gitattributes +0 -10
- package/packages/mailx-types/index.d.ts.map +0 -1
- package/packages/mailx-types/index.js.map +0 -1
- package/packages/mailx-types/index.ts +0 -498
- package/packages/mailx-types/tsconfig.json +0 -9
package/bin/mailx.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* rmfmail -- email client
|
|
4
4
|
*
|
|
5
5
|
* Usage:
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
6
|
+
* rmfmail Start service + open in msger (IPC, no TCP)
|
|
7
|
+
* rmfmail --server Start Express HTTP server (dev/remote)
|
|
8
|
+
* rmfmail --no-browser Start server only (headless)
|
|
9
|
+
* rmfmail --verbose Show console output (default: log file only)
|
|
10
|
+
* rmfmail --email <addr> First-time setup with email (skips prompt)
|
|
11
|
+
* rmfmail --import <file> Import accounts.jsonc into GDrive and merge
|
|
12
|
+
* rmfmail -v / --version Show version and exit
|
|
13
|
+
* rmfmail -kill Kill running rmfmail processes
|
|
14
|
+
* rmfmail -setup Interactive first-time setup (CLI)
|
|
15
|
+
* rmfmail -test Test IMAP/SMTP connectivity
|
|
16
|
+
* rmfmail -rebuild Wipe local cache, re-sync from IMAP
|
|
17
|
+
* rmfmail -repair Re-sync metadata (fix corrupt subjects) keeping .eml files
|
|
18
|
+
* rmfmail -reauth Clear cached OAuth tokens; next start re-consents
|
|
19
19
|
* (use when new Google scopes have been added)
|
|
20
20
|
*/
|
|
21
21
|
import fs from "node:fs";
|
|
@@ -24,7 +24,7 @@ import os from "node:os";
|
|
|
24
24
|
import net from "node:net";
|
|
25
25
|
import { ports } from "@bobfrankston/miscinfo";
|
|
26
26
|
import { showMessageBox, showService, setAppName, setAppIcon } from "@bobfrankston/mailx-host";
|
|
27
|
-
setAppName("
|
|
27
|
+
setAppName("rmfmail");
|
|
28
28
|
// Prefer the .ico (Windows Explorer / taskbar-pin shortcut uses the embedded
|
|
29
29
|
// icon resource of the pinned exe, or a Windows icon resource referenced
|
|
30
30
|
// via PKEY_AppUserModel_RelaunchIconResource — PNG can't play either role).
|
|
@@ -50,7 +50,7 @@ const __selfVersion = (() => {
|
|
|
50
50
|
return "unknown";
|
|
51
51
|
}
|
|
52
52
|
})();
|
|
53
|
-
const __instanceFile = path.join(process.env.USERPROFILE || process.env.HOME || ".", ".
|
|
53
|
+
const __instanceFile = path.join(process.env.USERPROFILE || process.env.HOME || ".", ".rmfmail", "instance.json");
|
|
54
54
|
function readInstanceFile() {
|
|
55
55
|
try {
|
|
56
56
|
const raw = fs.readFileSync(__instanceFile, "utf-8");
|
|
@@ -83,8 +83,8 @@ function pidAlive(pid) {
|
|
|
83
83
|
return false;
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
-
/** True only if `pid` is alive AND its command line looks like a
|
|
87
|
-
* process. Windows reuses PIDs aggressively — a
|
|
86
|
+
/** True only if `pid` is alive AND its command line looks like a rmfmail node
|
|
87
|
+
* process. Windows reuses PIDs aggressively — a rmfmail that exited without
|
|
88
88
|
* running its cleanup handler can leave behind an instance.json whose PID
|
|
89
89
|
* has since been recycled by some other app (e.g. Creative Cloud UI Helper),
|
|
90
90
|
* making bare pidAlive() return true and wedging every subsequent `mailx`
|
|
@@ -98,7 +98,7 @@ function pidIsMailx(pid) {
|
|
|
98
98
|
try {
|
|
99
99
|
const { execSync } = require("node:child_process");
|
|
100
100
|
const out = execSync(`powershell -NoProfile -Command "(Get-CimInstance Win32_Process -Filter \\"ProcessId=${pid}\\").CommandLine"`, { encoding: "utf-8", stdio: ["ignore", "pipe", "ignore"], windowsHide: true }).toString();
|
|
101
|
-
return /mailx[\\\/](?:bin|packages|app)|mailx-server/i.test(out);
|
|
101
|
+
return /(?:rmfmail|mailx)[\\\/](?:bin|packages|app)|mailx-server/i.test(out);
|
|
102
102
|
}
|
|
103
103
|
catch {
|
|
104
104
|
return false;
|
|
@@ -116,7 +116,7 @@ if (!isDaemon && !__isCommandInvocation) {
|
|
|
116
116
|
const inst = readInstanceFile();
|
|
117
117
|
if (inst && pidIsMailx(inst.pid)) {
|
|
118
118
|
if (inst.version !== __selfVersion) {
|
|
119
|
-
console.log(`
|
|
119
|
+
console.log(`rmfmail: upgrading running daemon (PID ${inst.pid}) from v${inst.version} → v${__selfVersion}`);
|
|
120
120
|
try {
|
|
121
121
|
process.kill(inst.pid, "SIGTERM");
|
|
122
122
|
}
|
|
@@ -138,7 +138,7 @@ if (!isDaemon && !__isCommandInvocation) {
|
|
|
138
138
|
else {
|
|
139
139
|
// Same version already running — nothing to do. Print so the user
|
|
140
140
|
// knows why `mailx` seems to have done nothing.
|
|
141
|
-
console.log(`
|
|
141
|
+
console.log(`rmfmail v${__selfVersion} is already running (PID ${inst.pid}). Use rmfmail -kill to stop it.`);
|
|
142
142
|
process.exit(0);
|
|
143
143
|
}
|
|
144
144
|
}
|
|
@@ -174,12 +174,12 @@ for (const arg of args) {
|
|
|
174
174
|
const flag = arg.replace(/^--?/, "");
|
|
175
175
|
if (arg.startsWith("-") && !knownFlags.includes(flag)) {
|
|
176
176
|
console.error(`Unknown option: ${arg}`);
|
|
177
|
-
console.error("Usage:
|
|
177
|
+
console.error("Usage: rmfmail [-verbose] [-kill] [-rebuild] [-v] [-setup]");
|
|
178
178
|
process.exit(1);
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
181
|
function log(...msg) { if (verbose)
|
|
182
|
-
console.log("[
|
|
182
|
+
console.log("[rmfmail]", ...msg); }
|
|
183
183
|
/** Detect whether we're running with administrator / root privileges.
|
|
184
184
|
* Windows: `net session` requires admin — succeeds silently when elevated,
|
|
185
185
|
* errors "Access is denied" otherwise. Linux/Mac: check process uid.
|
|
@@ -205,11 +205,11 @@ function isElevated() {
|
|
|
205
205
|
* safety. Caller decides what to do with "Continue anyway". */
|
|
206
206
|
async function warnElevated() {
|
|
207
207
|
const res = await showMessageBox({
|
|
208
|
-
title: "
|
|
209
|
-
message: "
|
|
208
|
+
title: "rmfmail — elevated run not recommended",
|
|
209
|
+
message: "rmfmail is running with Administrator privileges.\n\n" +
|
|
210
210
|
"This can corrupt the per-user WebView2 profile at\n" +
|
|
211
211
|
"%LOCALAPPDATA%\\msger\\webview2\\ and create admin-owned files\n" +
|
|
212
|
-
"under ~/.
|
|
212
|
+
"under ~/.rmfmail/ that later non-admin runs can't write to\n" +
|
|
213
213
|
"(SQLite db, tokens, config).\n\n" +
|
|
214
214
|
"Quit, relaunch from a normal shell, and only use admin if\n" +
|
|
215
215
|
"you specifically know you need it. To bypass this warning\n" +
|
|
@@ -220,9 +220,9 @@ async function warnElevated() {
|
|
|
220
220
|
});
|
|
221
221
|
return res.button;
|
|
222
222
|
}
|
|
223
|
-
// Kill any running
|
|
223
|
+
// Kill any running rmfmail server
|
|
224
224
|
if (hasFlag("kill")) {
|
|
225
|
-
log("Killing
|
|
225
|
+
log("Killing rmfmail processes...");
|
|
226
226
|
const { execSync } = await import("node:child_process");
|
|
227
227
|
let killed = 0;
|
|
228
228
|
// Try graceful exit first
|
|
@@ -247,13 +247,16 @@ if (hasFlag("kill")) {
|
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
249
|
catch { /* no process on port */ }
|
|
250
|
-
// Kill any node.exe running
|
|
250
|
+
// Kill any node.exe running rmfmail (server or IPC service). Match
|
|
251
|
+
// the legacy `mailx` path too — source tree dir is still
|
|
252
|
+
// `Y:\dev\email\mailx\` and per-app exes from older installs are
|
|
253
|
+
// under `%LOCALAPPDATA%\mailx\` until those get cleaned up.
|
|
251
254
|
try {
|
|
252
|
-
const ps = execSync(`powershell -NoProfile -Command "Get-CimInstance Win32_Process -Filter \\"name='node.exe'\\" | Where-Object { $_.CommandLine -match 'mailx-server|mailx\\\\packages|mailx\\\\bin' } | Select-Object -ExpandProperty ProcessId"`, { encoding: "utf-8" }).trim();
|
|
255
|
+
const ps = execSync(`powershell -NoProfile -Command "Get-CimInstance Win32_Process -Filter \\"name='node.exe'\\" | Where-Object { $_.CommandLine -match '(rmfmail|mailx)-server|(rmfmail|mailx)\\\\packages|(rmfmail|mailx)\\\\bin' } | Select-Object -ExpandProperty ProcessId"`, { encoding: "utf-8" }).trim();
|
|
253
256
|
for (const pid of ps.split("\n").map(s => s.trim()).filter(s => /^\d+$/.test(s))) {
|
|
254
257
|
try {
|
|
255
258
|
execSync(`taskkill /F /PID ${pid}`, { stdio: "pipe" });
|
|
256
|
-
console.log(`Killed PID ${pid} (
|
|
259
|
+
console.log(`Killed PID ${pid} (rmfmail node process)`);
|
|
257
260
|
killed++;
|
|
258
261
|
}
|
|
259
262
|
catch { /* */ }
|
|
@@ -263,15 +266,15 @@ if (hasFlag("kill")) {
|
|
|
263
266
|
// Kill orphaned msgernative.exe windows. When the node process dies
|
|
264
267
|
// without cascade-killing its WebView child (old crash, forced
|
|
265
268
|
// taskkill, etc.), the msgernative.exe stays on screen and looks
|
|
266
|
-
// like a live
|
|
267
|
-
// Scoped to exes launched for
|
|
268
|
-
// touch msger windows started by other apps (msga, bbs, etc.).
|
|
269
|
+
// like a live rmfmail. rmfmail -kill should leave no trace.
|
|
270
|
+
// Scoped to exes launched for rmfmail by filtering CommandLine —
|
|
271
|
+
// don't touch msger windows started by other apps (msga, bbs, etc.).
|
|
269
272
|
try {
|
|
270
|
-
const ps = execSync(`powershell -NoProfile -Command "Get-CimInstance Win32_Process -Filter \\"name='msgernative.exe'\\" | Where-Object { $_.CommandLine -match 'mailx' -or $_.Path -match 'mailx' } | Select-Object -ExpandProperty ProcessId"`, { encoding: "utf-8" }).trim();
|
|
273
|
+
const ps = execSync(`powershell -NoProfile -Command "Get-CimInstance Win32_Process -Filter \\"name='msgernative.exe'\\" | Where-Object { $_.CommandLine -match 'rmfmail|mailx' -or $_.Path -match 'rmfmail|mailx' } | Select-Object -ExpandProperty ProcessId"`, { encoding: "utf-8" }).trim();
|
|
271
274
|
for (const pid of ps.split("\n").map(s => s.trim()).filter(s => /^\d+$/.test(s))) {
|
|
272
275
|
try {
|
|
273
276
|
execSync(`taskkill /F /PID ${pid}`, { stdio: "pipe" });
|
|
274
|
-
console.log(`Killed PID ${pid} (
|
|
277
|
+
console.log(`Killed PID ${pid} (rmfmail msgernative/WebView)`);
|
|
275
278
|
killed++;
|
|
276
279
|
}
|
|
277
280
|
catch { /* */ }
|
|
@@ -288,7 +291,7 @@ if (hasFlag("kill")) {
|
|
|
288
291
|
catch { /* */ }
|
|
289
292
|
}
|
|
290
293
|
// Clean up stale SQLite WAL/SHM files
|
|
291
|
-
const mailxDir = path.join(process.env.USERPROFILE || process.env.HOME || ".", ".
|
|
294
|
+
const mailxDir = path.join(process.env.USERPROFILE || process.env.HOME || ".", ".rmfmail");
|
|
292
295
|
for (const ext of ["mailx.db-shm", "mailx.db-wal"]) {
|
|
293
296
|
const p = path.join(mailxDir, ext);
|
|
294
297
|
try {
|
|
@@ -304,7 +307,7 @@ if (hasFlag("kill")) {
|
|
|
304
307
|
// is the user's escape hatch; leave no lock behind.
|
|
305
308
|
clearInstanceFile();
|
|
306
309
|
if (killed === 0)
|
|
307
|
-
console.log("No
|
|
310
|
+
console.log("No rmfmail processes found");
|
|
308
311
|
process.exit(0);
|
|
309
312
|
}
|
|
310
313
|
// Re-auth: clear cached OAuth tokens so the next start forces a fresh
|
|
@@ -337,7 +340,7 @@ if (hasFlag("reauth")) {
|
|
|
337
340
|
}
|
|
338
341
|
console.log(cleared === 0
|
|
339
342
|
? "No cached tokens found."
|
|
340
|
-
: `Cleared ${cleared} cached token(s). Next '
|
|
343
|
+
: `Cleared ${cleared} cached token(s). Next 'rmfmail' start will open a browser OAuth consent so the new scopes (tasks, full contacts) get granted.`);
|
|
341
344
|
process.exit(0);
|
|
342
345
|
}
|
|
343
346
|
// Rebuild: wipe DB + message store, keep accounts/settings
|
|
@@ -345,7 +348,7 @@ if (rebuildMode) {
|
|
|
345
348
|
const { getConfigDir, getStorePath } = await import("@bobfrankston/mailx-settings");
|
|
346
349
|
const dbDir = getConfigDir();
|
|
347
350
|
const storePath = getStorePath();
|
|
348
|
-
console.log("Rebuilding
|
|
351
|
+
console.log("Rebuilding rmfmail local cache...");
|
|
349
352
|
console.log(" Accounts and settings will be preserved.");
|
|
350
353
|
// Remove DB files
|
|
351
354
|
for (const f of ["mailx.db", "mailx.db-wal", "mailx.db-shm"]) {
|
|
@@ -360,7 +363,7 @@ if (rebuildMode) {
|
|
|
360
363
|
fs.rmSync(storePath, { recursive: true });
|
|
361
364
|
console.log(` Deleted message store`);
|
|
362
365
|
}
|
|
363
|
-
console.log(" Rebuild complete. Run '
|
|
366
|
+
console.log(" Rebuild complete. Run 'rmfmail' to start fresh.");
|
|
364
367
|
process.exit(0);
|
|
365
368
|
}
|
|
366
369
|
// Repair: re-sync metadata (subjects, flags, envelopes) without deleting stored .eml files
|
|
@@ -369,10 +372,10 @@ if (repairMode) {
|
|
|
369
372
|
const dbDir = getConfigDir();
|
|
370
373
|
const dbPath = path.join(dbDir, "mailx.db");
|
|
371
374
|
if (!fs.existsSync(dbPath)) {
|
|
372
|
-
console.error("No database found. Run '
|
|
375
|
+
console.error("No database found. Run 'rmfmail' first to create one.");
|
|
373
376
|
process.exit(1);
|
|
374
377
|
}
|
|
375
|
-
console.log("Repairing
|
|
378
|
+
console.log("Repairing rmfmail metadata...");
|
|
376
379
|
console.log(" Message bodies (.eml files) will be preserved.");
|
|
377
380
|
console.log(" Clearing message metadata for re-sync...");
|
|
378
381
|
// Dynamic require — better-sqlite3 is a native module, not typed in bin/
|
|
@@ -387,16 +390,16 @@ if (repairMode) {
|
|
|
387
390
|
db.exec("UPDATE folders SET total = 0, unread = 0");
|
|
388
391
|
db.close();
|
|
389
392
|
console.log(` Cleared ${count} message entries. Folder sync state reset.`);
|
|
390
|
-
console.log(" Run '
|
|
393
|
+
console.log(" Run 'rmfmail' to re-sync from IMAP with correct encoding.");
|
|
391
394
|
process.exit(0);
|
|
392
395
|
}
|
|
393
396
|
// Import accounts from a local file into GDrive
|
|
394
397
|
if (importMode) {
|
|
395
398
|
const importPath = args.find(a => !a.startsWith("-"));
|
|
396
399
|
if (!importPath) {
|
|
397
|
-
console.error("Usage:
|
|
400
|
+
console.error("Usage: rmfmail --import <path-to-accounts.jsonc>");
|
|
398
401
|
console.error(" Reads accounts from a local file and saves to Google Drive.");
|
|
399
|
-
console.error(" Example:
|
|
402
|
+
console.error(" Example: rmfmail --import ~/OneDrive/home/.rmfmail/accounts.jsonc");
|
|
400
403
|
process.exit(1);
|
|
401
404
|
}
|
|
402
405
|
const { parse: parseJsonc } = await import("jsonc-parser");
|
|
@@ -433,7 +436,7 @@ if (importMode) {
|
|
|
433
436
|
if (data?.name)
|
|
434
437
|
wrapper.name = data.name;
|
|
435
438
|
await saveAccounts(merged);
|
|
436
|
-
console.log(`Saved ${merged.length} account(s). Run '
|
|
439
|
+
console.log(`Saved ${merged.length} account(s). Run 'rmfmail' to start.`);
|
|
437
440
|
process.exit(0);
|
|
438
441
|
}
|
|
439
442
|
// Version
|
|
@@ -456,10 +459,10 @@ if (hasFlag("v") || hasFlag("version")) {
|
|
|
456
459
|
};
|
|
457
460
|
try {
|
|
458
461
|
const pkg = JSON.parse(fs.readFileSync(`${root}/package.json`, "utf-8"));
|
|
459
|
-
console.log(`\x1b[1;97;44m
|
|
462
|
+
console.log(`\x1b[1;97;44m rmfmail v${pkg.version} \x1b[0m`);
|
|
460
463
|
}
|
|
461
464
|
catch {
|
|
462
|
-
console.log("
|
|
465
|
+
console.log("rmfmail (version unknown)");
|
|
463
466
|
}
|
|
464
467
|
console.log(` node ${process.version}`);
|
|
465
468
|
console.log(` iflow-direct ${ver("@bobfrankston/iflow-direct")}`);
|
|
@@ -487,10 +490,10 @@ async function prompt(question) {
|
|
|
487
490
|
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
488
491
|
return new Promise(resolve => rl.question(question, (ans) => { rl.close(); resolve(ans.trim()); }));
|
|
489
492
|
}
|
|
490
|
-
/** Check if
|
|
493
|
+
/** Check if rmfmail is configured (has local config or accounts) */
|
|
491
494
|
function hasConfig() {
|
|
492
495
|
const home = process.env.USERPROFILE || process.env.HOME || "";
|
|
493
|
-
const mailxDir = path.join(home, ".
|
|
496
|
+
const mailxDir = path.join(home, ".rmfmail");
|
|
494
497
|
for (const f of ["config.jsonc", "accounts.jsonc", "settings.jsonc"]) {
|
|
495
498
|
if (fs.existsSync(path.join(mailxDir, f)))
|
|
496
499
|
return true;
|
|
@@ -599,9 +602,9 @@ async function promptForAccount(intro) {
|
|
|
599
602
|
* Returns true if an account was added (caller should proceed to launch UI),
|
|
600
603
|
* false if the user skipped (UI's in-browser setup form will take over). */
|
|
601
604
|
async function runSetup(providedEmail) {
|
|
602
|
-
console.log("\
|
|
605
|
+
console.log("\nrmfmail— first-time setup\n");
|
|
603
606
|
const home = process.env.USERPROFILE || process.env.HOME || "";
|
|
604
|
-
const mailxDir = path.join(home, ".
|
|
607
|
+
const mailxDir = path.join(home, ".rmfmail");
|
|
605
608
|
fs.mkdirSync(mailxDir, { recursive: true });
|
|
606
609
|
// Use --email flag or prompt interactively
|
|
607
610
|
const email = providedEmail || await prompt("Email address (Gmail recommended): ");
|
|
@@ -629,12 +632,12 @@ async function runSetup(providedEmail) {
|
|
|
629
632
|
// For Google-hosted accounts, check Drive for existing settings first
|
|
630
633
|
let driveFolderId = null;
|
|
631
634
|
if (isGoogle) {
|
|
632
|
-
console.log("\nChecking Google Drive for existing
|
|
635
|
+
console.log("\nChecking Google Drive for existing rmfmail settings...");
|
|
633
636
|
try {
|
|
634
637
|
const { gDriveFindOrCreateFolder, getCloudProvider } = await import("@bobfrankston/mailx-settings/cloud.js");
|
|
635
638
|
driveFolderId = await gDriveFindOrCreateFolder();
|
|
636
639
|
if (driveFolderId) {
|
|
637
|
-
console.log(` Drive folder: My Drive/
|
|
640
|
+
console.log(` Drive folder: My Drive/rmfmail/ (${driveFolderId})`);
|
|
638
641
|
const gdrive = getCloudProvider("gdrive", driveFolderId);
|
|
639
642
|
if (gdrive) {
|
|
640
643
|
// Read accounts.jsonc (canonical) — ignore legacy settings.jsonc
|
|
@@ -644,19 +647,19 @@ async function runSetup(providedEmail) {
|
|
|
644
647
|
const data = parseJsonc(existing);
|
|
645
648
|
const accts = data?.accounts || (Array.isArray(data) ? data : []);
|
|
646
649
|
if (accts.length > 0) {
|
|
647
|
-
console.log(`\nFound ${accts.length} existing account(s) on Google Drive (My Drive/
|
|
650
|
+
console.log(`\nFound ${accts.length} existing account(s) on Google Drive (My Drive/rmfmail/accounts.jsonc):`);
|
|
648
651
|
for (const a of accts)
|
|
649
652
|
console.log(` • ${a.label || a.name || a.email}`);
|
|
650
653
|
// Save config pointing to Drive — no prompts needed
|
|
651
|
-
const config = { sharedDir: { provider: "gdrive", path: "
|
|
654
|
+
const config = { sharedDir: { provider: "gdrive", path: "rmfmail", folderId: driveFolderId } };
|
|
652
655
|
fs.writeFileSync(path.join(mailxDir, "config.jsonc"), JSON.stringify(config, null, 2));
|
|
653
|
-
console.log("Local config created. Starting
|
|
656
|
+
console.log("Local config created. Starting rmfmail...\n");
|
|
654
657
|
return true;
|
|
655
658
|
}
|
|
656
659
|
}
|
|
657
660
|
}
|
|
658
661
|
// No existing accounts — save Drive config for later
|
|
659
|
-
const config = { sharedDir: { provider: "gdrive", path: "
|
|
662
|
+
const config = { sharedDir: { provider: "gdrive", path: "rmfmail", folderId: driveFolderId } };
|
|
660
663
|
fs.writeFileSync(path.join(mailxDir, "config.jsonc"), JSON.stringify(config, null, 2));
|
|
661
664
|
}
|
|
662
665
|
else {
|
|
@@ -704,19 +707,19 @@ async function runSetup(providedEmail) {
|
|
|
704
707
|
else if (isGoogle && !driveFolderId) {
|
|
705
708
|
console.log(` Skipping Drive sync (no folder ID). Local copy at ${localAccountsPath}.`);
|
|
706
709
|
}
|
|
707
|
-
console.log("Setup complete. Starting
|
|
710
|
+
console.log("Setup complete. Starting rmfmail...\n");
|
|
708
711
|
return true;
|
|
709
712
|
}
|
|
710
713
|
/** Test account connectivity — IMAP connect, SMTP send, sync round-trip */
|
|
711
714
|
async function runTest() {
|
|
712
|
-
console.log("\
|
|
715
|
+
console.log("\nrmfmail— connection test\n");
|
|
713
716
|
// Start server in-process to access settings
|
|
714
717
|
console.log("Loading settings...");
|
|
715
718
|
const { loadSettings, getSharedDir, initLocalConfig } = await import("@bobfrankston/mailx-settings");
|
|
716
719
|
initLocalConfig();
|
|
717
720
|
const settings = loadSettings();
|
|
718
721
|
if (settings.accounts.length === 0) {
|
|
719
|
-
console.log("No accounts configured. Run:
|
|
722
|
+
console.log("No accounts configured. Run: rmfmail -setup");
|
|
720
723
|
process.exit(1);
|
|
721
724
|
}
|
|
722
725
|
console.log(`Shared dir: ${getSharedDir()}`);
|
|
@@ -775,12 +778,12 @@ async function runTest() {
|
|
|
775
778
|
await transport.verify();
|
|
776
779
|
console.log(` SMTP: OK`);
|
|
777
780
|
// Send test message to self
|
|
778
|
-
const testSubject = `
|
|
781
|
+
const testSubject = `rmfmail test — ${new Date().toLocaleString()}`;
|
|
779
782
|
await transport.sendMail({
|
|
780
783
|
from: `${account.name} <${account.email}>`,
|
|
781
784
|
to: account.email,
|
|
782
785
|
subject: testSubject,
|
|
783
|
-
text: `This is a test message from
|
|
786
|
+
text: `This is a test message from rmfmail -test.\nSent: ${new Date().toISOString()}\nAccount: ${account.id}`,
|
|
784
787
|
});
|
|
785
788
|
console.log(` SEND: OK — test message sent to ${account.email}`);
|
|
786
789
|
console.log(` Subject: "${testSubject}"`);
|
|
@@ -805,7 +808,7 @@ async function registerClient(settings) {
|
|
|
805
808
|
if (info.mode === "local" || !info.provider || info.provider === "local")
|
|
806
809
|
return;
|
|
807
810
|
// Device ID: stable per machine, stored locally
|
|
808
|
-
const deviceIdPath = path.join(os.homedir(), ".
|
|
811
|
+
const deviceIdPath = path.join(os.homedir(), ".rmfmail", "device-id");
|
|
809
812
|
let deviceId;
|
|
810
813
|
if (fs.existsSync(deviceIdPath)) {
|
|
811
814
|
deviceId = fs.readFileSync(deviceIdPath, "utf-8").trim();
|
|
@@ -864,7 +867,7 @@ async function main() {
|
|
|
864
867
|
log(`Mode: ${setupMode ? "setup" : "auto"}`);
|
|
865
868
|
// Refuse to run elevated unless explicitly opted in. An elevated mailx
|
|
866
869
|
// can poison %LOCALAPPDATA%\msger\webview2\ (see msger/notes.md WebView2
|
|
867
|
-
// profile playbook) and create admin-owned files under ~/.
|
|
870
|
+
// profile playbook) and create admin-owned files under ~/.rmfmail/ that
|
|
868
871
|
// later non-admin runs can't write to. `net session` requires admin on
|
|
869
872
|
// Windows; succeeds → admin, fails → non-admin. Linux/Mac use process
|
|
870
873
|
// uid (0 = root). --allow-elevated bypasses for scripted admin use.
|
|
@@ -886,7 +889,7 @@ async function main() {
|
|
|
886
889
|
const account = await promptForAccount();
|
|
887
890
|
if (account) {
|
|
888
891
|
const home = process.env.USERPROFILE || process.env.HOME || "";
|
|
889
|
-
const mailxDir = path.join(home, ".
|
|
892
|
+
const mailxDir = path.join(home, ".rmfmail");
|
|
890
893
|
const settingsPath = path.join(mailxDir, "settings.jsonc");
|
|
891
894
|
let settings;
|
|
892
895
|
try {
|
|
@@ -900,7 +903,7 @@ async function main() {
|
|
|
900
903
|
settings.accounts.push(account);
|
|
901
904
|
fs.mkdirSync(mailxDir, { recursive: true });
|
|
902
905
|
fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2));
|
|
903
|
-
console.log(`Added ${account.email} to settings. Restart
|
|
906
|
+
console.log(`Added ${account.email} to settings. Restart rmfmail to connect.`);
|
|
904
907
|
}
|
|
905
908
|
process.exit(0);
|
|
906
909
|
}
|
|
@@ -912,7 +915,7 @@ async function main() {
|
|
|
912
915
|
const hasTty = setupMode ? !!process.stdin.isTTY : (process.stdin.isTTY === true);
|
|
913
916
|
if (setupMode || !hasConfig()) {
|
|
914
917
|
if (!setupMode)
|
|
915
|
-
console.log("No
|
|
918
|
+
console.log("No rmfmail configuration found.");
|
|
916
919
|
// -email or -mail flag skips the interactive prompt
|
|
917
920
|
const emailFlag = args.findIndex(a => a === "-email" || a === "--email" || a === "-mail" || a === "--mail");
|
|
918
921
|
const emailArg = args.find(a => a.startsWith("-email=") || a.startsWith("--email=") || a.startsWith("-mail=") || a.startsWith("--mail="))?.split("=")[1]
|
|
@@ -924,13 +927,13 @@ async function main() {
|
|
|
924
927
|
console.log("No TTY and no -email flag — skipping CLI setup; in-browser setup form will appear.");
|
|
925
928
|
// Ensure the data dir exists so the UI can write its config.
|
|
926
929
|
const home = process.env.USERPROFILE || process.env.HOME || "";
|
|
927
|
-
fs.mkdirSync(path.join(home, ".
|
|
930
|
+
fs.mkdirSync(path.join(home, ".rmfmail"), { recursive: true });
|
|
928
931
|
}
|
|
929
932
|
}
|
|
930
933
|
// Redirect console to log file — keep terminal clean
|
|
931
934
|
if (!verbose) {
|
|
932
935
|
const home = process.env.USERPROFILE || process.env.HOME || ".";
|
|
933
|
-
const logDir = path.join(home, ".
|
|
936
|
+
const logDir = path.join(home, ".rmfmail", "logs");
|
|
934
937
|
fs.mkdirSync(logDir, { recursive: true });
|
|
935
938
|
// Prune logs older than LOG_RETENTION_DAYS on startup. Keep it simple:
|
|
936
939
|
// scan the dir, stat, delete. Cheap even with years of history.
|
|
@@ -974,7 +977,7 @@ async function main() {
|
|
|
974
977
|
});
|
|
975
978
|
}
|
|
976
979
|
// IPC service mode — no HTTP server
|
|
977
|
-
console.log("Starting
|
|
980
|
+
console.log("Starting rmfmail service...");
|
|
978
981
|
const { MailxDB } = await import("@bobfrankston/mailx-store");
|
|
979
982
|
const { ImapManager } = await import("@bobfrankston/mailx-imap");
|
|
980
983
|
const { MailxService } = await import("@bobfrankston/mailx-service");
|
|
@@ -996,14 +999,14 @@ async function main() {
|
|
|
996
999
|
const sendingDir = path.join(getConfigDir(), "sending");
|
|
997
1000
|
fs.mkdirSync(sendingDir, { recursive: true });
|
|
998
1001
|
const readmePath = path.join(sendingDir, "README.md");
|
|
999
|
-
const readmeBody = `# \`~/.
|
|
1002
|
+
const readmeBody = `# \`~/.rmfmail/sending/\` and \`~/.rmfmail/outbox/\` — outgoing-mail staging
|
|
1000
1003
|
|
|
1001
|
-
Auto-generated by
|
|
1004
|
+
Auto-generated by rmfmail on startup. Manual recovery reference for when rmfmail is broken or you need to feed an outgoing message into another mail program.
|
|
1002
1005
|
|
|
1003
1006
|
## Layout
|
|
1004
1007
|
|
|
1005
1008
|
\`\`\`
|
|
1006
|
-
~/.
|
|
1009
|
+
~/.rmfmail/
|
|
1007
1010
|
├── outbox/<account>/
|
|
1008
1011
|
│ └── *.ltr ← THE QUEUE. Worker scans every 10s, sends, deletes on success.
|
|
1009
1012
|
└── sending/<account>/
|
|
@@ -1012,13 +1015,13 @@ Auto-generated by mailx on startup. Manual recovery reference for when mailx is
|
|
|
1012
1015
|
└── sent/ ← Audit trail of successfully sent messages.
|
|
1013
1016
|
\`\`\`
|
|
1014
1017
|
|
|
1015
|
-
In-flight files are atomically renamed to \`<file>.sending-<host>-<pid>\` while the worker is processing them — same-machine claim so two
|
|
1018
|
+
In-flight files are atomically renamed to \`<file>.sending-<host>-<pid>\` while the worker is processing them — same-machine claim so two rmfmail instances don't double-send. Stale claims (dead PIDs on this host) are recovered on the next tick.
|
|
1016
1019
|
|
|
1017
1020
|
## Manual fallback
|
|
1018
1021
|
|
|
1019
|
-
- **
|
|
1022
|
+
- **rmfmail is dead, need to send a draft** — most recent file in \`sending/<account>/editing/\` is a complete RFC 822 message; copy the body into another mail client and resend.
|
|
1020
1023
|
- **Feed a raw .eml to mailx** — drop into \`sending/<account>/queued/\`. Picked up within 10s.
|
|
1021
|
-
- **
|
|
1024
|
+
- **rmfmail says queued but server doesn't have it** — look in \`outbox/<account>/\`. \`.ltr\` still there → worker hasn't sent yet (check \`~/.rmfmail/logs/\`). \`.sending-<host>-<pid>\` → in flight. Gone → success.
|
|
1022
1025
|
|
|
1023
1026
|
## Format
|
|
1024
1027
|
|
|
@@ -1090,15 +1093,15 @@ RFC 5322 with CRLF line endings. Bodies are quoted-printable encoded (readable i
|
|
|
1090
1093
|
const __mailxJs = path.join(import.meta.dirname, "mailx.js");
|
|
1091
1094
|
const __relaunchCommand = `"${process.execPath}" "${__mailxJs}"`;
|
|
1092
1095
|
const handle = showService({
|
|
1093
|
-
title: `
|
|
1096
|
+
title: `rmfmail v${rootPkgVersion}`,
|
|
1094
1097
|
url: "index.html",
|
|
1095
1098
|
contentDir: clientDir,
|
|
1096
1099
|
initScript: mailxapiScript,
|
|
1097
1100
|
icon: __iconPathRuntime,
|
|
1098
1101
|
relaunchIcon: __iconPathPin,
|
|
1099
1102
|
relaunchCommand: __relaunchCommand,
|
|
1100
|
-
relaunchDisplayName: "
|
|
1101
|
-
aumid: "com.frankston.
|
|
1103
|
+
relaunchDisplayName: "rmfmail",
|
|
1104
|
+
aumid: "com.frankston.rmfmail",
|
|
1102
1105
|
size: savedGeometry
|
|
1103
1106
|
? { width: savedGeometry.width, height: savedGeometry.height }
|
|
1104
1107
|
: { width: 1400, height: 900 },
|
|
@@ -1178,7 +1181,7 @@ RFC 5322 with CRLF line endings. Bodies are quoted-printable encoded (readable i
|
|
|
1178
1181
|
try {
|
|
1179
1182
|
clearInstanceFile();
|
|
1180
1183
|
const { spawn: spawnChild } = await import("child_process");
|
|
1181
|
-
const child = spawnChild("
|
|
1184
|
+
const child = spawnChild("rmfmail", [], { detached: true, stdio: "ignore", shell: true, windowsHide: true });
|
|
1182
1185
|
child.unref();
|
|
1183
1186
|
console.log(" [restart] Spawned fresh daemon; shutting down current");
|
|
1184
1187
|
// Give the spawn a moment to take hold before we start
|
|
@@ -1198,10 +1201,10 @@ RFC 5322 with CRLF line endings. Bodies are quoted-printable encoded (readable i
|
|
|
1198
1201
|
try {
|
|
1199
1202
|
const { execSync, spawn: spawnChild } = await import("child_process");
|
|
1200
1203
|
console.log(" [update] Installing latest version...");
|
|
1201
|
-
execSync("npm install -g @bobfrankston/
|
|
1204
|
+
execSync("npm install -g @bobfrankston/rmfmail", { encoding: "utf-8", timeout: 120_000, stdio: "inherit", windowsHide: true });
|
|
1202
1205
|
console.log(" [update] Install complete — relaunching");
|
|
1203
1206
|
// Spawn the new version detached so it outlives this process
|
|
1204
|
-
const child = spawnChild("
|
|
1207
|
+
const child = spawnChild("rmfmail", [], { detached: true, stdio: "ignore", shell: true, windowsHide: true });
|
|
1205
1208
|
child.unref();
|
|
1206
1209
|
gracefulShutdown("Update applied");
|
|
1207
1210
|
}
|