@bobfrankston/rmfmail 1.2.231 → 1.2.233

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.
Files changed (158) hide show
  1. package/client/android-bootstrap.bundle.js +164 -152
  2. package/client/android-bootstrap.bundle.js.map +4 -4
  3. package/client/app.bundle.js +13 -107
  4. package/client/app.bundle.js.map +4 -4
  5. package/client/components/calendar-sidebar.js +1 -1
  6. package/client/components/calendar-sidebar.js.map +1 -1
  7. package/client/components/calendar-sidebar.ts +1 -1
  8. package/client/components/message-list.js +0 -60
  9. package/client/components/message-list.js.map +1 -1
  10. package/client/components/message-list.ts +0 -56
  11. package/client/components/message-viewer.js +3 -2
  12. package/client/components/message-viewer.js.map +1 -1
  13. package/client/components/message-viewer.ts +3 -2
  14. package/client/compose/compose.bundle.js +198 -211
  15. package/client/compose/compose.bundle.js.map +4 -4
  16. package/client/compose/compose.html +0 -8
  17. package/client/compose/compose.js +1 -1
  18. package/client/compose/compose.js.map +1 -1
  19. package/client/compose/compose.ts +1 -1
  20. package/client/compose/editor.js +30 -32
  21. package/client/compose/editor.js.map +1 -1
  22. package/client/compose/editor.ts +27 -29
  23. package/client/compose/ghost-text.js +0 -8
  24. package/client/compose/ghost-text.js.map +1 -1
  25. package/client/compose/ghost-text.ts +0 -6
  26. package/client/compose/spellcheck-core.js +0 -1
  27. package/client/compose/spellcheck-core.js.map +1 -1
  28. package/client/compose/spellcheck-core.ts +0 -1
  29. package/client/index.html +0 -8
  30. package/client/lib/local-service.js +0 -73
  31. package/client/lib/local-service.js.map +1 -1
  32. package/client/lib/local-service.ts +0 -71
  33. package/client/lib/local-store.js +0 -3
  34. package/client/lib/local-store.js.map +1 -1
  35. package/client/lib/local-store.ts +0 -4
  36. package/package.json +1 -3
  37. package/packages/mailx-host/index.d.ts +0 -1
  38. package/packages/mailx-host/index.d.ts.map +1 -1
  39. package/packages/mailx-host/index.js +0 -1
  40. package/packages/mailx-host/index.js.map +1 -1
  41. package/packages/mailx-host/index.ts +0 -1
  42. package/packages/mailx-host/package.json +1 -1
  43. package/packages/mailx-service/index.d.ts.map +1 -1
  44. package/packages/mailx-service/index.js +36 -139
  45. package/packages/mailx-service/index.js.map +1 -1
  46. package/packages/mailx-service/index.ts +36 -148
  47. package/packages/mailx-settings/cloud.d.ts +0 -5
  48. package/packages/mailx-settings/cloud.d.ts.map +1 -1
  49. package/packages/mailx-settings/cloud.js +0 -16
  50. package/packages/mailx-settings/cloud.js.map +1 -1
  51. package/packages/mailx-settings/cloud.ts +0 -12
  52. package/packages/mailx-settings/index.d.ts +0 -3
  53. package/packages/mailx-settings/index.d.ts.map +1 -1
  54. package/packages/mailx-settings/index.js +0 -5
  55. package/packages/mailx-settings/index.js.map +1 -1
  56. package/packages/mailx-settings/index.ts +0 -7
  57. package/packages/mailx-store-web/main-thread-host.d.ts +1 -1
  58. package/packages/mailx-store-web/main-thread-host.d.ts.map +1 -1
  59. package/packages/mailx-store-web/main-thread-host.js +1 -38
  60. package/packages/mailx-store-web/main-thread-host.js.map +1 -1
  61. package/packages/mailx-store-web/main-thread-host.ts +0 -42
  62. package/packages/mailx-store-web/package.json +1 -1
  63. package/packages/mailx-store-web/web-service.d.ts.map +1 -1
  64. package/packages/mailx-store-web/web-service.js +28 -114
  65. package/packages/mailx-store-web/web-service.js.map +1 -1
  66. package/packages/mailx-store-web/web-service.ts +28 -124
  67. package/packages/mailx-store-web/web-settings.d.ts +0 -4
  68. package/packages/mailx-store-web/web-settings.d.ts.map +1 -1
  69. package/packages/mailx-store-web/web-settings.js +0 -29
  70. package/packages/mailx-store-web/web-settings.js.map +1 -1
  71. package/packages/mailx-store-web/web-settings.ts +0 -24
  72. package/packages/mailx-types/index.d.ts +2 -0
  73. package/packages/mailx-types/index.d.ts.map +1 -1
  74. package/packages/mailx-types/index.js +1 -0
  75. package/packages/mailx-types/index.js.map +1 -1
  76. package/packages/mailx-types/index.ts +2 -0
  77. package/packages/mailx-types/mime-build.d.ts +74 -0
  78. package/packages/mailx-types/mime-build.d.ts.map +1 -0
  79. package/packages/mailx-types/mime-build.js +160 -0
  80. package/packages/mailx-types/mime-build.js.map +1 -0
  81. package/packages/mailx-types/mime-build.ts +217 -0
  82. package/packages/mailx-types/package.json +1 -1
  83. package/packages/mailx-types/test/mime-build.test.mjs +200 -0
  84. package/client/components/calendar.js +0 -220
  85. package/client/components/calendar.js.map +0 -1
  86. package/client/components/calendar.ts +0 -213
  87. package/client/components/tasks.js +0 -261
  88. package/client/components/tasks.js.map +0 -1
  89. package/client/components/tasks.ts +0 -234
  90. package/packages/mailx-compose/.gitattributes +0 -10
  91. package/packages/mailx-compose/index.d.ts +0 -21
  92. package/packages/mailx-compose/index.d.ts.map +0 -1
  93. package/packages/mailx-compose/index.js +0 -66
  94. package/packages/mailx-compose/index.js.map +0 -1
  95. package/packages/mailx-compose/index.ts +0 -91
  96. package/packages/mailx-compose/package.json +0 -18
  97. package/packages/mailx-compose/tsconfig.json +0 -9
  98. package/packages/mailx-core/index.d.ts +0 -142
  99. package/packages/mailx-core/index.d.ts.map +0 -1
  100. package/packages/mailx-core/index.js +0 -430
  101. package/packages/mailx-core/index.js.map +0 -1
  102. package/packages/mailx-core/index.ts +0 -450
  103. package/packages/mailx-core/ipc.d.ts +0 -13
  104. package/packages/mailx-core/ipc.d.ts.map +0 -1
  105. package/packages/mailx-core/ipc.js +0 -56
  106. package/packages/mailx-core/ipc.js.map +0 -1
  107. package/packages/mailx-core/ipc.ts +0 -62
  108. package/packages/mailx-core/package.json +0 -18
  109. package/packages/mailx-core/tsconfig.json +0 -9
  110. package/packages/mailx-send/.gitattributes +0 -10
  111. package/packages/mailx-send/README.md +0 -217
  112. package/packages/mailx-send/cli-queue.d.ts +0 -11
  113. package/packages/mailx-send/cli-queue.d.ts.map +0 -1
  114. package/packages/mailx-send/cli-queue.js +0 -59
  115. package/packages/mailx-send/cli-queue.js.map +0 -1
  116. package/packages/mailx-send/cli-queue.ts +0 -62
  117. package/packages/mailx-send/cli-send.d.ts +0 -17
  118. package/packages/mailx-send/cli-send.d.ts.map +0 -1
  119. package/packages/mailx-send/cli-send.js +0 -75
  120. package/packages/mailx-send/cli-send.js.map +0 -1
  121. package/packages/mailx-send/cli-send.ts +0 -83
  122. package/packages/mailx-send/cli.d.ts +0 -22
  123. package/packages/mailx-send/cli.d.ts.map +0 -1
  124. package/packages/mailx-send/cli.js +0 -115
  125. package/packages/mailx-send/cli.js.map +0 -1
  126. package/packages/mailx-send/cli.ts +0 -126
  127. package/packages/mailx-send/index.d.ts +0 -77
  128. package/packages/mailx-send/index.d.ts.map +0 -1
  129. package/packages/mailx-send/index.js +0 -269
  130. package/packages/mailx-send/index.js.map +0 -1
  131. package/packages/mailx-send/index.ts +0 -338
  132. package/packages/mailx-send/mailsend/README.md +0 -133
  133. package/packages/mailx-send/mailsend/cli.d.ts +0 -12
  134. package/packages/mailx-send/mailsend/cli.d.ts.map +0 -1
  135. package/packages/mailx-send/mailsend/cli.js +0 -70
  136. package/packages/mailx-send/mailsend/cli.js.map +0 -1
  137. package/packages/mailx-send/mailsend/cli.ts +0 -81
  138. package/packages/mailx-send/mailsend/index.d.ts +0 -77
  139. package/packages/mailx-send/mailsend/index.d.ts.map +0 -1
  140. package/packages/mailx-send/mailsend/index.js +0 -264
  141. package/packages/mailx-send/mailsend/index.js.map +0 -1
  142. package/packages/mailx-send/mailsend/index.ts +0 -336
  143. package/packages/mailx-send/mailsend/package-lock.json +0 -65
  144. package/packages/mailx-send/mailsend/package.json +0 -26
  145. package/packages/mailx-send/mailsend/tsconfig.json +0 -21
  146. package/packages/mailx-send/package-lock.json +0 -65
  147. package/packages/mailx-send/package.json +0 -37
  148. package/packages/mailx-send/tsconfig.json +0 -21
  149. package/packages/mailx-server/.gitattributes +0 -10
  150. package/packages/mailx-server/index.d.ts +0 -8
  151. package/packages/mailx-server/index.d.ts.map +0 -1
  152. package/packages/mailx-server/index.js +0 -412
  153. package/packages/mailx-server/index.js.map +0 -1
  154. package/packages/mailx-server/index.ts +0 -445
  155. package/packages/mailx-server/package.json +0 -28
  156. package/packages/mailx-server/tsconfig.json +0 -9
  157. package/packages/mailx-server/tsconfig.tsbuildinfo +0 -1
  158. /package/packages/mailx-imap/{node_modules.npmglobalize-stash-7472 → node_modules.npmglobalize-stash-40004}/.package-lock.json +0 -0
