@bobfrankston/rmfmail 1.0.467

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 (330) hide show
  1. package/README.md +429 -0
  2. package/bin/build-icon-ico.js +283 -0
  3. package/bin/lean-accounts.js +172 -0
  4. package/bin/mailx.js +1580 -0
  5. package/bin/mailx.js.map +1 -0
  6. package/bin/mailx.ts +1549 -0
  7. package/bin/postinstall.js +39 -0
  8. package/bin/postinstall.js.map +1 -0
  9. package/bin/postinstall.ts +41 -0
  10. package/bin/tsconfig.json +10 -0
  11. package/client/.gitattributes +10 -0
  12. package/client/.msger-window.json +1 -0
  13. package/client/android.html +226 -0
  14. package/client/app.js +3400 -0
  15. package/client/app.js.map +1 -0
  16. package/client/app.ts +3190 -0
  17. package/client/components/address-book.js +199 -0
  18. package/client/components/address-book.js.map +1 -0
  19. package/client/components/address-book.ts +204 -0
  20. package/client/components/alarms.js +299 -0
  21. package/client/components/alarms.js.map +1 -0
  22. package/client/components/alarms.ts +276 -0
  23. package/client/components/calendar-sidebar.js +508 -0
  24. package/client/components/calendar-sidebar.js.map +1 -0
  25. package/client/components/calendar-sidebar.ts +474 -0
  26. package/client/components/calendar.js +217 -0
  27. package/client/components/calendar.js.map +1 -0
  28. package/client/components/calendar.ts +211 -0
  29. package/client/components/context-menu.js +80 -0
  30. package/client/components/context-menu.js.map +1 -0
  31. package/client/components/context-menu.ts +95 -0
  32. package/client/components/folder-picker.js +119 -0
  33. package/client/components/folder-picker.js.map +1 -0
  34. package/client/components/folder-picker.ts +127 -0
  35. package/client/components/folder-tree.js +1093 -0
  36. package/client/components/folder-tree.js.map +1 -0
  37. package/client/components/folder-tree.ts +1069 -0
  38. package/client/components/message-list.js +1140 -0
  39. package/client/components/message-list.js.map +1 -0
  40. package/client/components/message-list.ts +1129 -0
  41. package/client/components/message-viewer.js +1291 -0
  42. package/client/components/message-viewer.js.map +1 -0
  43. package/client/components/message-viewer.ts +1257 -0
  44. package/client/components/outbox-view.js +104 -0
  45. package/client/components/outbox-view.js.map +1 -0
  46. package/client/components/outbox-view.ts +102 -0
  47. package/client/components/tasks.js +261 -0
  48. package/client/components/tasks.js.map +1 -0
  49. package/client/components/tasks.ts +234 -0
  50. package/client/compose/compose.css +560 -0
  51. package/client/compose/compose.html +52 -0
  52. package/client/compose/compose.js +1289 -0
  53. package/client/compose/compose.js.map +1 -0
  54. package/client/compose/compose.ts +1231 -0
  55. package/client/compose/editor.js +616 -0
  56. package/client/compose/editor.js.map +1 -0
  57. package/client/compose/editor.ts +599 -0
  58. package/client/compose/ghost-text.js +122 -0
  59. package/client/compose/ghost-text.js.map +1 -0
  60. package/client/compose/ghost-text.ts +140 -0
  61. package/client/favicon.svg +11 -0
  62. package/client/icon.ico +0 -0
  63. package/client/icon.png +0 -0
  64. package/client/index.html +230 -0
  65. package/client/lib/android-bootstrap.js +9 -0
  66. package/client/lib/android-bootstrap.js.map +1 -0
  67. package/client/lib/android-bootstrap.ts +9 -0
  68. package/client/lib/api-client.js +378 -0
  69. package/client/lib/api-client.js.map +1 -0
  70. package/client/lib/api-client.ts +439 -0
  71. package/client/lib/local-service.js +603 -0
  72. package/client/lib/local-service.js.map +1 -0
  73. package/client/lib/local-service.ts +646 -0
  74. package/client/lib/local-store.js +214 -0
  75. package/client/lib/local-store.js.map +1 -0
  76. package/client/lib/local-store.ts +283 -0
  77. package/client/lib/mailxapi.js +304 -0
  78. package/client/lib/message-state.js +132 -0
  79. package/client/lib/message-state.js.map +1 -0
  80. package/client/lib/message-state.ts +160 -0
  81. package/client/package.json +16 -0
  82. package/client/styles/components.css +2049 -0
  83. package/client/styles/layout.css +332 -0
  84. package/client/styles/variables.css +85 -0
  85. package/client/tsconfig.json +19 -0
  86. package/package.json +124 -0
  87. package/packages/mailx-api/.gitattributes +10 -0
  88. package/packages/mailx-api/index.d.ts +10 -0
  89. package/packages/mailx-api/index.d.ts.map +1 -0
  90. package/packages/mailx-api/index.js +322 -0
  91. package/packages/mailx-api/index.js.map +1 -0
  92. package/packages/mailx-api/index.ts +283 -0
  93. package/packages/mailx-api/package.json +27 -0
  94. package/packages/mailx-api/tsconfig.json +9 -0
  95. package/packages/mailx-api/tsconfig.tsbuildinfo +1 -0
  96. package/packages/mailx-compose/.gitattributes +10 -0
  97. package/packages/mailx-compose/index.d.ts +21 -0
  98. package/packages/mailx-compose/index.d.ts.map +1 -0
  99. package/packages/mailx-compose/index.js +61 -0
  100. package/packages/mailx-compose/index.js.map +1 -0
  101. package/packages/mailx-compose/index.ts +85 -0
  102. package/packages/mailx-compose/package.json +18 -0
  103. package/packages/mailx-compose/tsconfig.json +9 -0
  104. package/packages/mailx-core/index.d.ts +139 -0
  105. package/packages/mailx-core/index.d.ts.map +1 -0
  106. package/packages/mailx-core/index.js +403 -0
  107. package/packages/mailx-core/index.js.map +1 -0
  108. package/packages/mailx-core/index.ts +424 -0
  109. package/packages/mailx-core/ipc.d.ts +13 -0
  110. package/packages/mailx-core/ipc.d.ts.map +1 -0
  111. package/packages/mailx-core/ipc.js +56 -0
  112. package/packages/mailx-core/ipc.js.map +1 -0
  113. package/packages/mailx-core/ipc.ts +62 -0
  114. package/packages/mailx-core/package.json +18 -0
  115. package/packages/mailx-core/tsconfig.json +9 -0
  116. package/packages/mailx-host/.gitattributes +10 -0
  117. package/packages/mailx-host/index.d.ts +21 -0
  118. package/packages/mailx-host/index.d.ts.map +1 -0
  119. package/packages/mailx-host/index.js +29 -0
  120. package/packages/mailx-host/index.js.map +1 -0
  121. package/packages/mailx-host/index.ts +38 -0
  122. package/packages/mailx-host/package.json +23 -0
  123. package/packages/mailx-host/tsconfig.json +9 -0
  124. package/packages/mailx-host/types-shim.d.ts +14 -0
  125. package/packages/mailx-imap/.gitattributes +10 -0
  126. package/packages/mailx-imap/index.d.ts +442 -0
  127. package/packages/mailx-imap/index.d.ts.map +1 -0
  128. package/packages/mailx-imap/index.js +3684 -0
  129. package/packages/mailx-imap/index.js.map +1 -0
  130. package/packages/mailx-imap/index.ts +3652 -0
  131. package/packages/mailx-imap/package-lock.json +131 -0
  132. package/packages/mailx-imap/package.json +28 -0
  133. package/packages/mailx-imap/providers/gmail-api.d.ts +8 -0
  134. package/packages/mailx-imap/providers/gmail-api.d.ts.map +1 -0
  135. package/packages/mailx-imap/providers/gmail-api.js +8 -0
  136. package/packages/mailx-imap/providers/gmail-api.js.map +1 -0
  137. package/packages/mailx-imap/providers/gmail-api.ts +8 -0
  138. package/packages/mailx-imap/providers/outlook-api.ts +7 -0
  139. package/packages/mailx-imap/providers/types.d.ts +9 -0
  140. package/packages/mailx-imap/providers/types.d.ts.map +1 -0
  141. package/packages/mailx-imap/providers/types.js +9 -0
  142. package/packages/mailx-imap/providers/types.js.map +1 -0
  143. package/packages/mailx-imap/providers/types.ts +9 -0
  144. package/packages/mailx-imap/tsconfig.json +9 -0
  145. package/packages/mailx-imap/tsconfig.tsbuildinfo +1 -0
  146. package/packages/mailx-send/.gitattributes +10 -0
  147. package/packages/mailx-send/README.md +217 -0
  148. package/packages/mailx-send/cli-queue.d.ts +11 -0
  149. package/packages/mailx-send/cli-queue.d.ts.map +1 -0
  150. package/packages/mailx-send/cli-queue.js +59 -0
  151. package/packages/mailx-send/cli-queue.js.map +1 -0
  152. package/packages/mailx-send/cli-queue.ts +62 -0
  153. package/packages/mailx-send/cli-send.d.ts +17 -0
  154. package/packages/mailx-send/cli-send.d.ts.map +1 -0
  155. package/packages/mailx-send/cli-send.js +75 -0
  156. package/packages/mailx-send/cli-send.js.map +1 -0
  157. package/packages/mailx-send/cli-send.ts +83 -0
  158. package/packages/mailx-send/cli.d.ts +22 -0
  159. package/packages/mailx-send/cli.d.ts.map +1 -0
  160. package/packages/mailx-send/cli.js +115 -0
  161. package/packages/mailx-send/cli.js.map +1 -0
  162. package/packages/mailx-send/cli.ts +126 -0
  163. package/packages/mailx-send/index.d.ts +77 -0
  164. package/packages/mailx-send/index.d.ts.map +1 -0
  165. package/packages/mailx-send/index.js +264 -0
  166. package/packages/mailx-send/index.js.map +1 -0
  167. package/packages/mailx-send/index.ts +333 -0
  168. package/packages/mailx-send/mailsend/README.md +133 -0
  169. package/packages/mailx-send/mailsend/cli.d.ts +12 -0
  170. package/packages/mailx-send/mailsend/cli.d.ts.map +1 -0
  171. package/packages/mailx-send/mailsend/cli.js +70 -0
  172. package/packages/mailx-send/mailsend/cli.js.map +1 -0
  173. package/packages/mailx-send/mailsend/cli.ts +81 -0
  174. package/packages/mailx-send/mailsend/index.d.ts +77 -0
  175. package/packages/mailx-send/mailsend/index.d.ts.map +1 -0
  176. package/packages/mailx-send/mailsend/index.js +264 -0
  177. package/packages/mailx-send/mailsend/index.js.map +1 -0
  178. package/packages/mailx-send/mailsend/index.ts +333 -0
  179. package/packages/mailx-send/mailsend/package-lock.json +65 -0
  180. package/packages/mailx-send/mailsend/package.json +26 -0
  181. package/packages/mailx-send/mailsend/tsconfig.json +21 -0
  182. package/packages/mailx-send/package-lock.json +65 -0
  183. package/packages/mailx-send/package.json +37 -0
  184. package/packages/mailx-send/tsconfig.json +21 -0
  185. package/packages/mailx-server/.gitattributes +10 -0
  186. package/packages/mailx-server/index.d.ts +8 -0
  187. package/packages/mailx-server/index.d.ts.map +1 -0
  188. package/packages/mailx-server/index.js +397 -0
  189. package/packages/mailx-server/index.js.map +1 -0
  190. package/packages/mailx-server/index.ts +429 -0
  191. package/packages/mailx-server/package.json +28 -0
  192. package/packages/mailx-server/tsconfig.json +9 -0
  193. package/packages/mailx-server/tsconfig.tsbuildinfo +1 -0
  194. package/packages/mailx-service/google-sync.d.ts +96 -0
  195. package/packages/mailx-service/google-sync.d.ts.map +1 -0
  196. package/packages/mailx-service/google-sync.js +153 -0
  197. package/packages/mailx-service/google-sync.js.map +1 -0
  198. package/packages/mailx-service/google-sync.ts +238 -0
  199. package/packages/mailx-service/index.d.ts +366 -0
  200. package/packages/mailx-service/index.d.ts.map +1 -0
  201. package/packages/mailx-service/index.js +2589 -0
  202. package/packages/mailx-service/index.js.map +1 -0
  203. package/packages/mailx-service/index.ts +2512 -0
  204. package/packages/mailx-service/jsonrpc.d.ts +25 -0
  205. package/packages/mailx-service/jsonrpc.d.ts.map +1 -0
  206. package/packages/mailx-service/jsonrpc.js +238 -0
  207. package/packages/mailx-service/jsonrpc.js.map +1 -0
  208. package/packages/mailx-service/jsonrpc.ts +268 -0
  209. package/packages/mailx-service/package.json +22 -0
  210. package/packages/mailx-service/tsconfig.json +9 -0
  211. package/packages/mailx-settings/.gitattributes +10 -0
  212. package/packages/mailx-settings/cloud.d.ts +47 -0
  213. package/packages/mailx-settings/cloud.d.ts.map +1 -0
  214. package/packages/mailx-settings/cloud.js +408 -0
  215. package/packages/mailx-settings/cloud.js.map +1 -0
  216. package/packages/mailx-settings/cloud.ts +393 -0
  217. package/packages/mailx-settings/index.d.ts +140 -0
  218. package/packages/mailx-settings/index.d.ts.map +1 -0
  219. package/packages/mailx-settings/index.js +872 -0
  220. package/packages/mailx-settings/index.js.map +1 -0
  221. package/packages/mailx-settings/index.ts +908 -0
  222. package/packages/mailx-settings/package.json +20 -0
  223. package/packages/mailx-settings/tsconfig.json +9 -0
  224. package/packages/mailx-settings/tsconfig.tsbuildinfo +1 -0
  225. package/packages/mailx-store/.gitattributes +10 -0
  226. package/packages/mailx-store/db.d.ts +346 -0
  227. package/packages/mailx-store/db.d.ts.map +1 -0
  228. package/packages/mailx-store/db.js +1796 -0
  229. package/packages/mailx-store/db.js.map +1 -0
  230. package/packages/mailx-store/db.ts +2007 -0
  231. package/packages/mailx-store/file-store.d.ts +36 -0
  232. package/packages/mailx-store/file-store.d.ts.map +1 -0
  233. package/packages/mailx-store/file-store.js +80 -0
  234. package/packages/mailx-store/file-store.js.map +1 -0
  235. package/packages/mailx-store/file-store.ts +82 -0
  236. package/packages/mailx-store/index.d.ts +7 -0
  237. package/packages/mailx-store/index.d.ts.map +1 -0
  238. package/packages/mailx-store/index.js +7 -0
  239. package/packages/mailx-store/index.js.map +1 -0
  240. package/packages/mailx-store/index.ts +7 -0
  241. package/packages/mailx-store/package.json +19 -0
  242. package/packages/mailx-store/tsconfig.json +9 -0
  243. package/packages/mailx-store/tsconfig.tsbuildinfo +1 -0
  244. package/packages/mailx-store-web/android-bootstrap.d.ts +16 -0
  245. package/packages/mailx-store-web/android-bootstrap.d.ts.map +1 -0
  246. package/packages/mailx-store-web/android-bootstrap.js +1247 -0
  247. package/packages/mailx-store-web/android-bootstrap.js.map +1 -0
  248. package/packages/mailx-store-web/android-bootstrap.ts +1262 -0
  249. package/packages/mailx-store-web/db.d.ts +132 -0
  250. package/packages/mailx-store-web/db.d.ts.map +1 -0
  251. package/packages/mailx-store-web/db.js +642 -0
  252. package/packages/mailx-store-web/db.js.map +1 -0
  253. package/packages/mailx-store-web/db.ts +756 -0
  254. package/packages/mailx-store-web/gmail-api-web.d.ts +11 -0
  255. package/packages/mailx-store-web/gmail-api-web.d.ts.map +1 -0
  256. package/packages/mailx-store-web/gmail-api-web.js +11 -0
  257. package/packages/mailx-store-web/gmail-api-web.js.map +1 -0
  258. package/packages/mailx-store-web/gmail-api-web.ts +11 -0
  259. package/packages/mailx-store-web/imap-web-provider.d.ts +33 -0
  260. package/packages/mailx-store-web/imap-web-provider.d.ts.map +1 -0
  261. package/packages/mailx-store-web/imap-web-provider.js +140 -0
  262. package/packages/mailx-store-web/imap-web-provider.js.map +1 -0
  263. package/packages/mailx-store-web/imap-web-provider.ts +156 -0
  264. package/packages/mailx-store-web/index.d.ts +10 -0
  265. package/packages/mailx-store-web/index.d.ts.map +1 -0
  266. package/packages/mailx-store-web/index.js +10 -0
  267. package/packages/mailx-store-web/index.js.map +1 -0
  268. package/packages/mailx-store-web/index.ts +10 -0
  269. package/packages/mailx-store-web/main-thread-host.d.ts +15 -0
  270. package/packages/mailx-store-web/main-thread-host.d.ts.map +1 -0
  271. package/packages/mailx-store-web/main-thread-host.js +292 -0
  272. package/packages/mailx-store-web/main-thread-host.js.map +1 -0
  273. package/packages/mailx-store-web/main-thread-host.ts +322 -0
  274. package/packages/mailx-store-web/package.json +23 -0
  275. package/packages/mailx-store-web/provider-types.d.ts +7 -0
  276. package/packages/mailx-store-web/provider-types.d.ts.map +1 -0
  277. package/packages/mailx-store-web/provider-types.js +7 -0
  278. package/packages/mailx-store-web/provider-types.js.map +1 -0
  279. package/packages/mailx-store-web/provider-types.ts +7 -0
  280. package/packages/mailx-store-web/sql-wasm-esm.js +10 -0
  281. package/packages/mailx-store-web/sql.js.d.ts +29 -0
  282. package/packages/mailx-store-web/sync-manager.d.ts +68 -0
  283. package/packages/mailx-store-web/sync-manager.d.ts.map +1 -0
  284. package/packages/mailx-store-web/sync-manager.js +506 -0
  285. package/packages/mailx-store-web/sync-manager.js.map +1 -0
  286. package/packages/mailx-store-web/sync-manager.ts +508 -0
  287. package/packages/mailx-store-web/tsconfig.json +10 -0
  288. package/packages/mailx-store-web/web-jsonrpc.d.ts +20 -0
  289. package/packages/mailx-store-web/web-jsonrpc.d.ts.map +1 -0
  290. package/packages/mailx-store-web/web-jsonrpc.js +102 -0
  291. package/packages/mailx-store-web/web-jsonrpc.js.map +1 -0
  292. package/packages/mailx-store-web/web-jsonrpc.ts +116 -0
  293. package/packages/mailx-store-web/web-message-store.d.ts +16 -0
  294. package/packages/mailx-store-web/web-message-store.d.ts.map +1 -0
  295. package/packages/mailx-store-web/web-message-store.js +89 -0
  296. package/packages/mailx-store-web/web-message-store.js.map +1 -0
  297. package/packages/mailx-store-web/web-message-store.ts +97 -0
  298. package/packages/mailx-store-web/web-service.d.ts +111 -0
  299. package/packages/mailx-store-web/web-service.d.ts.map +1 -0
  300. package/packages/mailx-store-web/web-service.js +542 -0
  301. package/packages/mailx-store-web/web-service.js.map +1 -0
  302. package/packages/mailx-store-web/web-service.ts +616 -0
  303. package/packages/mailx-store-web/web-settings.d.ts +83 -0
  304. package/packages/mailx-store-web/web-settings.d.ts.map +1 -0
  305. package/packages/mailx-store-web/web-settings.js +491 -0
  306. package/packages/mailx-store-web/web-settings.js.map +1 -0
  307. package/packages/mailx-store-web/web-settings.ts +522 -0
  308. package/packages/mailx-store-web/worker-bundle.js +6838 -0
  309. package/packages/mailx-store-web/worker-entry.d.ts +8 -0
  310. package/packages/mailx-store-web/worker-entry.d.ts.map +1 -0
  311. package/packages/mailx-store-web/worker-entry.js +187 -0
  312. package/packages/mailx-store-web/worker-entry.js.map +1 -0
  313. package/packages/mailx-store-web/worker-entry.ts +215 -0
  314. package/packages/mailx-store-web/worker-tcp-transport.d.ts +28 -0
  315. package/packages/mailx-store-web/worker-tcp-transport.d.ts.map +1 -0
  316. package/packages/mailx-store-web/worker-tcp-transport.js +98 -0
  317. package/packages/mailx-store-web/worker-tcp-transport.js.map +1 -0
  318. package/packages/mailx-store-web/worker-tcp-transport.ts +101 -0
  319. package/packages/mailx-types/.gitattributes +10 -0
  320. package/packages/mailx-types/index.d.ts +319 -0
  321. package/packages/mailx-types/index.d.ts.map +1 -0
  322. package/packages/mailx-types/index.js +243 -0
  323. package/packages/mailx-types/index.js.map +1 -0
  324. package/packages/mailx-types/index.ts +498 -0
  325. package/packages/mailx-types/package.json +16 -0
  326. package/packages/mailx-types/tsconfig.json +9 -0
  327. package/packages/mailx-types/tsconfig.tsbuildinfo +1 -0
  328. package/todo.json +13 -0
  329. package/tsconfig.base.json +31 -0
  330. package/tsconfig.json +9 -0
