imap-wizard 0.0.0-stage → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (404) hide show
  1. package/COPYING +674 -0
  2. package/LICENSE +155 -0
  3. package/README.md +498 -2
  4. package/dist/app.d.ts +61 -0
  5. package/dist/app.d.ts.map +1 -0
  6. package/dist/app.js +201 -0
  7. package/dist/app.js.map +1 -0
  8. package/dist/cache/body-cache.d.ts +29 -0
  9. package/dist/cache/body-cache.d.ts.map +1 -0
  10. package/dist/cache/body-cache.js +95 -0
  11. package/dist/cache/body-cache.js.map +1 -0
  12. package/dist/cache/schema.d.ts +40 -0
  13. package/dist/cache/schema.d.ts.map +1 -0
  14. package/dist/cache/schema.js +160 -0
  15. package/dist/cache/schema.js.map +1 -0
  16. package/dist/cache/store.d.ts +233 -0
  17. package/dist/cache/store.d.ts.map +1 -0
  18. package/dist/cache/store.js +556 -0
  19. package/dist/cache/store.js.map +1 -0
  20. package/dist/cache/sync-engine.d.ts +140 -0
  21. package/dist/cache/sync-engine.d.ts.map +1 -0
  22. package/dist/cache/sync-engine.js +477 -0
  23. package/dist/cache/sync-engine.js.map +1 -0
  24. package/dist/cli/account-commands.d.ts +51 -0
  25. package/dist/cli/account-commands.d.ts.map +1 -0
  26. package/dist/cli/account-commands.js +767 -0
  27. package/dist/cli/account-commands.js.map +1 -0
  28. package/dist/cli/config-commands.d.ts +9 -0
  29. package/dist/cli/config-commands.d.ts.map +1 -0
  30. package/dist/cli/config-commands.js +293 -0
  31. package/dist/cli/config-commands.js.map +1 -0
  32. package/dist/cli/email-commands.d.ts +18 -0
  33. package/dist/cli/email-commands.d.ts.map +1 -0
  34. package/dist/cli/email-commands.js +447 -0
  35. package/dist/cli/email-commands.js.map +1 -0
  36. package/dist/cli/guard.d.ts +11 -0
  37. package/dist/cli/guard.d.ts.map +1 -0
  38. package/dist/cli/guard.js +18 -0
  39. package/dist/cli/guard.js.map +1 -0
  40. package/dist/cli/http.d.ts +15 -0
  41. package/dist/cli/http.d.ts.map +1 -0
  42. package/dist/cli/http.js +263 -0
  43. package/dist/cli/http.js.map +1 -0
  44. package/dist/cli/install-commands.d.ts +18 -0
  45. package/dist/cli/install-commands.d.ts.map +1 -0
  46. package/dist/cli/install-commands.js +323 -0
  47. package/dist/cli/install-commands.js.map +1 -0
  48. package/dist/cli/keychain-commands.d.ts +9 -0
  49. package/dist/cli/keychain-commands.d.ts.map +1 -0
  50. package/dist/cli/keychain-commands.js +243 -0
  51. package/dist/cli/keychain-commands.js.map +1 -0
  52. package/dist/cli/notify.d.ts +8 -0
  53. package/dist/cli/notify.d.ts.map +1 -0
  54. package/dist/cli/notify.js +143 -0
  55. package/dist/cli/notify.js.map +1 -0
  56. package/dist/cli/providers.d.ts +13 -0
  57. package/dist/cli/providers.d.ts.map +1 -0
  58. package/dist/cli/providers.js +180 -0
  59. package/dist/cli/providers.js.map +1 -0
  60. package/dist/cli/scheduler.d.ts +8 -0
  61. package/dist/cli/scheduler.d.ts.map +1 -0
  62. package/dist/cli/scheduler.js +268 -0
  63. package/dist/cli/scheduler.js.map +1 -0
  64. package/dist/cli/setup.d.ts +12 -0
  65. package/dist/cli/setup.d.ts.map +1 -0
  66. package/dist/cli/setup.js +15 -0
  67. package/dist/cli/setup.js.map +1 -0
  68. package/dist/cli/test.d.ts +7 -0
  69. package/dist/cli/test.d.ts.map +1 -0
  70. package/dist/cli/test.js +67 -0
  71. package/dist/cli/test.js.map +1 -0
  72. package/dist/config/loader.d.ts +45 -0
  73. package/dist/config/loader.d.ts.map +1 -0
  74. package/dist/config/loader.js +487 -0
  75. package/dist/config/loader.js.map +1 -0
  76. package/dist/config/password-command.d.ts +14 -0
  77. package/dist/config/password-command.d.ts.map +1 -0
  78. package/dist/config/password-command.js +74 -0
  79. package/dist/config/password-command.js.map +1 -0
  80. package/dist/config/schema.d.ts +416 -0
  81. package/dist/config/schema.d.ts.map +1 -0
  82. package/dist/config/schema.js +260 -0
  83. package/dist/config/schema.js.map +1 -0
  84. package/dist/config/send-limit.d.ts +18 -0
  85. package/dist/config/send-limit.d.ts.map +1 -0
  86. package/dist/config/send-limit.js +64 -0
  87. package/dist/config/send-limit.js.map +1 -0
  88. package/dist/config/validate.d.ts +30 -0
  89. package/dist/config/validate.d.ts.map +1 -0
  90. package/dist/config/validate.js +120 -0
  91. package/dist/config/validate.js.map +1 -0
  92. package/dist/config/xdg.d.ts +44 -0
  93. package/dist/config/xdg.d.ts.map +1 -0
  94. package/dist/config/xdg.js +49 -0
  95. package/dist/config/xdg.js.map +1 -0
  96. package/dist/connections/manager.d.ts +53 -0
  97. package/dist/connections/manager.d.ts.map +1 -0
  98. package/dist/connections/manager.js +376 -0
  99. package/dist/connections/manager.js.map +1 -0
  100. package/dist/connections/types.d.ts +15 -0
  101. package/dist/connections/types.d.ts.map +1 -0
  102. package/dist/connections/types.js +2 -0
  103. package/dist/connections/types.js.map +1 -0
  104. package/dist/logging.d.ts +22 -0
  105. package/dist/logging.d.ts.map +1 -0
  106. package/dist/logging.js +33 -0
  107. package/dist/logging.js.map +1 -0
  108. package/dist/main.d.ts +15 -0
  109. package/dist/main.d.ts.map +1 -0
  110. package/dist/main.js +276 -0
  111. package/dist/main.js.map +1 -0
  112. package/dist/prompts/actions.prompt.d.ts +9 -0
  113. package/dist/prompts/actions.prompt.d.ts.map +1 -0
  114. package/dist/prompts/actions.prompt.js +70 -0
  115. package/dist/prompts/actions.prompt.js.map +1 -0
  116. package/dist/prompts/calendar.prompt.d.ts +9 -0
  117. package/dist/prompts/calendar.prompt.d.ts.map +1 -0
  118. package/dist/prompts/calendar.prompt.js +59 -0
  119. package/dist/prompts/calendar.prompt.js.map +1 -0
  120. package/dist/prompts/cleanup.prompt.d.ts +9 -0
  121. package/dist/prompts/cleanup.prompt.d.ts.map +1 -0
  122. package/dist/prompts/cleanup.prompt.js +82 -0
  123. package/dist/prompts/cleanup.prompt.js.map +1 -0
  124. package/dist/prompts/compose.prompt.d.ts +8 -0
  125. package/dist/prompts/compose.prompt.d.ts.map +1 -0
  126. package/dist/prompts/compose.prompt.js +124 -0
  127. package/dist/prompts/compose.prompt.js.map +1 -0
  128. package/dist/prompts/register.d.ts +8 -0
  129. package/dist/prompts/register.d.ts.map +1 -0
  130. package/dist/prompts/register.js +20 -0
  131. package/dist/prompts/register.js.map +1 -0
  132. package/dist/prompts/thread.prompt.d.ts +9 -0
  133. package/dist/prompts/thread.prompt.d.ts.map +1 -0
  134. package/dist/prompts/thread.prompt.js +62 -0
  135. package/dist/prompts/thread.prompt.js.map +1 -0
  136. package/dist/prompts/triage.prompt.d.ts +9 -0
  137. package/dist/prompts/triage.prompt.d.ts.map +1 -0
  138. package/dist/prompts/triage.prompt.js +71 -0
  139. package/dist/prompts/triage.prompt.js.map +1 -0
  140. package/dist/resources/accounts.resource.d.ts +9 -0
  141. package/dist/resources/accounts.resource.d.ts.map +1 -0
  142. package/dist/resources/accounts.resource.js +26 -0
  143. package/dist/resources/accounts.resource.js.map +1 -0
  144. package/dist/resources/mailboxes.resource.d.ts +10 -0
  145. package/dist/resources/mailboxes.resource.d.ts.map +1 -0
  146. package/dist/resources/mailboxes.resource.js +33 -0
  147. package/dist/resources/mailboxes.resource.js.map +1 -0
  148. package/dist/resources/register.d.ts +12 -0
  149. package/dist/resources/register.d.ts.map +1 -0
  150. package/dist/resources/register.js +20 -0
  151. package/dist/resources/register.js.map +1 -0
  152. package/dist/resources/scheduled.resource.d.ts +9 -0
  153. package/dist/resources/scheduled.resource.d.ts.map +1 -0
  154. package/dist/resources/scheduled.resource.js +31 -0
  155. package/dist/resources/scheduled.resource.js.map +1 -0
  156. package/dist/resources/stats.resource.d.ts +10 -0
  157. package/dist/resources/stats.resource.d.ts.map +1 -0
  158. package/dist/resources/stats.resource.js +50 -0
  159. package/dist/resources/stats.resource.js.map +1 -0
  160. package/dist/resources/templates.resource.d.ts +9 -0
  161. package/dist/resources/templates.resource.d.ts.map +1 -0
  162. package/dist/resources/templates.resource.js +34 -0
  163. package/dist/resources/templates.resource.js.map +1 -0
  164. package/dist/resources/unread.resource.d.ts +11 -0
  165. package/dist/resources/unread.resource.d.ts.map +1 -0
  166. package/dist/resources/unread.resource.js +53 -0
  167. package/dist/resources/unread.resource.js.map +1 -0
  168. package/dist/safety/audit.d.ts +17 -0
  169. package/dist/safety/audit.d.ts.map +1 -0
  170. package/dist/safety/audit.js +50 -0
  171. package/dist/safety/audit.js.map +1 -0
  172. package/dist/safety/rate-limiter.d.ts +22 -0
  173. package/dist/safety/rate-limiter.d.ts.map +1 -0
  174. package/dist/safety/rate-limiter.js +52 -0
  175. package/dist/safety/rate-limiter.js.map +1 -0
  176. package/dist/safety/validation.d.ts +46 -0
  177. package/dist/safety/validation.d.ts.map +1 -0
  178. package/dist/safety/validation.js +114 -0
  179. package/dist/safety/validation.js.map +1 -0
  180. package/dist/safety/webhook-guard.d.ts +33 -0
  181. package/dist/safety/webhook-guard.d.ts.map +1 -0
  182. package/dist/safety/webhook-guard.js +154 -0
  183. package/dist/safety/webhook-guard.js.map +1 -0
  184. package/dist/security/keychain.d.ts +31 -0
  185. package/dist/security/keychain.d.ts.map +1 -0
  186. package/dist/security/keychain.js +217 -0
  187. package/dist/security/keychain.js.map +1 -0
  188. package/dist/server.d.ts +13 -0
  189. package/dist/server.d.ts.map +1 -0
  190. package/dist/server.js +35 -0
  191. package/dist/server.js.map +1 -0
  192. package/dist/services/calendar.service.d.ts +22 -0
  193. package/dist/services/calendar.service.d.ts.map +1 -0
  194. package/dist/services/calendar.service.js +115 -0
  195. package/dist/services/calendar.service.js.map +1 -0
  196. package/dist/services/clipboard.service.d.ts +16 -0
  197. package/dist/services/clipboard.service.d.ts.map +1 -0
  198. package/dist/services/clipboard.service.js +92 -0
  199. package/dist/services/clipboard.service.js.map +1 -0
  200. package/dist/services/event-bus.d.ts +62 -0
  201. package/dist/services/event-bus.d.ts.map +1 -0
  202. package/dist/services/event-bus.js +16 -0
  203. package/dist/services/event-bus.js.map +1 -0
  204. package/dist/services/hooks.service.d.ts +88 -0
  205. package/dist/services/hooks.service.d.ts.map +1 -0
  206. package/dist/services/hooks.service.js +539 -0
  207. package/dist/services/hooks.service.js.map +1 -0
  208. package/dist/services/imap.service.d.ts +301 -0
  209. package/dist/services/imap.service.d.ts.map +1 -0
  210. package/dist/services/imap.service.js +2135 -0
  211. package/dist/services/imap.service.js.map +1 -0
  212. package/dist/services/label-strategy.d.ts +20 -0
  213. package/dist/services/label-strategy.d.ts.map +1 -0
  214. package/dist/services/label-strategy.js +247 -0
  215. package/dist/services/label-strategy.js.map +1 -0
  216. package/dist/services/local-calendar.service.d.ts +127 -0
  217. package/dist/services/local-calendar.service.d.ts.map +1 -0
  218. package/dist/services/local-calendar.service.js +537 -0
  219. package/dist/services/local-calendar.service.js.map +1 -0
  220. package/dist/services/notifier.service.d.ts +91 -0
  221. package/dist/services/notifier.service.d.ts.map +1 -0
  222. package/dist/services/notifier.service.js +381 -0
  223. package/dist/services/notifier.service.js.map +1 -0
  224. package/dist/services/oauth.service.d.ts +47 -0
  225. package/dist/services/oauth.service.d.ts.map +1 -0
  226. package/dist/services/oauth.service.js +140 -0
  227. package/dist/services/oauth.service.js.map +1 -0
  228. package/dist/services/presets.d.ts +36 -0
  229. package/dist/services/presets.d.ts.map +1 -0
  230. package/dist/services/presets.js +175 -0
  231. package/dist/services/presets.js.map +1 -0
  232. package/dist/services/reminders.service.d.ts +63 -0
  233. package/dist/services/reminders.service.d.ts.map +1 -0
  234. package/dist/services/reminders.service.js +305 -0
  235. package/dist/services/reminders.service.js.map +1 -0
  236. package/dist/services/scheduler.service.d.ts +42 -0
  237. package/dist/services/scheduler.service.d.ts.map +1 -0
  238. package/dist/services/scheduler.service.js +294 -0
  239. package/dist/services/scheduler.service.js.map +1 -0
  240. package/dist/services/smtp.service.d.ts +97 -0
  241. package/dist/services/smtp.service.d.ts.map +1 -0
  242. package/dist/services/smtp.service.js +339 -0
  243. package/dist/services/smtp.service.js.map +1 -0
  244. package/dist/services/template.service.d.ts +33 -0
  245. package/dist/services/template.service.d.ts.map +1 -0
  246. package/dist/services/template.service.js +123 -0
  247. package/dist/services/template.service.js.map +1 -0
  248. package/dist/services/verification.service.d.ts +26 -0
  249. package/dist/services/verification.service.d.ts.map +1 -0
  250. package/dist/services/verification.service.js +94 -0
  251. package/dist/services/verification.service.js.map +1 -0
  252. package/dist/services/watcher.service.d.ts +36 -0
  253. package/dist/services/watcher.service.d.ts.map +1 -0
  254. package/dist/services/watcher.service.js +238 -0
  255. package/dist/services/watcher.service.js.map +1 -0
  256. package/dist/tools/accounts.tool.d.ts +7 -0
  257. package/dist/tools/accounts.tool.d.ts.map +1 -0
  258. package/dist/tools/accounts.tool.js +33 -0
  259. package/dist/tools/accounts.tool.js.map +1 -0
  260. package/dist/tools/analytics.tool.d.ts +9 -0
  261. package/dist/tools/analytics.tool.d.ts.map +1 -0
  262. package/dist/tools/analytics.tool.js +32 -0
  263. package/dist/tools/analytics.tool.js.map +1 -0
  264. package/dist/tools/attachments.tool.d.ts +7 -0
  265. package/dist/tools/attachments.tool.d.ts.map +1 -0
  266. package/dist/tools/attachments.tool.js +93 -0
  267. package/dist/tools/attachments.tool.js.map +1 -0
  268. package/dist/tools/bulk.tool.d.ts +7 -0
  269. package/dist/tools/bulk.tool.d.ts.map +1 -0
  270. package/dist/tools/bulk.tool.js +80 -0
  271. package/dist/tools/bulk.tool.js.map +1 -0
  272. package/dist/tools/calendar.tool.d.ts +19 -0
  273. package/dist/tools/calendar.tool.d.ts.map +1 -0
  274. package/dist/tools/calendar.tool.js +576 -0
  275. package/dist/tools/calendar.tool.js.map +1 -0
  276. package/dist/tools/contacts.tool.d.ts +7 -0
  277. package/dist/tools/contacts.tool.d.ts.map +1 -0
  278. package/dist/tools/contacts.tool.js +49 -0
  279. package/dist/tools/contacts.tool.js.map +1 -0
  280. package/dist/tools/drafts.tool.d.ts +8 -0
  281. package/dist/tools/drafts.tool.d.ts.map +1 -0
  282. package/dist/tools/drafts.tool.js +110 -0
  283. package/dist/tools/drafts.tool.js.map +1 -0
  284. package/dist/tools/emails.tool.d.ts +17 -0
  285. package/dist/tools/emails.tool.d.ts.map +1 -0
  286. package/dist/tools/emails.tool.js +508 -0
  287. package/dist/tools/emails.tool.js.map +1 -0
  288. package/dist/tools/folders.tool.d.ts +7 -0
  289. package/dist/tools/folders.tool.d.ts.map +1 -0
  290. package/dist/tools/folders.tool.js +129 -0
  291. package/dist/tools/folders.tool.js.map +1 -0
  292. package/dist/tools/health.tool.d.ts +10 -0
  293. package/dist/tools/health.tool.d.ts.map +1 -0
  294. package/dist/tools/health.tool.js +106 -0
  295. package/dist/tools/health.tool.js.map +1 -0
  296. package/dist/tools/label.tool.d.ts +11 -0
  297. package/dist/tools/label.tool.d.ts.map +1 -0
  298. package/dist/tools/label.tool.js +190 -0
  299. package/dist/tools/label.tool.js.map +1 -0
  300. package/dist/tools/locate.tool.d.ts +11 -0
  301. package/dist/tools/locate.tool.d.ts.map +1 -0
  302. package/dist/tools/locate.tool.js +65 -0
  303. package/dist/tools/locate.tool.js.map +1 -0
  304. package/dist/tools/mailboxes.tool.d.ts +7 -0
  305. package/dist/tools/mailboxes.tool.d.ts.map +1 -0
  306. package/dist/tools/mailboxes.tool.js +49 -0
  307. package/dist/tools/mailboxes.tool.js.map +1 -0
  308. package/dist/tools/manage.tool.d.ts +7 -0
  309. package/dist/tools/manage.tool.d.ts.map +1 -0
  310. package/dist/tools/manage.tool.js +140 -0
  311. package/dist/tools/manage.tool.js.map +1 -0
  312. package/dist/tools/register.d.ts +20 -0
  313. package/dist/tools/register.d.ts.map +1 -0
  314. package/dist/tools/register.js +60 -0
  315. package/dist/tools/register.js.map +1 -0
  316. package/dist/tools/scheduler.tool.d.ts +9 -0
  317. package/dist/tools/scheduler.tool.d.ts.map +1 -0
  318. package/dist/tools/scheduler.tool.js +130 -0
  319. package/dist/tools/scheduler.tool.js.map +1 -0
  320. package/dist/tools/schemas.d.ts +146 -0
  321. package/dist/tools/schemas.d.ts.map +1 -0
  322. package/dist/tools/schemas.js +89 -0
  323. package/dist/tools/schemas.js.map +1 -0
  324. package/dist/tools/security.tool.d.ts +11 -0
  325. package/dist/tools/security.tool.d.ts.map +1 -0
  326. package/dist/tools/security.tool.js +49 -0
  327. package/dist/tools/security.tool.js.map +1 -0
  328. package/dist/tools/send.tool.d.ts +7 -0
  329. package/dist/tools/send.tool.d.ts.map +1 -0
  330. package/dist/tools/send.tool.js +196 -0
  331. package/dist/tools/send.tool.js.map +1 -0
  332. package/dist/tools/templates.tool.d.ts +12 -0
  333. package/dist/tools/templates.tool.d.ts.map +1 -0
  334. package/dist/tools/templates.tool.js +149 -0
  335. package/dist/tools/templates.tool.js.map +1 -0
  336. package/dist/tools/thread.tool.d.ts +10 -0
  337. package/dist/tools/thread.tool.d.ts.map +1 -0
  338. package/dist/tools/thread.tool.js +140 -0
  339. package/dist/tools/thread.tool.js.map +1 -0
  340. package/dist/tools/verification.tool.d.ts +5 -0
  341. package/dist/tools/verification.tool.d.ts.map +1 -0
  342. package/dist/tools/verification.tool.js +125 -0
  343. package/dist/tools/verification.tool.js.map +1 -0
  344. package/dist/tools/watcher.tool.d.ts +19 -0
  345. package/dist/tools/watcher.tool.d.ts.map +1 -0
  346. package/dist/tools/watcher.tool.js +319 -0
  347. package/dist/tools/watcher.tool.js.map +1 -0
  348. package/dist/types/index.d.ts +329 -0
  349. package/dist/types/index.d.ts.map +1 -0
  350. package/dist/types/index.js +5 -0
  351. package/dist/types/index.js.map +1 -0
  352. package/dist/utils/auth-results.d.ts +24 -0
  353. package/dist/utils/auth-results.d.ts.map +1 -0
  354. package/dist/utils/auth-results.js +71 -0
  355. package/dist/utils/auth-results.js.map +1 -0
  356. package/dist/utils/bulk-headers.d.ts +34 -0
  357. package/dist/utils/bulk-headers.d.ts.map +1 -0
  358. package/dist/utils/bulk-headers.js +112 -0
  359. package/dist/utils/bulk-headers.js.map +1 -0
  360. package/dist/utils/calendar-notes.d.ts +31 -0
  361. package/dist/utils/calendar-notes.d.ts.map +1 -0
  362. package/dist/utils/calendar-notes.js +83 -0
  363. package/dist/utils/calendar-notes.js.map +1 -0
  364. package/dist/utils/calendar-state.d.ts +27 -0
  365. package/dist/utils/calendar-state.d.ts.map +1 -0
  366. package/dist/utils/calendar-state.js +85 -0
  367. package/dist/utils/calendar-state.js.map +1 -0
  368. package/dist/utils/conference-details.d.ts +12 -0
  369. package/dist/utils/conference-details.d.ts.map +1 -0
  370. package/dist/utils/conference-details.js +71 -0
  371. package/dist/utils/conference-details.js.map +1 -0
  372. package/dist/utils/html.d.ts +24 -0
  373. package/dist/utils/html.d.ts.map +1 -0
  374. package/dist/utils/html.js +162 -0
  375. package/dist/utils/html.js.map +1 -0
  376. package/dist/utils/imap-client.d.ts +22 -0
  377. package/dist/utils/imap-client.d.ts.map +1 -0
  378. package/dist/utils/imap-client.js +26 -0
  379. package/dist/utils/imap-client.js.map +1 -0
  380. package/dist/utils/imap-error.d.ts +28 -0
  381. package/dist/utils/imap-error.d.ts.map +1 -0
  382. package/dist/utils/imap-error.js +82 -0
  383. package/dist/utils/imap-error.js.map +1 -0
  384. package/dist/utils/meeting-url.d.ts +10 -0
  385. package/dist/utils/meeting-url.d.ts.map +1 -0
  386. package/dist/utils/meeting-url.js +30 -0
  387. package/dist/utils/meeting-url.js.map +1 -0
  388. package/dist/utils/offline-notice.d.ts +10 -0
  389. package/dist/utils/offline-notice.d.ts.map +1 -0
  390. package/dist/utils/offline-notice.js +10 -0
  391. package/dist/utils/offline-notice.js.map +1 -0
  392. package/dist/utils/reply-chain.d.ts +6 -0
  393. package/dist/utils/reply-chain.d.ts.map +1 -0
  394. package/dist/utils/reply-chain.js +15 -0
  395. package/dist/utils/reply-chain.js.map +1 -0
  396. package/dist/utils/verification-code.d.ts +29 -0
  397. package/dist/utils/verification-code.d.ts.map +1 -0
  398. package/dist/utils/verification-code.js +305 -0
  399. package/dist/utils/verification-code.js.map +1 -0
  400. package/dist/utils/verification-link.d.ts +26 -0
  401. package/dist/utils/verification-link.d.ts.map +1 -0
  402. package/dist/utils/verification-link.js +197 -0
  403. package/dist/utils/verification-link.js.map +1 -0
  404. package/package.json +106 -4