@@ -1,217 +0,0 @@
1
- # @bobfrankston/mailx-send
2
-
3
- Queue-based mail sender with SMTP and OAuth2 support. Messages are queued as RFC 822 `.ltr` files and sent via SMTP with automatic retry.
4
-
5
- Part of the [mailx](../../README.md) email client, but usable standalone by any application.
6
-
7
- ## Install
8
-
9
- ```bash
10
- npm install @bobfrankston/mailx-send
11
- # or globally for CLI tools:
12
- npm install -g @bobfrankston/mailx-send
13
- ```
14
-
15
- ## Two CLI Commands
16
-
17
- This package provides two commands:
18
-
19
- - **`mailsend`** — create and queue a new message for sending
20
- - **`mailq`** — manage the outgoing mail queue (process, retry, status)
21
-
22
- ## Directory Structure
23
-
24
- Each account has its own queue:
25
-
26
- ```
27
- {baseDir}/
28
- {accountId}/
29
- queue/ pending .ltr files
30
- sent/ sent messages (YYYY/MM/DD/) — optional log
31
- fail/ failed messages awaiting retry
32
- ```
33
-
34
- ## Library API
35
-
36
- ```typescript
37
- import { initMailSend, queueMessage } from "@bobfrankston/mailx-send";
38
-
39
- // Initialize once at startup
40
- initMailSend({
41
- baseDir: "./mailqueue",
42
- defaultAccount: "iecc",
43
- logSent: true,
44
- retryIntervalMs: 300000, // 5 min
45
- accounts: {
46
- iecc: {
47
- host: "smtp.iecc.com",
48
- port: 587,
49
- auth: "password",
50
- user: "bob",
51
- password: "secret",
52
- from: "Bob Frankston <bob@iecc.com>",
53
- },
54
- gmail: {
55
- host: "smtp.gmail.com",
56
- port: 587,
57
- auth: "oauth2",
58
- user: "bob@gmail.com",
59
- from: "Bob Frankston <bob@gmail.com>",
60
- tokenProvider: async () => getOAuthToken(),
61
- },
62
- },
63
- });
64
-
65
- // Queue a message — returns filename, sends in background
66
- queueMessage({
67
- from: "Bob Frankston <bob@iecc.com>",
68
- to: ["alice@example.com"],
69
- subject: "Hello",
70
- html: "<p>Rich <b>HTML</b> body</p>",
71
- accountId: "iecc",
72
- });
73
- ```
74
-
75
- ### MailMessage interface
76
-
77
- ```typescript
78
- interface MailMessage {
79
- from: string; // "Name <address>"
80
- to: string[];
81
- cc?: string[];
82
- bcc?: string[];
83
- subject: string;
84
- html?: string; // HTML body (preferred for rich email)
85
- text?: string; // Plain text body
86
- inReplyTo?: string; // Message-ID for threading
87
- references?: string; // References header for threading
88
- accountId?: string; // Queue/account to send from
89
- }
90
- ```
91
-
92
- ### Other API functions
93
-
94
- ```typescript
95
- import { initMailSend, queueMessage, getMailSender } from "@bobfrankston/mailx-send";
96
-
97
- const sender = initMailSend(config);
98
-
99
- sender.processQueue("iecc"); // Process one account's queue
100
- sender.processAllQueues(); // Process all accounts
101
- sender.getStatus(); // { iecc: { pending: 2, failed: 0 }, gmail: { ... } }
102
- sender.startWorker(); // Start background retry timer (auto-started by initMailSend)
103
- sender.stopWorker(); // Stop background processing
104
- ```
105
-
106
- ## CLI: mailsend
107
-
108
- Create and queue a new message:
109
-
110
- ```bash
111
- # From CLI arguments
112
- mailsend --to alice@example.com --subject "Hello" --body "Message text"
113
- mailsend -q gmail --from "Bob <bob@gmail.com>" --to alice@example.com --subject "Test"
114
-
115
- # From a JSON file
116
- mailsend --json message.json
117
- mailsend --json message.json -q gmail
118
-
119
- # From stdin
120
- echo '{"to":["alice@example.com"],"subject":"Test","text":"Hello"}' | mailsend --json -
121
-
122
- # Custom config file
123
- mailsend --config /path/to/mailsend.json --to ...
124
- ```
125
-
126
- ### JSON message format
127
-
128
- ```json
129
- {
130
- "to": ["alice@example.com"],
131
- "cc": ["bob@example.com"],
132
- "from": "Bob Frankston <bob@iecc.com>",
133
- "subject": "Hello",
134
- "html": "<p>Rich body</p>",
135
- "text": "Plain text fallback",
136
- "accountId": "iecc"
137
- }
138
- ```
139
-
140
- ## CLI: mailq
141
-
142
- Manage the outgoing mail queue:
143
-
144
- ```bash
145
- mailq # Show queue status (all accounts)
146
- mailq --process # Process all queues (send pending, retry failed)
147
- mailq --process -q gmail # Process only the gmail queue
148
- ```
149
-
150
- ## Configuration
151
-
152
- Create `mailsend.json`:
153
-
154
- ```json
155
- {
156
- "baseDir": "./mailqueue",
157
- "defaultAccount": "iecc",
158
- "logSent": true,
159
- "retryIntervalMs": 300000,
160
- "accounts": {
161
- "iecc": {
162
- "host": "smtp.iecc.com",
163
- "port": 587,
164
- "auth": "password",
165
- "user": "bob",
166
- "password": "secret",
167
- "from": "Bob Frankston <bob@iecc.com>"
168
- }
169
- }
170
- }
171
- ```
172
-
173
- ## Queue Format
174
-
175
- Messages are stored as `.ltr` files — standard RFC 822 format with an `X-MailSend-Account` header for routing. Filenames: `YYYYMMDD_HHMMSS-NNNN.ltr`
176
-
177
- ## Building MIME Messages
178
-
179
- mailx-send currently builds simple single-part RFC 822 messages (text or HTML). For complex MIME messages (multipart, attachments, inline images), use one of these packages to build the raw message, then pass it to the queue:
180
-
181
- - **[nodemailer](https://www.npmjs.com/package/nodemailer)** — `MailComposer` class builds full MIME from parts (already a dependency)
182
- - **[emailjs-mime-builder](https://www.npmjs.com/package/emailjs-mime-builder)** — lightweight MIME builder
183
- - **[mimetext](https://www.npmjs.com/package/mimetext)** — simple API for building MIME messages: `createMimeMessage()`, add text/html/attachments
184
- - **[mailcomposer](https://www.npmjs.com/package/mailcomposer)** — standalone MIME composer (from nodemailer's author)
185
-
186
- Example with nodemailer's MailComposer:
187
-
188
- ```typescript
189
- import MailComposer from "nodemailer/lib/mail-composer";
190
-
191
- const mail = new MailComposer({
192
- from: "Bob <bob@iecc.com>",
193
- to: "alice@example.com",
194
- subject: "With attachment",
195
- html: "<p>See attached</p>",
196
- attachments: [{ filename: "doc.pdf", path: "/path/to/doc.pdf" }],
197
- });
198
-
199
- const raw = await mail.compile().build();
200
- // Write raw to the queue directory as a .ltr file
201
- ```
202
-
203
- ## Retry
204
-
205
- Failed messages move to `{accountId}/fail/YYYY/MM/DD/`. The background worker retries at the configured interval (default 5 min) by moving them back to the queue.
206
-
207
- ## OAuth2 (Gmail)
208
-
209
- Set `auth: "oauth2"` and provide a `tokenProvider` function returning a current access token. Integrates with `@bobfrankston/oauthsupport` or any OAuth2 flow.
210
-
211
- ## Sent Log
212
-
213
- When `logSent: true`, sent messages are preserved in `{accountId}/sent/YYYY/MM/DD/` for debugging.
214
-
215
- ## License
216
-
217
- MIT
@@ -1,11 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * mailq — manage the outgoing mail queue.
4
- *
5
- * Usage:
6
- * mailq Show queue status (all accounts)
7
- * mailq --process Process all queues now (send pending, retry failed)
8
- * mailq --process -q gmail Process only the gmail queue
9
- */
10
- export {};
11
- //# sourceMappingURL=cli-queue.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cli-queue.d.ts","sourceRoot":"","sources":["cli-queue.ts"],"names":[],"mappings":";AACA;;;;;;;GAOG"}
@@ -1,59 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * mailq — manage the outgoing mail queue.
4
- *
5
- * Usage:
6
- * mailq Show queue status (all accounts)
7
- * mailq --process Process all queues now (send pending, retry failed)
8
- * mailq --process -q gmail Process only the gmail queue
9
- */
10
- import * as fs from "node:fs";
11
- import { initMailSend } from "./index.js";
12
- const args = process.argv.slice(2);
13
- function getArg(name) {
14
- const shorts = { q: "queue" };
15
- const longIdx = args.indexOf(`--${name}`);
16
- const shortKey = Object.entries(shorts).find(([, v]) => v === name)?.[0];
17
- const shortIdx = shortKey ? args.indexOf(`-${shortKey}`) : -1;
18
- const i = Math.max(longIdx, shortIdx);
19
- if (i === -1 || i + 1 >= args.length)
20
- return undefined;
21
- return args[i + 1];
22
- }
23
- function hasFlag(name) {
24
- return args.includes(`--${name}`);
25
- }
26
- const configPath = getArg("config") || "mailsend.json";
27
- if (!fs.existsSync(configPath)) {
28
- console.error(`Config file not found: ${configPath}`);
29
- process.exit(1);
30
- }
31
- const config = JSON.parse(fs.readFileSync(configPath, "utf-8"));
32
- const sender = initMailSend(config);
33
- if (hasFlag("process")) {
34
- const accountId = getArg("queue");
35
- if (accountId) {
36
- await sender.processQueue(accountId);
37
- }
38
- else {
39
- await sender.processAllQueues();
40
- }
41
- // Show status after processing
42
- const status = sender.getStatus();
43
- for (const [id, s] of Object.entries(status)) {
44
- console.log(` ${id}: ${s.pending} pending, ${s.failed} failed`);
45
- }
46
- }
47
- else {
48
- // Default: show status
49
- const status = sender.getStatus();
50
- let total = 0;
51
- for (const [id, s] of Object.entries(status)) {
52
- console.log(` ${id}: ${s.pending} pending, ${s.failed} failed`);
53
- total += s.pending + s.failed;
54
- }
55
- if (total === 0)
56
- console.log(" All queues empty");
57
- }
58
- process.exit(0);
59
- //# sourceMappingURL=cli-queue.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cli-queue.js","sourceRoot":"","sources":["cli-queue.ts"],"names":[],"mappings":";AACA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAuB,MAAM,YAAY,CAAC;AAE/D,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAEnC,SAAS,MAAM,CAAC,IAAY;IACxB,MAAM,MAAM,GAA2B,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC;IACtD,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;IAC1C,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACzE,MAAM,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAA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AAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC3C,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,SAAS,CAAC,CAAC;IACrE,CAAC;AACL,CAAC;KAAM,CAAC;IACJ,uBAAuB;IACvB,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,EAAE,CAAC;IAClC,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC3C,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,SAAS,CAAC,CAAC;QACjE,KAAK,IAAI,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,CAAC;IACD,IAAI,KAAK,KAAK,CAAC;QAAE,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;AACvD,CAAC;AAED,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC"}
@@ -1,62 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * mailq — manage the outgoing mail queue.
4
- *
5
- * Usage:
6
- * mailq Show queue status (all accounts)
7
- * mailq --process Process all queues now (send pending, retry failed)
8
- * mailq --process -q gmail Process only the gmail queue
9
- */
10
-
11
- import * as fs from "node:fs";
12
- import { initMailSend, type MailSendConfig } from "./index.js";
13
-
14
- const args = process.argv.slice(2);
15
-
16
- function getArg(name: string): string | undefined {
17
- const shorts: Record<string, string> = { q: "queue" };
18
- const longIdx = args.indexOf(`--${name}`);
19
- const shortKey = Object.entries(shorts).find(([, v]) => v === name)?.[0];
20
- const shortIdx = shortKey ? args.indexOf(`-${shortKey}`) : -1;
21
- const i = Math.max(longIdx, shortIdx);
22
- if (i === -1 || i + 1 >= args.length) return undefined;
23
- return args[i + 1];
24
- }
25
-
26
- function hasFlag(name: string): boolean {
27
- return args.includes(`--${name}`);
28
- }
29
-
30
- const configPath = getArg("config") || "mailsend.json";
31
- if (!fs.existsSync(configPath)) {
32
- console.error(`Config file not found: ${configPath}`);
33
- process.exit(1);
34
- }
35
-
36
- const config: MailSendConfig = JSON.parse(fs.readFileSync(configPath, "utf-8"));
37
- const sender = initMailSend(config);
38
-
39
- if (hasFlag("process")) {
40
- const accountId = getArg("queue");
41
- if (accountId) {
42
- await sender.processQueue(accountId);
43
- } else {
44
- await sender.processAllQueues();
45
- }
46
- // Show status after processing
47
- const status = sender.getStatus();
48
- for (const [id, s] of Object.entries(status)) {
49
- console.log(` ${id}: ${s.pending} pending, ${s.failed} failed`);
50
- }
51
- } else {
52
- // Default: show status
53
- const status = sender.getStatus();
54
- let total = 0;
55
- for (const [id, s] of Object.entries(status)) {
56
- console.log(` ${id}: ${s.pending} pending, ${s.failed} failed`);
57
- total += s.pending + s.failed;
58
- }
59
- if (total === 0) console.log(" All queues empty");
60
- }
61
-
62
- process.exit(0);
@@ -1,17 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * mailsend — create and send an email message.
4
- *
5
- * Usage:
6
- * mailsend --to addr --subject "text" --body "text"
7
- * mailsend -q gmail --from "Bob <bob@gmail.com>" --to addr --subject "text"
8
- * mailsend --json message.json Read message from JSON file
9
- * echo '{"to":["a@b.com"],...}' | mailsend --json - Read from stdin
10
- *
11
- * JSON format:
12
- * { "to": ["addr"], "cc": ["addr"], "from": "Name <addr>",
13
- * "subject": "text", "text": "body", "html": "<p>body</p>",
14
- * "accountId": "iecc" }
15
- */
16
- export {};
17
- //# sourceMappingURL=cli-send.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cli-send.d.ts","sourceRoot":"","sources":["cli-send.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;GAaG"}
@@ -1,75 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * mailsend — create and send an email message.
4
- *
5
- * Usage:
6
- * mailsend --to addr --subject "text" --body "text"
7
- * mailsend -q gmail --from "Bob <bob@gmail.com>" --to addr --subject "text"
8
- * mailsend --json message.json Read message from JSON file
9
- * echo '{"to":["a@b.com"],...}' | mailsend --json - Read from stdin
10
- *
11
- * JSON format:
12
- * { "to": ["addr"], "cc": ["addr"], "from": "Name <addr>",
13
- * "subject": "text", "text": "body", "html": "<p>body</p>",
14
- * "accountId": "iecc" }
15
- */
16
- import * as fs from "node:fs";
17
- import { initMailSend, queueMessage } from "./index.js";
18
- const args = process.argv.slice(2);
19
- function getArg(name) {
20
- const shorts = { q: "queue" };
21
- const longIdx = args.indexOf(`--${name}`);
22
- const shortKey = Object.entries(shorts).find(([, v]) => v === name)?.[0];
23
- const shortIdx = shortKey ? args.indexOf(`-${shortKey}`) : -1;
24
- const i = Math.max(longIdx, shortIdx);
25
- if (i === -1 || i + 1 >= args.length)
26
- return undefined;
27
- return args[i + 1];
28
- }
29
- const configPath = getArg("config") || "mailsend.json";
30
- if (!fs.existsSync(configPath)) {
31
- console.error(`Config file not found: ${configPath}`);
32
- process.exit(1);
33
- }
34
- const config = JSON.parse(fs.readFileSync(configPath, "utf-8"));
35
- const sender = initMailSend(config);
36
- const accountId = getArg("queue") || config.defaultAccount || "";
37
- let msg = {};
38
- const jsonArg = getArg("json");
39
- if (jsonArg) {
40
- const raw = jsonArg === "-"
41
- ? fs.readFileSync(0, "utf-8")
42
- : fs.readFileSync(jsonArg, "utf-8");
43
- msg = JSON.parse(raw);
44
- }
45
- else {
46
- const to = getArg("to");
47
- if (!to) {
48
- console.error("Usage: mailsend --to addr --subject text [--body text] [--from addr] [-q account]");
49
- console.error(" mailsend --json message.json [-q account]");
50
- process.exit(1);
51
- }
52
- msg = {
53
- to: to.split(",").map(s => s.trim()),
54
- subject: getArg("subject") || "(no subject)",
55
- text: getArg("body") || "",
56
- html: getArg("html"),
57
- };
58
- }
59
- const acctId = msg.accountId || accountId;
60
- const acct = config.accounts[acctId];
61
- if (!acct) {
62
- console.error(`Unknown account: ${acctId}`);
63
- console.error(`Available: ${Object.keys(config.accounts).join(", ")}`);
64
- process.exit(1);
65
- }
66
- msg.from = msg.from || getArg("from") || acct.from || acct.user;
67
- msg.accountId = acctId;
68
- if (!msg.to?.length) {
69
- console.error("Message must have at least one recipient (to)");
70
- process.exit(1);
71
- }
72
- const filename = queueMessage(msg);
73
- console.log(`Queued: ${filename}`);
74
- setTimeout(() => process.exit(0), 2000);
75
- //# sourceMappingURL=cli-send.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cli-send.js","sourceRoot":"","sources":["cli-send.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,YAAY,EAAyC,MAAM,YAAY,CAAC;AAE/F,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAEnC,SAAS,MAAM,CAAC,IAAY;IACxB,MAAM,MAAM,GAA2B,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC;IACtD,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;IAC1C,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACzE,MAAM,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9D,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IACtC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAA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AE,CAAC,CAAC;AACnC,UAAU,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC"}
@@ -1,83 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * mailsend — create and send an email message.
4
- *
5
- * Usage:
6
- * mailsend --to addr --subject "text" --body "text"
7
- * mailsend -q gmail --from "Bob <bob@gmail.com>" --to addr --subject "text"
8
- * mailsend --json message.json Read message from JSON file
9
- * echo '{"to":["a@b.com"],...}' | mailsend --json - Read from stdin
10
- *
11
- * JSON format:
12
- * { "to": ["addr"], "cc": ["addr"], "from": "Name <addr>",
13
- * "subject": "text", "text": "body", "html": "<p>body</p>",
14
- * "accountId": "iecc" }
15
- */
16
-
17
- import * as fs from "node:fs";
18
- import { initMailSend, queueMessage, type MailSendConfig, type MailMessage } from "./index.js";
19
-
20
- const args = process.argv.slice(2);
21
-
22
- function getArg(name: string): string | undefined {
23
- const shorts: Record<string, string> = { q: "queue" };
24
- const longIdx = args.indexOf(`--${name}`);
25
- const shortKey = Object.entries(shorts).find(([, v]) => v === name)?.[0];
26
- const shortIdx = shortKey ? args.indexOf(`-${shortKey}`) : -1;
27
- const i = Math.max(longIdx, shortIdx);
28
- if (i === -1 || i + 1 >= args.length) return undefined;
29
- return args[i + 1];
30
- }
31
-
32
- const configPath = getArg("config") || "mailsend.json";
33
- if (!fs.existsSync(configPath)) {
34
- console.error(`Config file not found: ${configPath}`);
35
- process.exit(1);
36
- }
37
-
38
- const config: MailSendConfig = JSON.parse(fs.readFileSync(configPath, "utf-8"));
39
- const sender = initMailSend(config);
40
- const accountId = getArg("queue") || config.defaultAccount || "";
41
-
42
- let msg: Partial<MailMessage> = {};
43
-
44
- const jsonArg = getArg("json");
45
- if (jsonArg) {
46
- const raw = jsonArg === "-"
47
- ? fs.readFileSync(0, "utf-8")
48
- : fs.readFileSync(jsonArg, "utf-8");
49
- msg = JSON.parse(raw);
50
- } else {
51
- const to = getArg("to");
52
- if (!to) {
53
- console.error("Usage: mailsend --to addr --subject text [--body text] [--from addr] [-q account]");
54
- console.error(" mailsend --json message.json [-q account]");
55
- process.exit(1);
56
- }
57
- msg = {
58
- to: to.split(",").map(s => s.trim()),
59
- subject: getArg("subject") || "(no subject)",
60
- text: getArg("body") || "",
61
- html: getArg("html"),
62
- };
63
- }
64
-
65
- const acctId = msg.accountId || accountId;
66
- const acct = config.accounts[acctId];
67
- if (!acct) {
68
- console.error(`Unknown account: ${acctId}`);
69
- console.error(`Available: ${Object.keys(config.accounts).join(", ")}`);
70
- process.exit(1);
71
- }
72
-
73
- msg.from = msg.from || getArg("from") || acct.from || acct.user;
74
- msg.accountId = acctId;
75
-
76
- if (!msg.to?.length) {
77
- console.error("Message must have at least one recipient (to)");
78
- process.exit(1);
79
- }
80
-
81
- const filename = queueMessage(msg as MailMessage);
82
- console.log(`Queued: ${filename}`);
83
- setTimeout(() => process.exit(0), 2000);
@@ -1,22 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * mailx-send CLI — queue and send email.
4
- *
5
- * Queue management (process queued .ltr files):
6
- * mailx-send --process Process all account queues now
7
- * mailx-send --process -q gmail Process only the gmail queue
8
- * mailx-send --status Show queue status
9
- *
10
- * Create and queue a new message:
11
- * mailx-send --new --to addr --subject "text" --body "text"
12
- * mailx-send --new -q gmail --from "Bob <bob@gmail.com>" --to addr --subject "text"
13
- * mailx-send --new --json message.json Read message from JSON file
14
- * echo '{"to":["a@b.com"],...}' | mailx-send --new --json - Read from stdin
15
- *
16
- * JSON message format:
17
- * { "to": ["addr"], "cc": ["addr"], "from": "Name <addr>",
18
- * "subject": "text", "text": "body", "html": "<p>body</p>",
19
- * "accountId": "iecc" }
20
- */
21
- export {};
22
- //# sourceMappingURL=cli.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;GAkBG"}