@@ -0,0 +1,131 @@
1
+ {
2
+ "name": "@bobfrankston/mailx-imap",
3
+ "version": "0.1.15",
4
+ "lockfileVersion": 3,
5
+ "requires": true,
6
+ "packages": {
7
+ "": {
8
+ "name": "@bobfrankston/mailx-imap",
9
+ "version": "0.1.15",
10
+ "license": "ISC",
11
+ "dependencies": {
12
+ "@bobfrankston/iflow-direct": "^0.1.27",
13
+ "@bobfrankston/mailx-settings": "^0.1.5",
14
+ "@bobfrankston/mailx-store": "^0.1.4",
15
+ "@bobfrankston/mailx-sync": "^0.1.10",
16
+ "@bobfrankston/mailx-types": "^0.1.4",
17
+ "@bobfrankston/oauthsupport": "^1.0.25",
18
+ "@bobfrankston/smtp-direct": "^0.1.5",
19
+ "@bobfrankston/tcp-transport": "^0.1.5"
20
+ }
21
+ },
22
+ "../../../../projects/oauth/oauthsupport": {
23
+ "name": "@bobfrankston/oauthsupport",
24
+ "version": "1.0.25",
25
+ "license": "MIT",
26
+ "devDependencies": {
27
+ "@types/node": "^25.2.1"
28
+ },
29
+ "engines": {
30
+ "node": ">=18.0.0"
31
+ }
32
+ },
33
+ "../../../MailApps/iflow-direct": {
34
+ "name": "@bobfrankston/iflow-direct",
35
+ "version": "0.1.27",
36
+ "license": "ISC",
37
+ "dependencies": {
38
+ "@bobfrankston/tcp-transport": "file:../tcp-transport"
39
+ },
40
+ "devDependencies": {
41
+ "@types/node": "^25.6.0"
42
+ }
43
+ },
44
+ "../../../MailApps/mailx-sync": {
45
+ "name": "@bobfrankston/mailx-sync",
46
+ "version": "0.1.10",
47
+ "license": "ISC",
48
+ "dependencies": {
49
+ "@bobfrankston/iflow-direct": "file:../iflow-direct",
50
+ "@bobfrankston/tcp-transport": "file:../tcp-transport"
51
+ },
52
+ "devDependencies": {
53
+ "@types/node": "^25.6.0"
54
+ }
55
+ },
56
+ "../../../MailApps/smtp-direct": {
57
+ "name": "@bobfrankston/smtp-direct",
58
+ "version": "0.1.5",
59
+ "license": "ISC",
60
+ "dependencies": {
61
+ "@bobfrankston/tcp-transport": "file:../tcp-transport"
62
+ },
63
+ "devDependencies": {
64
+ "@types/node": "^25.6.0"
65
+ }
66
+ },
67
+ "../../../MailApps/tcp-transport": {
68
+ "name": "@bobfrankston/tcp-transport",
69
+ "version": "0.1.5",
70
+ "license": "ISC",
71
+ "devDependencies": {
72
+ "@types/node": "^25.6.0"
73
+ }
74
+ },
75
+ "../../app/packages/mailx-settings": {
76
+ "name": "@bobfrankston/mailx-settings",
77
+ "version": "0.1.6",
78
+ "license": "ISC",
79
+ "dependencies": {
80
+ "@bobfrankston/mailx-types": "file:../mailx-types",
81
+ "jsonc-parser": "^3.3.1"
82
+ }
83
+ },
84
+ "../../app/packages/mailx-store": {
85
+ "name": "@bobfrankston/mailx-store",
86
+ "version": "0.1.5",
87
+ "license": "ISC",
88
+ "dependencies": {
89
+ "@bobfrankston/mailx-settings": "file:../mailx-settings",
90
+ "@bobfrankston/mailx-types": "file:../mailx-types"
91
+ }
92
+ },
93
+ "../../app/packages/mailx-types": {
94
+ "name": "@bobfrankston/mailx-types",
95
+ "version": "0.1.5",
96
+ "license": "ISC"
97
+ },
98
+ "node_modules/@bobfrankston/iflow-direct": {
99
+ "resolved": "../../../MailApps/iflow-direct",
100
+ "link": true
101
+ },
102
+ "node_modules/@bobfrankston/mailx-settings": {
103
+ "resolved": "../../app/packages/mailx-settings",
104
+ "link": true
105
+ },
106
+ "node_modules/@bobfrankston/mailx-store": {
107
+ "resolved": "../../app/packages/mailx-store",
108
+ "link": true
109
+ },
110
+ "node_modules/@bobfrankston/mailx-sync": {
111
+ "resolved": "../../../MailApps/mailx-sync",
112
+ "link": true
113
+ },
114
+ "node_modules/@bobfrankston/mailx-types": {
115
+ "resolved": "../../app/packages/mailx-types",
116
+ "link": true
117
+ },
118
+ "node_modules/@bobfrankston/oauthsupport": {
119
+ "resolved": "../../../../projects/oauth/oauthsupport",
120
+ "link": true
121
+ },
122
+ "node_modules/@bobfrankston/smtp-direct": {
123
+ "resolved": "../../../MailApps/smtp-direct",
124
+ "link": true
125
+ },
126
+ "node_modules/@bobfrankston/tcp-transport": {
127
+ "resolved": "../../../MailApps/tcp-transport",
128
+ "link": true
129
+ }
130
+ }
131
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "@bobfrankston/mailx-imap",
3
+ "version": "0.1.15",
4
+ "type": "module",
5
+ "main": "index.js",
6
+ "types": "index.d.ts",
7
+ "scripts": {
8
+ "build": "tsc"
9
+ },
10
+ "license": "ISC",
11
+ "dependencies": {
12
+ "@bobfrankston/mailx-types": "file:../mailx-types",
13
+ "@bobfrankston/mailx-settings": "file:../mailx-settings",
14
+ "@bobfrankston/mailx-store": "file:../mailx-store",
15
+ "@bobfrankston/iflow-direct": "file:../../../../MailApps/iflow-direct",
16
+ "@bobfrankston/tcp-transport": "file:../../../../MailApps/tcp-transport",
17
+ "@bobfrankston/smtp-direct": "file:../../../../MailApps/smtp-direct",
18
+ "@bobfrankston/mailx-sync": "file:../../../../MailApps/mailx-sync",
19
+ "@bobfrankston/oauthsupport": "file:../../../../../projects/oauth/oauthsupport"
20
+ },
21
+ "repository": {
22
+ "type": "git",
23
+ "url": "https://github.com/BobFrankston/mailx-imap.git"
24
+ },
25
+ "publishConfig": {
26
+ "access": "public"
27
+ }
28
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Back-compat re-export. The canonical Gmail provider lives in
3
+ * @bobfrankston/mailx-sync. mailx-imap re-exports it under its old name so
4
+ * call sites here keep compiling. Both desktop (this package) and Android
5
+ * (mailx-store-web) consume the same single implementation now.
6
+ */
7
+ export { GmailApiProvider } from "@bobfrankston/mailx-sync";
8
+ //# sourceMappingURL=gmail-api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gmail-api.d.ts","sourceRoot":"","sources":["gmail-api.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Back-compat re-export. The canonical Gmail provider lives in
3
+ * @bobfrankston/mailx-sync. mailx-imap re-exports it under its old name so
4
+ * call sites here keep compiling. Both desktop (this package) and Android
5
+ * (mailx-store-web) consume the same single implementation now.
6
+ */
7
+ export { GmailApiProvider } from "@bobfrankston/mailx-sync";
8
+ //# sourceMappingURL=gmail-api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gmail-api.js","sourceRoot":"","sources":["gmail-api.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Back-compat re-export. The canonical Gmail provider lives in
3
+ * @bobfrankston/mailx-sync. mailx-imap re-exports it under its old name so
4
+ * call sites here keep compiling. Both desktop (this package) and Android
5
+ * (mailx-store-web) consume the same single implementation now.
6
+ */
7
+
8
+ export { GmailApiProvider } from "@bobfrankston/mailx-sync";
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Back-compat re-export. Canonical Outlook provider lives in
3
+ * @bobfrankston/mailx-sync. Same Provider abstraction as Gmail + IMAP — when
4
+ * Android adds Outlook support, both platforms share this single class.
5
+ */
6
+
7
+ export { OutlookApiProvider } from "@bobfrankston/mailx-sync";
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Back-compat re-export. The canonical mail provider types live in
3
+ * @bobfrankston/mailx-sync. New code should import from there directly.
4
+ *
5
+ * This shim keeps existing `import { ... } from "./types.js"` paths inside
6
+ * mailx-imap working without churn.
7
+ */
8
+ export type { MailProvider, ProviderFolder, ProviderMessage, FetchOptions } from "@bobfrankston/mailx-sync";
9
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Back-compat re-export. The canonical mail provider types live in
3
+ * @bobfrankston/mailx-sync. New code should import from there directly.
4
+ *
5
+ * This shim keeps existing `import { ... } from "./types.js"` paths inside
6
+ * mailx-imap working without churn.
7
+ */
8
+ export {};
9
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Back-compat re-export. The canonical mail provider types live in
3
+ * @bobfrankston/mailx-sync. New code should import from there directly.
4
+ *
5
+ * This shim keeps existing `import { ... } from "./types.js"` paths inside
6
+ * mailx-imap working without churn.
7
+ */
8
+
9
+ export type { MailProvider, ProviderFolder, ProviderMessage, FetchOptions } from "@bobfrankston/mailx-sync";
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "outDir": ".",
5
+ "rootDir": "."
6
+ },
7
+ "include": ["*.ts"],
8
+ "exclude": ["node_modules", "prev", "cruft", "tests"]
9
+ }
@@ -0,0 +1 @@
1
+ {"root":["./index.ts"],"version":"5.9.2"}
@@ -0,0 +1,10 @@
1
+ # Force LF line endings for all text files
2
+ * text=auto eol=lf
3
+
4
+ # Ensure these are always LF
5
+ *.ts text eol=lf
6
+ *.js text eol=lf
7
+ *.json text eol=lf
8
+ *.md text eol=lf
9
+ *.yml text eol=lf
10
+ *.yaml text eol=lf
@@ -0,0 +1,217 @@
1
+ # @bobfrankston/mailx-send
2
+
3
+ Queue-based mail sender with SMTP and OAuth2 support. Messages are queued as RFC 822 `.ltr` files and sent via SMTP with automatic retry.
4
+
5
+ Part of the [mailx](../../README.md) email client, but usable standalone by any application.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install @bobfrankston/mailx-send
11
+ # or globally for CLI tools:
12
+ npm install -g @bobfrankston/mailx-send
13
+ ```
14
+
15
+ ## Two CLI Commands
16
+
17
+ This package provides two commands:
18
+
19
+ - **`mailsend`** — create and queue a new message for sending
20
+ - **`mailq`** — manage the outgoing mail queue (process, retry, status)
21
+
22
+ ## Directory Structure
23
+
24
+ Each account has its own queue:
25
+
26
+ ```
27
+ {baseDir}/
28
+ {accountId}/
29
+ queue/ pending .ltr files
30
+ sent/ sent messages (YYYY/MM/DD/) — optional log
31
+ fail/ failed messages awaiting retry
32
+ ```
33
+
34
+ ## Library API
35
+
36
+ ```typescript
37
+ import { initMailSend, queueMessage } from "@bobfrankston/mailx-send";
38
+
39
+ // Initialize once at startup
40
+ initMailSend({
41
+ baseDir: "./mailqueue",
42
+ defaultAccount: "iecc",
43
+ logSent: true,
44
+ retryIntervalMs: 300000, // 5 min
45
+ accounts: {
46
+ iecc: {
47
+ host: "smtp.iecc.com",
48
+ port: 587,
49
+ auth: "password",
50
+ user: "bob",
51
+ password: "secret",
52
+ from: "Bob Frankston <bob@iecc.com>",
53
+ },
54
+ gmail: {
55
+ host: "smtp.gmail.com",
56
+ port: 587,
57
+ auth: "oauth2",
58
+ user: "bob@gmail.com",
59
+ from: "Bob Frankston <bob@gmail.com>",
60
+ tokenProvider: async () => getOAuthToken(),
61
+ },
62
+ },
63
+ });
64
+
65
+ // Queue a message — returns filename, sends in background
66
+ queueMessage({
67
+ from: "Bob Frankston <bob@iecc.com>",
68
+ to: ["alice@example.com"],
69
+ subject: "Hello",
70
+ html: "<p>Rich <b>HTML</b> body</p>",
71
+ accountId: "iecc",
72
+ });
73
+ ```
74
+
75
+ ### MailMessage interface
76
+
77
+ ```typescript
78
+ interface MailMessage {
79
+ from: string; // "Name <address>"
80
+ to: string[];
81
+ cc?: string[];
82
+ bcc?: string[];
83
+ subject: string;
84
+ html?: string; // HTML body (preferred for rich email)
85
+ text?: string; // Plain text body
86
+ inReplyTo?: string; // Message-ID for threading
87
+ references?: string; // References header for threading
88
+ accountId?: string; // Queue/account to send from
89
+ }
90
+ ```
91
+
92
+ ### Other API functions
93
+
94
+ ```typescript
95
+ import { initMailSend, queueMessage, getMailSender } from "@bobfrankston/mailx-send";
96
+
97
+ const sender = initMailSend(config);
98
+
99
+ sender.processQueue("iecc"); // Process one account's queue
100
+ sender.processAllQueues(); // Process all accounts
101
+ sender.getStatus(); // { iecc: { pending: 2, failed: 0 }, gmail: { ... } }
102
+ sender.startWorker(); // Start background retry timer (auto-started by initMailSend)
103
+ sender.stopWorker(); // Stop background processing
104
+ ```
105
+
106
+ ## CLI: mailsend
107
+
108
+ Create and queue a new message:
109
+
110
+ ```bash
111
+ # From CLI arguments
112
+ mailsend --to alice@example.com --subject "Hello" --body "Message text"
113
+ mailsend -q gmail --from "Bob <bob@gmail.com>" --to alice@example.com --subject "Test"
114
+
115
+ # From a JSON file
116
+ mailsend --json message.json
117
+ mailsend --json message.json -q gmail
118
+
119
+ # From stdin
120
+ echo '{"to":["alice@example.com"],"subject":"Test","text":"Hello"}' | mailsend --json -
121
+
122
+ # Custom config file
123
+ mailsend --config /path/to/mailsend.json --to ...
124
+ ```
125
+
126
+ ### JSON message format
127
+
128
+ ```json
129
+ {
130
+ "to": ["alice@example.com"],
131
+ "cc": ["bob@example.com"],
132
+ "from": "Bob Frankston <bob@iecc.com>",
133
+ "subject": "Hello",
134
+ "html": "<p>Rich body</p>",
135
+ "text": "Plain text fallback",
136
+ "accountId": "iecc"
137
+ }
138
+ ```
139
+
140
+ ## CLI: mailq
141
+
142
+ Manage the outgoing mail queue:
143
+
144
+ ```bash
145
+ mailq # Show queue status (all accounts)
146
+ mailq --process # Process all queues (send pending, retry failed)
147
+ mailq --process -q gmail # Process only the gmail queue
148
+ ```
149
+
150
+ ## Configuration
151
+
152
+ Create `mailsend.json`:
153
+
154
+ ```json
155
+ {
156
+ "baseDir": "./mailqueue",
157
+ "defaultAccount": "iecc",
158
+ "logSent": true,
159
+ "retryIntervalMs": 300000,
160
+ "accounts": {
161
+ "iecc": {
162
+ "host": "smtp.iecc.com",
163
+ "port": 587,
164
+ "auth": "password",
165
+ "user": "bob",
166
+ "password": "secret",
167
+ "from": "Bob Frankston <bob@iecc.com>"
168
+ }
169
+ }
170
+ }
171
+ ```
172
+
173
+ ## Queue Format
174
+
175
+ Messages are stored as `.ltr` files — standard RFC 822 format with an `X-MailSend-Account` header for routing. Filenames: `YYYYMMDD_HHMMSS-NNNN.ltr`
176
+
177
+ ## Building MIME Messages
178
+
179
+ mailx-send currently builds simple single-part RFC 822 messages (text or HTML). For complex MIME messages (multipart, attachments, inline images), use one of these packages to build the raw message, then pass it to the queue:
180
+
181
+ - **[nodemailer](https://www.npmjs.com/package/nodemailer)** — `MailComposer` class builds full MIME from parts (already a dependency)
182
+ - **[emailjs-mime-builder](https://www.npmjs.com/package/emailjs-mime-builder)** — lightweight MIME builder
183
+ - **[mimetext](https://www.npmjs.com/package/mimetext)** — simple API for building MIME messages: `createMimeMessage()`, add text/html/attachments
184
+ - **[mailcomposer](https://www.npmjs.com/package/mailcomposer)** — standalone MIME composer (from nodemailer's author)
185
+
186
+ Example with nodemailer's MailComposer:
187
+
188
+ ```typescript
189
+ import MailComposer from "nodemailer/lib/mail-composer";
190
+
191
+ const mail = new MailComposer({
192
+ from: "Bob <bob@iecc.com>",
193
+ to: "alice@example.com",
194
+ subject: "With attachment",
195
+ html: "<p>See attached</p>",
196
+ attachments: [{ filename: "doc.pdf", path: "/path/to/doc.pdf" }],
197
+ });
198
+
199
+ const raw = await mail.compile().build();
200
+ // Write raw to the queue directory as a .ltr file
201
+ ```
202
+
203
+ ## Retry
204
+
205
+ Failed messages move to `{accountId}/fail/YYYY/MM/DD/`. The background worker retries at the configured interval (default 5 min) by moving them back to the queue.
206
+
207
+ ## OAuth2 (Gmail)
208
+
209
+ Set `auth: "oauth2"` and provide a `tokenProvider` function returning a current access token. Integrates with `@bobfrankston/oauthsupport` or any OAuth2 flow.
210
+
211
+ ## Sent Log
212
+
213
+ When `logSent: true`, sent messages are preserved in `{accountId}/sent/YYYY/MM/DD/` for debugging.
214
+
215
+ ## License
216
+
217
+ MIT
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * mailq — manage the outgoing mail queue.
4
+ *
5
+ * Usage:
6
+ * mailq Show queue status (all accounts)
7
+ * mailq --process Process all queues now (send pending, retry failed)
8
+ * mailq --process -q gmail Process only the gmail queue
9
+ */
10
+ export {};
11
+ //# sourceMappingURL=cli-queue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-queue.d.ts","sourceRoot":"","sources":["cli-queue.ts"],"names":[],"mappings":";AACA;;;;;;;GAOG"}
@@ -0,0 +1,59 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * mailq — manage the outgoing mail queue.
4
+ *
5
+ * Usage:
6
+ * mailq Show queue status (all accounts)
7
+ * mailq --process Process all queues now (send pending, retry failed)
8
+ * mailq --process -q gmail Process only the gmail queue
9
+ */
10
+ import * as fs from "node:fs";
11
+ import { initMailSend } from "./index.js";
12
+ const args = process.argv.slice(2);
13
+ function getArg(name) {
14
+ const shorts = { q: "queue" };
15
+ const longIdx = args.indexOf(`--${name}`);
16
+ const shortKey = Object.entries(shorts).find(([, v]) => v === name)?.[0];
17
+ const shortIdx = shortKey ? args.indexOf(`-${shortKey}`) : -1;
18
+ const i = Math.max(longIdx, shortIdx);
19
+ if (i === -1 || i + 1 >= args.length)
20
+ return undefined;
21
+ return args[i + 1];
22
+ }
23
+ function hasFlag(name) {
24
+ return args.includes(`--${name}`);
25
+ }
26
+ const configPath = getArg("config") || "mailsend.json";
27
+ if (!fs.existsSync(configPath)) {
28
+ console.error(`Config file not found: ${configPath}`);
29
+ process.exit(1);
30
+ }
31
+ const config = JSON.parse(fs.readFileSync(configPath, "utf-8"));
32
+ const sender = initMailSend(config);
33
+ if (hasFlag("process")) {
34
+ const accountId = getArg("queue");
35
+ if (accountId) {
36
+ await sender.processQueue(accountId);
37
+ }
38
+ else {
39
+ await sender.processAllQueues();
40
+ }
41
+ // Show status after processing
42
+ const status = sender.getStatus();
43
+ for (const [id, s] of Object.entries(status)) {
44
+ console.log(` ${id}: ${s.pending} pending, ${s.failed} failed`);
45
+ }
46
+ }
47
+ else {
48
+ // Default: show status
49
+ const status = sender.getStatus();
50
+ let total = 0;
51
+ for (const [id, s] of Object.entries(status)) {
52
+ console.log(` ${id}: ${s.pending} pending, ${s.failed} failed`);
53
+ total += s.pending + s.failed;
54
+ }
55
+ if (total === 0)
56
+ console.log(" All queues empty");
57
+ }
58
+ process.exit(0);
59
+ //# sourceMappingURL=cli-queue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-queue.js","sourceRoot":"","sources":["cli-queue.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,62 @@
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);
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * mailsend — create and send an email message.
4
+ *
5
+ * Usage:
6
+ * mailsend --to addr --subject "text" --body "text"
7
+ * mailsend -q gmail --from "Bob <bob@gmail.com>" --to addr --subject "text"
8
+ * mailsend --json message.json Read message from JSON file
9
+ * echo '{"to":["a@b.com"],...}' | mailsend --json - Read from stdin
10
+ *
11
+ * JSON format:
12
+ * { "to": ["addr"], "cc": ["addr"], "from": "Name <addr>",
13
+ * "subject": "text", "text": "body", "html": "<p>body</p>",
14
+ * "accountId": "iecc" }
15
+ */
16
+ export {};
17
+ //# sourceMappingURL=cli-send.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-send.d.ts","sourceRoot":"","sources":["cli-send.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;GAaG"}