package/LICENSE ADDED
@@ -0,0 +1,155 @@
1
+ GNU LESSER GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5
+
6
+ Everyone is permitted to copy and distribute verbatim copies of this license
7
+ document, but changing it is not allowed.
8
+
9
+ This version of the GNU Lesser General Public License incorporates the terms
10
+ and conditions of version 3 of the GNU General Public License, supplemented
11
+ by the additional permissions listed below.
12
+
13
+ 0. Additional Definitions.
14
+
15
+ As used herein, "this License" refers to version 3 of the GNU Lesser General
16
+ Public License, and the "GNU GPL" refers to version 3 of the
17
+ GNU General Public License.
18
+
19
+ "The Library" refers to a covered work governed by this License, other than
20
+ an Application or a Combined Work as defined below.
21
+
22
+ An "Application" is any work that makes use of an interface provided by the
23
+ Library, but which is not otherwise based on the Library. Defining a subclass
24
+ of a class defined by the Library is deemed a mode of using an interface
25
+ provided by the Library.
26
+
27
+ A "Combined Work" is a work produced by combining or linking an Application
28
+ with the Library. The particular version of the Library with which the
29
+ Combined Work was made is also called the "Linked Version".
30
+
31
+ The "Minimal Corresponding Source" for a Combined Work means the Corresponding
32
+ Source for the Combined Work, excluding any source code for portions of the
33
+ Combined Work that, considered in isolation, are based on the Application,
34
+ and not on the Linked Version.
35
+
36
+ The "Corresponding Application Code" for a Combined Work means the object code
37
+ and/or source code for the Application, including any data and utility programs
38
+ needed for reproducing the Combined Work from the Application, but excluding
39
+ the System Libraries of the Combined Work.
40
+
41
+ 1. Exception to Section 3 of the GNU GPL.
42
+
43
+ You may convey a covered work under sections 3 and 4 of this License without
44
+ being bound by section 3 of the GNU GPL.
45
+
46
+ 2. Conveying Modified Versions.
47
+
48
+ If you modify a copy of the Library, and, in your modifications, a facility
49
+ refers to a function or data to be supplied by an Application that uses the
50
+ facility (other than as an argument passed when the facility is invoked),
51
+ then you may convey a copy of the modified version:
52
+
53
+ a) under this License, provided that you make a good faith effort to
54
+ ensure that, in the event an Application does not supply the function or
55
+ data, the facility still operates, and performs whatever part of its
56
+ purpose remains meaningful, or
57
+
58
+ b) under the GNU GPL, with none of the additional permissions of this
59
+ License applicable to that copy.
60
+
61
+ 3. Object Code Incorporating Material from Library Header Files.
62
+
63
+ The object code form of an Application may incorporate material from a header
64
+ file that is part of the Library. You may convey such object code under terms
65
+ of your choice, provided that, if the incorporated material is not limited to
66
+ numerical parameters, data structure layouts and accessors, or small macros,
67
+ inline functions and templates (ten or fewer lines in length),
68
+ you do both of the following:
69
+
70
+ a) Give prominent notice with each copy of the object code that the Library
71
+ is used in it and that the Library and its use are covered by this License.
72
+
73
+ b) Accompany the object code with a copy of the GNU GPL
74
+ and this license document.
75
+
76
+ 4. Combined Works.
77
+
78
+ You may convey a Combined Work under terms of your choice that, taken together,
79
+ effectively do not restrict modification of the portions of the Library
80
+ contained in the Combined Work and reverse engineering for debugging such
81
+ modifications, if you also do each of the following:
82
+
83
+ a) Give prominent notice with each copy of the Combined Work that the
84
+ Library is used in it and that the Library and its use are covered
85
+ by this License.
86
+
87
+ b) Accompany the Combined Work with a copy of the GNU GPL and
88
+ this license document.
89
+
90
+ c) For a Combined Work that displays copyright notices during execution,
91
+ include the copyright notice for the Library among these notices, as well
92
+ as a reference directing the user to the copies of the GNU GPL
93
+ and this license document.
94
+
95
+ d) Do one of the following:
96
+
97
+ 0) Convey the Minimal Corresponding Source under the terms of this
98
+ License, and the Corresponding Application Code in a form suitable
99
+ for, and under terms that permit, the user to recombine or relink
100
+ the Application with a modified version of the Linked Version to
101
+ produce a modified Combined Work, in the manner specified by section 6
102
+ of the GNU GPL for conveying Corresponding Source.
103
+
104
+ 1) Use a suitable shared library mechanism for linking with the
105
+ Library. A suitable mechanism is one that (a) uses at run time a
106
+ copy of the Library already present on the user's computer system,
107
+ and (b) will operate properly with a modified version of the Library
108
+ that is interface-compatible with the Linked Version.
109
+
110
+ e) Provide Installation Information, but only if you would otherwise be
111
+ required to provide such information under section 6 of the GNU GPL, and
112
+ only to the extent that such information is necessary to install and
113
+ execute a modified version of the Combined Work produced by recombining
114
+ or relinking the Application with a modified version of the Linked Version.
115
+ (If you use option 4d0, the Installation Information must accompany the
116
+ Minimal Corresponding Source and Corresponding Application Code. If you
117
+ use option 4d1, you must provide the Installation Information in the
118
+ manner specified by section 6 of the GNU GPL for
119
+ conveying Corresponding Source.)
120
+
121
+ 5. Combined Libraries.
122
+
123
+ You may place library facilities that are a work based on the Library side by
124
+ side in a single library together with other library facilities that are not
125
+ Applications and are not covered by this License, and convey such a combined
126
+ library under terms of your choice, if you do both of the following:
127
+
128
+ a) Accompany the combined library with a copy of the same work based on
129
+ the Library, uncombined with any other library facilities, conveyed under
130
+ the terms of this License.
131
+
132
+ b) Give prominent notice with the combined library that part of it is a
133
+ work based on the Library, and explaining where to find the accompanying
134
+ uncombined form of the same work.
135
+
136
+ 6. Revised Versions of the GNU Lesser General Public License.
137
+
138
+ The Free Software Foundation may publish revised and/or new versions of the
139
+ GNU Lesser General Public License from time to time. Such new versions will
140
+ be similar in spirit to the present version, but may differ in detail to
141
+ address new problems or concerns.
142
+
143
+ Each version is given a distinguishing version number. If the Library as you
144
+ received it specifies that a certain numbered version of the GNU Lesser
145
+ General Public License "or any later version" applies to it, you have the
146
+ option of following the terms and conditions either of that published version
147
+ or of any later version published by the Free Software Foundation. If the
148
+ Library as you received it does not specify a version number of the GNU Lesser
149
+ General Public License, you may choose any version of the GNU Lesser General
150
+ Public License ever published by the Free Software Foundation.
151
+
152
+ If the Library as you received it specifies that a proxy can decide whether
153
+ future versions of the GNU Lesser General Public License shall apply, that
154
+ proxy's public statement of acceptance of any version is permanent
155
+ authorization for you to choose that version for the Library.
package/README.md CHANGED
@@ -1,3 +1,499 @@
1
- # Temporary Holding Version
1
+ <div align="center">
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ # IMAP Wizard
4
+
5
+ <img src="docs/assets/banner.svg" alt="IMAP Wizard: email MCP server with 50 core tools plus an opt-in verification tool, 588 tests green, 18 upstream bugs fixed" width="100%">
6
+
7
+ **Give your AI assistant your email, on your terms.**
8
+ A local [MCP](https://modelcontextprotocol.io) server that lets Claude, Codex,
9
+ Cursor, VS Code, OpenCode or any MCP client read, search, send and organize mail
10
+ over plain IMAP and SMTP. No cloud service in the middle.
11
+
12
+ [![release](https://img.shields.io/github/v/release/Fe2-O3/imap-wizard?label=release&color=8B5CF6&style=flat-square)](https://github.com/Fe2-O3/imap-wizard/releases)
13
+ [![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg?style=flat-square)](LICENSE)
14
+ [![tests](https://img.shields.io/badge/tests-588%20passing-22c55e?style=flat-square)](#development)
15
+ [![Node.js 24+](https://img.shields.io/badge/Node.js-24+-339933?style=flat-square&logo=node.js&logoColor=white)](https://nodejs.org)
16
+ [![MCP SDK v2](https://img.shields.io/badge/MCP-SDK%20v2-8B5CF6?style=flat-square)](https://modelcontextprotocol.io)
17
+
18
+ <a href="#quick-start">Quick start</a> ·
19
+ <a href="#why-this-one">Why this one</a> ·
20
+ <a href="#safety-and-privacy">Safety</a> ·
21
+ <a href="#what-it-can-do">Tools</a> ·
22
+ <a href="#configuration">Config</a> ·
23
+ <a href="#troubleshooting">Troubleshooting</a> ·
24
+ <a href="#relationship-to-upstream">Upstream</a>
25
+
26
+ </div>
27
+
28
+ > **A fork, credited.** IMAP Wizard is a fork of
29
+ > [codefuturist/email-mcp](https://github.com/codefuturist/email-mcp) by
30
+ > [@codefuturist](https://github.com/codefuturist), under the same
31
+ > [LGPL-3.0-or-later](LICENSE) license. It keeps upstream's design and history,
32
+ > fixes bugs that are still open on the upstream tracker, and adds safety
33
+ > features. The package and command are called `imap-wizard`. See
34
+ > [Relationship to upstream](#relationship-to-upstream).
35
+
36
+ ---
37
+
38
+ ## Quick start
39
+
40
+ You need **Node.js 24+**.
41
+
42
+ ```bash
43
+ npx -y imap-wizard account add # wizard; auto-detects common providers
44
+ npx -y imap-wizard test # checks IMAP and SMTP for every account
45
+ npx -y imap-wizard install # registers the server with detected MCP clients
46
+ ```
47
+
48
+ Or add it to a client by hand. Claude Code:
49
+
50
+ ```bash
51
+ claude mcp add email -- npx -y imap-wizard stdio
52
+ ```
53
+
54
+ Claude Desktop, Cursor and most other clients take the same JSON shape:
55
+
56
+ ```json
57
+ {
58
+ "mcpServers": {
59
+ "email": {
60
+ "command": "npx",
61
+ "args": ["-y", "imap-wizard", "stdio"]
62
+ }
63
+ }
64
+ }
65
+ ```
66
+
67
+ Prefer a global command? `npm i -g imap-wizard`, then run `imap-wizard account add`
68
+ and so on. To build from source instead:
69
+
70
+ ```bash
71
+ git clone https://github.com/Fe2-O3/imap-wizard.git
72
+ cd imap-wizard
73
+ pnpm install && pnpm build
74
+ node dist/main.js account add
75
+ ```
76
+
77
+ and point the client at `node /absolute/path/to/imap-wizard/dist/main.js stdio`.
78
+
79
+ Ask your assistant *"What's unread in my inbox?"* to check it works.
80
+ Setup for other clients is under [More clients](#more-clients).
81
+
82
+ > [!NOTE]
83
+ > An existing `~/.config/email-mcp` config keeps working unchanged.
84
+
85
+ ---
86
+
87
+ ## What you can ask for
88
+
89
+ | Say this | What runs |
90
+ |---|---|
91
+ | "What's unread and older than a week?" | `list_emails`, sorted by date |
92
+ | "Find the Acme invoice from this month and save the PDF to my Downloads folder" | `search_emails`, `get_email`, `download_attachment` with `savePath` |
93
+ | "Reply to that thread: Thursday works, cc billing" | `reply_email` (honours Reply-To, files the reply into Sent) |
94
+ | "Is this sender legit?" | `get_email_security` (DMARC, SPF, DKIM results from the headers) |
95
+ | "Triage my inbox and skip the newsletters" | `triage_inbox` prompt, plus bulk-mail flags read from headers |
96
+ | "Move last month's receipts into Receipts" | `search_emails`, then `bulk_action` |
97
+
98
+ ---
99
+
100
+ ## Why this one
101
+
102
+ - **Bugs fixed that are still open upstream.** 18 upstream issues, including
103
+ sent mail never reaching the Sent folder, no attachments on send, raw MIME
104
+ instead of readable bodies, UID instead of date ordering, orphaned stdio
105
+ processes, and schemas that broke every call on llama.cpp models.
106
+ [Full list](#relationship-to-upstream).
107
+ - **Reading never changes your mailbox.** `get_email` fetches with IMAP
108
+ `BODY.PEEK`, so mail you read stays unread unless you ask (`markRead: true`).
109
+ - **A real read-only mode.** With `read_only = true`, write tools are not
110
+ registered at all, so the assistant cannot even see them.
111
+ - **Works on big mailboxes.** UID fetches are sent in chunks of 400, so a
112
+ mailbox with tens of thousands of messages does not overflow the server's
113
+ command limit.
114
+ - **No plaintext passwords required.** Use the macOS Keychain, Linux
115
+ `secret-tool`, a `password_command` (1Password, Bitwarden, `pass`), or OAuth2.
116
+ - **Local and inspectable.** A local process talks straight to your mail
117
+ provider. No proxy, no telemetry, no account to create.
118
+
119
+ ---
120
+
121
+ ## Safety and privacy
122
+
123
+ | Control | Default | What it does |
124
+ |---|---|---|
125
+ | Non-destructive reads | always | `get_email` uses `BODY.PEEK`; marking read is an explicit `markRead: true` |
126
+ | `read_only` | off | Hides every write tool and stops background services. `markRead` is refused |
127
+ | Send rate limit | 10 per minute per account | `settings.rate_limit` |
128
+ | Audit log | on | Writes are logged, with sensitive fields redacted, to `~/.local/share/email-mcp/audit.log` |
129
+ | Duplicate-send guard | on | A retried send is recognized and refused unless you pass `allow_duplicate` |
130
+ | HTTP transport token | required | `http` mode generates a bearer token, even on loopback |
131
+ | Verification-code tool | off | `get_verification_code` is only registered when you enable it; it never reads your clipboard |
132
+ | Body cache (`read_through`) | **off** | Message bodies are only stored on disk if you turn it on. [Details](#local-body-cache-opt-in-unreleased) |
133
+
134
+ What is stored on disk by default: your `config.toml` (written owner-only), the
135
+ audit log, and a local SQLite mirror of message **headers and flags** for INBOX
136
+ over the last 90 days (`settings.cache.enabled`, on by default; set it to
137
+ `false` to turn the mirror off). Message bodies are not stored unless you enable
138
+ `read_through`.
139
+
140
+ To report a vulnerability, follow [SECURITY.md](SECURITY.md). Please do not post
141
+ exploits in public.
142
+
143
+ ---
144
+
145
+ ## What it can do
146
+
147
+ **50 tools** (25 read, 25 write) plus **1 opt-in tool**, **7 prompts** and
148
+ **6 resources**. In read-only mode only the 25 read tools are registered.
149
+
150
+ | Group | Tools |
151
+ |---|---|
152
+ | **Read mail** | `list_accounts` `list_mailboxes` `list_emails` `search_emails` `get_email` `get_emails` `get_email_status` `get_thread` `download_attachment` `find_email_folder` `extract_contacts` `get_email_stats` `get_email_security` `check_health` `list_templates` |
153
+ | **Calendar (read)** | `extract_calendar` `analyze_email_for_scheduling` `list_calendars` `list_events` `list_reminders` `check_calendar_permissions` |
154
+ | **Watcher (read)** | `get_watcher_status` `list_presets` `get_hooks_config` `check_notification_setup` |
155
+ | **Send** *(write)* | `send_email` `reply_email` `forward_email` `save_draft` `send_draft` `apply_template` |
156
+ | **Schedule** *(write)* | `schedule_email` `list_scheduled` `cancel_scheduled` |
157
+ | **Organize** *(write)* | `move_email` `delete_email` `mark_email` `bulk_action` `create_mailbox` `rename_mailbox` `delete_mailbox` |
158
+ | **Labels** *(write)* | `list_labels` `add_label` `remove_label` `create_label` `delete_label` |
159
+ | **Calendar and alerts** *(write)* | `add_to_calendar` `create_reminder` `configure_alerts` `test_notification` |
160
+ | **Opt-in** | `get_verification_code` (needs `settings.verification.enabled = true`) |
161
+
162
+ **Prompts:** `triage_inbox` `summarize_thread` `compose_reply`
163
+ `draft_from_context` `extract_action_items` `summarize_meetings` `cleanup_inbox`
164
+
165
+ **Resources:** `email://accounts` `email://{account}/mailboxes`
166
+ `email://{account}/unread` `email://{account}/stats` `email://templates`
167
+ `email://scheduled`
168
+
169
+ Also included: multi-account support, Streamable HTTP transport, an IMAP IDLE
170
+ watcher with optional AI triage through MCP sampling (off by default), provider
171
+ auto-detection for Gmail, Outlook, Yahoo, iCloud, Fastmail, Proton Mail Bridge,
172
+ Zoho and GMX, and a terminal CLI (`list`, `read`, `search`, `send` and more).
173
+
174
+ <p align="center">
175
+ <img src="docs/assets/architecture.svg" alt="Diagram: AI clients speak MCP over stdio or HTTP to a local server, which runs IMAP, SMTP, a SQLite cache, a watcher, hooks and a scheduler" width="100%">
176
+ </p>
177
+
178
+ ---
179
+
180
+ ## Configuration
181
+
182
+ Config lives at `~/.config/email-mcp/config.toml` (`node dist/main.js config path`
183
+ prints it). The `account add` wizard writes it for you. A typical file:
184
+
185
+ ```toml
186
+ [settings]
187
+ read_only = false # true hides every write tool
188
+ rate_limit = 10 # max sends per minute per account
189
+
190
+ [[accounts]]
191
+ name = "personal"
192
+ email = "you@example.com"
193
+ full_name = "Your Name"
194
+ password = "use_keychain:personal" # stored in the OS keychain
195
+
196
+ [accounts.imap]
197
+ host = "imap.example.com"
198
+ port = 993
199
+ tls = true
200
+
201
+ [accounts.smtp]
202
+ host = "smtp.example.com"
203
+ port = 465
204
+ tls = true
205
+ ```
206
+
207
+ Check any edit with `node dist/main.js config validate`. It names the bad line,
208
+ suggests fixes for typo'd keys, and exits `1` on errors, so it also works in CI.
209
+
210
+ <details>
211
+ <summary><strong>Password options</strong></summary>
212
+
213
+ <br>
214
+
215
+ - **OS keychain:** `password = "use_keychain:<name>"`. macOS uses Keychain,
216
+ Linux uses `secret-tool` (libsecret). `node dist/main.js keychain migrate`
217
+ moves existing plaintext passwords over.
218
+ - **Password command:** `password_command = "op read 'op://Private/mail/password'"`
219
+ (or `bw get password ...`, `pass show ...`). It runs once at startup, must
220
+ print the password to stdout, and is killed after 10 seconds. It wins over
221
+ `password` if both are set.
222
+ - **OAuth2:** an `[accounts.oauth2]` block instead of a password.
223
+ - **Plaintext:** allowed, written readable only by you. `config show` masks it.
224
+
225
+ </details>
226
+
227
+ <details>
228
+ <summary><strong>Environment-variable setup (single account, no config file)</strong></summary>
229
+
230
+ <br>
231
+
232
+ Set `MCP_EMAIL_ADDRESS`, `MCP_EMAIL_PASSWORD` (or `MCP_EMAIL_PASSWORD_COMMAND`),
233
+ `MCP_EMAIL_IMAP_HOST` and `MCP_EMAIL_SMTP_HOST`. Settings have matching
234
+ variables, for example `MCP_EMAIL_READ_ONLY=true`, `MCP_EMAIL_RATE_LIMIT`,
235
+ `MCP_EMAIL_IDLE_EXIT` and `MCP_EMAIL_SEND_MAX_ATTACHMENT_MB`.
236
+
237
+ </details>
238
+
239
+ <details>
240
+ <summary><strong>Other settings worth knowing</strong></summary>
241
+
242
+ <br>
243
+
244
+ | Setting | Default | Meaning |
245
+ |---|---|---|
246
+ | `settings.idle_exit` | `0` (off) | Seconds without a request before the stdio server exits. A backstop for clients that never close the pipe |
247
+ | `settings.send.max_attachment_mb` | `25` | Cap on attachments per message. Known providers may lower it; an account-level `max_attachment_mb` overrides |
248
+ | `settings.cache.enabled` | `true` | Local header-and-flags mirror (`mailboxes = ["INBOX"]`, `window_days = 90`, `max_size_mb = 500`) |
249
+ | `settings.watcher.enabled` | `false` | IMAP IDLE watcher for new mail, with optional hooks and alerts |
250
+ | `settings.verification.enabled` | `false` | Registers `get_verification_code` |
251
+
252
+ </details>
253
+
254
+ ### Local body cache (opt-in, unreleased)
255
+
256
+ > Merged on the development branch, **off by default**, and not yet in a tagged
257
+ > release.
258
+
259
+ With `read_through = true`, `get_email` keeps a decoded copy of each message it
260
+ reads. A message's body never changes for a given mailbox generation and UID, so
261
+ a repeat read only asks the server for current flags, then answers from disk.
262
+ Flags are always live, and a message that was moved or deleted is still reported
263
+ as not found.
264
+
265
+ ```toml
266
+ [settings.cache]
267
+ read_through = true # default false
268
+ offline_reads = true # serve cached bodies, with a warning, when the server is unreachable
269
+ body_max_mb = 200 # LRU budget for cached bodies
270
+ body_messages = 500 # background backfill: newest N messages per synced mailbox (0 = off)
271
+ ```
272
+
273
+ Measured with [`scripts/bench-get-email.ts`](scripts/bench-get-email.ts) on one
274
+ real account (30 INBOX messages, 60 samples): a cached read took **174 ms** at
275
+ p50 versus **714 ms** for a live read. Your numbers will depend on your
276
+ provider and network.
277
+
278
+ Bodies over 256 KB are never cached. The cache file is
279
+ `~/.cache/email-mcp/cache.db` (mode `0600`). Delete it while the server is
280
+ stopped to clear it. See [SECURITY.md](SECURITY.md) before turning this on, and
281
+ pair it with full-disk encryption.
282
+
283
+ ---
284
+
285
+ ## More clients
286
+
287
+ <details>
288
+ <summary><strong>Cursor</strong> (<code>~/.cursor/mcp.json</code>)</summary>
289
+
290
+ ```json
291
+ {
292
+ "mcpServers": {
293
+ "email": {
294
+ "command": "node",
295
+ "args": ["/absolute/path/to/imap-wizard/dist/main.js", "stdio"]
296
+ }
297
+ }
298
+ }
299
+ ```
300
+ </details>
301
+
302
+ <details>
303
+ <summary><strong>VS Code (GitHub Copilot)</strong></summary>
304
+
305
+ ```json
306
+ {
307
+ "mcp": {
308
+ "servers": {
309
+ "email": {
310
+ "type": "stdio",
311
+ "command": "node",
312
+ "args": ["/absolute/path/to/imap-wizard/dist/main.js", "stdio"]
313
+ }
314
+ }
315
+ }
316
+ }
317
+ ```
318
+ </details>
319
+
320
+ <details>
321
+ <summary><strong>Codex</strong> (<code>~/.codex/config.toml</code>)</summary>
322
+
323
+ ```toml
324
+ [mcp_servers.email]
325
+ command = "node"
326
+ args = ["/absolute/path/to/imap-wizard/dist/main.js", "stdio"]
327
+ ```
328
+ </details>
329
+
330
+ <details>
331
+ <summary><strong>OpenCode</strong> (<code>~/.config/opencode/opencode.json</code>)</summary>
332
+
333
+ Raise the timeout: a full-text search over a very large mailbox can take longer
334
+ than the 60-second default.
335
+
336
+ ```json
337
+ {
338
+ "mcp": {
339
+ "email": {
340
+ "type": "local",
341
+ "command": ["node", "/absolute/path/to/imap-wizard/dist/main.js", "stdio"],
342
+ "enabled": true,
343
+ "timeout": 180000
344
+ }
345
+ }
346
+ }
347
+ ```
348
+ </details>
349
+
350
+ <details>
351
+ <summary><strong>Streamable HTTP</strong></summary>
352
+
353
+ ```bash
354
+ node dist/main.js http --port 8080
355
+ ```
356
+
357
+ On first run it generates a bearer token, prints it once, and saves it to
358
+ `~/.config/email-mcp/http-token`. Send it with every request:
359
+
360
+ ```json
361
+ {
362
+ "mcpServers": {
363
+ "email": {
364
+ "type": "streamable-http",
365
+ "url": "http://127.0.0.1:8080/mcp",
366
+ "headers": { "Authorization": "Bearer <your token>" }
367
+ }
368
+ }
369
+ }
370
+ ```
371
+
372
+ It refuses to bind a non-loopback address without a token.
373
+ </details>
374
+
375
+ ---
376
+
377
+ ## Troubleshooting
378
+
379
+ | Symptom | Likely cause | Fix |
380
+ |---|---|---|
381
+ | `MCP error -32001: Request timed out` | Your client stops waiting after 60 s; a full-text search on a huge mailbox can take longer | Raise the client timeout (`180000` in OpenCode) |
382
+ | Setup says the config file is invalid | A TOML syntax or key error | `node dist/main.js config validate` names the line and key |
383
+ | Login fails | Wrong password, or the provider needs an app password | The error now shows the server's own reason; run `node dist/main.js test` |
384
+ | Search returns nothing on a server you know has mail | Some servers return malformed SEARCH replies | This build fails loudly instead of reporting zero results; check the error |
385
+ | A server process keeps running after you quit | Your client never closes the pipe | Set `settings.idle_exit = 1800`, or close the client cleanly |
386
+ | `Cannot find module .../nodemailer/...` after an update | The old server process is still running | Restart your client (in Claude Code: `/mcp`, then reconnect) |
387
+
388
+ ---
389
+
390
+ ## Relationship to upstream
391
+
392
+ This project began as a fork of
393
+ [codefuturist/email-mcp](https://github.com/codefuturist/email-mcp) at commit
394
+ `7fe8916` (2026-08-21) and started its own version line at
395
+ [v0.1.0](https://github.com/Fe2-O3/imap-wizard/releases/tag/v0.1.0)
396
+ (2026-09-28). Upstream continues to ship its own releases; this fork adopts
397
+ upstream changes one at a time, with credit, rather than merging wholesale.
398
+ The review of upstream's v0.4 and v0.5 features is in
399
+ [docs/upstream-v0.5-draft.md](docs/upstream-v0.5-draft.md), and every change is
400
+ in the [CHANGELOG](CHANGELOG.md).
401
+
402
+ <details>
403
+ <summary><strong>Upstream issues fixed here</strong> (all still open upstream as of 2026-11-17)</summary>
404
+
405
+ <br>
406
+
407
+ | Issue | Problem | Fix in this fork |
408
+ |---|---|---|
409
+ | [#12](https://github.com/codefuturist/email-mcp/issues/12) | Attachments only returned as base64 | `savePath` writes to disk and returns path, size and SHA-256 |
410
+ | [#20](https://github.com/codefuturist/email-mcp/issues/20) [#54](https://github.com/codefuturist/email-mcp/issues/54) [#92](https://github.com/codefuturist/email-mcp/issues/92) | Sent mail never saved to Sent | IMAP APPEND into Sent after every send |
411
+ | [#45](https://github.com/codefuturist/email-mcp/issues/45) | `forward_email` ignores `html` | Honoured |
412
+ | [#52](https://github.com/codefuturist/email-mcp/issues/52) | No attachments on send | Attachments on send, forward and draft |
413
+ | [#55](https://github.com/codefuturist/email-mcp/issues/55) | Memory leak in long-running process | Connections rotate every 30 minutes; caches evicted |
414
+ | [#57](https://github.com/codefuturist/email-mcp/issues/57) | Socket timeout crashes the process | Error and close handlers on every IMAP client |
415
+ | [#58](https://github.com/codefuturist/email-mcp/issues/58) | Every call fails on llama.cpp models | Grammar-safe (GBNF) schemas |
416
+ | [#59](https://github.com/codefuturist/email-mcp/issues/59) | Results ordered by UID | Ordered by date across the whole match set |
417
+ | [#60](https://github.com/codefuturist/email-mcp/issues/60) | stdio server never exits | Exits when the client closes stdin; optional idle exit |
418
+ | [#62](https://github.com/codefuturist/email-mcp/issues/62) | Retries send duplicates | Retried sends recognized and refused |
419
+ | [#66](https://github.com/codefuturist/email-mcp/issues/66) [#95](https://github.com/codefuturist/email-mcp/issues/95) | Raw MIME instead of the body | Decoded bodies; richer multipart part preferred |
420
+ | [#71](https://github.com/codefuturist/email-mcp/issues/71) [#91](https://github.com/codefuturist/email-mcp/issues/91) | Silent zero results on broken servers | Fails loudly |
421
+ | [#79](https://github.com/codefuturist/email-mcp/issues/79) | `read_only` does not gate background work | Calendar writes and background services gated |
422
+ | [#96](https://github.com/codefuturist/email-mcp/issues/96) | Non-ASCII draft subjects not encoded | Drafts built with MailComposer (RFC 2047) |
423
+
424
+ Plus fixes with no upstream issue: chunked UID fetches for large mailboxes,
425
+ visible login-failure reasons, STARTTLS reaching the IMAP client, OAuth2 in the
426
+ watcher, Bcc on `send_draft`, Reply-To on `reply_email`, and more. Security
427
+ hardening covers SMTP header injection, constant-time token checks, webhook SSRF
428
+ blocking, HTTPS-only OAuth endpoints, owner-only config files, and bounded HTTP
429
+ request bodies. See the [CHANGELOG](CHANGELOG.md).
430
+
431
+ </details>
432
+
433
+ ---
434
+
435
+ ## Development
436
+
437
+ ```bash
438
+ pnpm install
439
+ pnpm check # Biome lint and format
440
+ pnpm typecheck
441
+ pnpm test # unit tests (588 across 68 files)
442
+ pnpm test:integration # against a throwaway GreenMail server (needs Docker)
443
+ pnpm smoke # every tool against a real configured account
444
+ ```
445
+
446
+ `package.json` requires Node 24+. Contributions: see
447
+ [CONTRIBUTING.md](CONTRIBUTING.md) and the
448
+ [Code of Conduct](CODE_OF_CONDUCT.md).
449
+
450
+ <details>
451
+ <summary><strong>CLI reference</strong></summary>
452
+
453
+ ```text
454
+ imap-wizard [command]
455
+
456
+ stdio Run as MCP server over stdio (default)
457
+ http Run as MCP server over Streamable HTTP
458
+ account list|add|edit|delete
459
+ setup Alias for 'account add'
460
+ test [account] Test IMAP and SMTP connections
461
+ install [status|remove] Register with MCP clients
462
+ config show|edit|validate|path|init
463
+ keychain status|migrate|remove
464
+ scheduler check|list|install|uninstall|status
465
+ list | read <id> | search <query> | mailboxes
466
+ flag <id> | delete <id> | attach <id> <file> | reply <id> | send
467
+ notify Test and diagnose desktop notifications
468
+ help
469
+ ```
470
+
471
+ Email commands take `--account NAME` (default: the first account). Read commands
472
+ support `--json`. `delete` asks for confirmation unless you pass `--yes`.
473
+
474
+ </details>
475
+
476
+ ---
477
+
478
+ ## Credits
479
+
480
+ Built on [email-mcp](https://github.com/codefuturist/email-mcp) by
481
+ [@codefuturist](https://github.com/codefuturist). This fork also incorporates
482
+ work from upstream contributors:
483
+
484
+ | Contributor | Incorporated |
485
+ |---|---|
486
+ | [@rsilvestre](https://github.com/rsilvestre) | [`password_command`](https://github.com/codefuturist/email-mcp/pull/82), [stats resource fix](https://github.com/codefuturist/email-mcp/pull/93), [`find_email_folder` speed-up](https://github.com/codefuturist/email-mcp/pull/94) |
487
+ | [@b0j-an](https://github.com/b0j-an) | [Attachments on send](https://github.com/codefuturist/email-mcp/pull/77), [Sent folder copy](https://github.com/codefuturist/email-mcp/pull/78) |
488
+ | [@majkelooo](https://github.com/majkelooo) | [stdio exit fix](https://github.com/codefuturist/email-mcp/pull/61), [Sent folder filing](https://github.com/codefuturist/email-mcp/pull/80) |
489
+ | [@Seger85](https://github.com/Seger85) | [Sender authentication signals](https://github.com/codefuturist/email-mcp/pull/70), [IMAP error handling](https://github.com/codefuturist/email-mcp/pull/64), [HTTP session lifecycle](https://github.com/codefuturist/email-mcp/pull/63) |
490
+ | [@ElectricCookie](https://github.com/ElectricCookie) | [Attachment download directory](https://github.com/codefuturist/email-mcp/pull/65) |
491
+ | [@Fe2-O3](https://github.com/Fe2-O3) | [GBNF-safe schemas](https://github.com/codefuturist/email-mcp/pull/74) |
492
+
493
+ Ported from upstream: the [TLS servername repair](https://github.com/codefuturist/email-mcp/commit/70d4215de07920252f672923cf3cd48aad7a0189)
494
+ and [`config validate`](https://github.com/codefuturist/email-mcp/commit/bf09dcc1f087279812fe307647bf8e52198becd8).
495
+ Thanks also to everyone who filed the upstream issues listed above.
496
+
497
+ ## License
498
+
499
+ [LGPL-3.0-or-later](LICENSE), the same license as upstream.