@visulima/email 1.0.0-alpha.33 → 1.0.0-alpha.35

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 (229) hide show
  1. package/CHANGELOG.md +131 -0
  2. package/README.md +117 -0
  3. package/dist/crypto/index.d.ts +160 -3
  4. package/dist/crypto/index.js +1 -1
  5. package/dist/deliverability/dmarc-report.d.ts +95 -0
  6. package/dist/deliverability/dmarc-report.js +1 -0
  7. package/dist/deliverability/index.d.ts +360 -0
  8. package/dist/deliverability/index.js +1 -0
  9. package/dist/events/index.d.ts +31 -0
  10. package/dist/events/index.js +1 -0
  11. package/dist/inbound/index.d.ts +375 -0
  12. package/dist/inbound/index.js +1 -0
  13. package/dist/index.d.ts +12 -704
  14. package/dist/index.js +1 -1
  15. package/dist/middleware/index.d.ts +346 -0
  16. package/dist/middleware/index.js +1 -0
  17. package/dist/packem_shared/ALL_EVENTS-A0nTVOo0.js +1 -0
  18. package/dist/packem_shared/DkimSigner-dKZ45Csc.js +18 -0
  19. package/dist/packem_shared/Mail-B2QII2P9.js +1 -0
  20. package/dist/packem_shared/{MailMessage-Dy1gP5e-.js → MailMessage-DB1zaWfM.js} +1 -1
  21. package/dist/packem_shared/MemoryEventStore-BEKPxa-I.js +1 -0
  22. package/dist/packem_shared/MemoryQueue-C-CtRRG7.js +1 -0
  23. package/dist/packem_shared/MemorySuppressionStore-BKY1FrA1.js +1 -0
  24. package/dist/packem_shared/RATE_LIMIT_PRESETS-DQF78mdO.js +1 -0
  25. package/dist/packem_shared/{SmimeEncrypter-DInfo-l0.js → SmimeEncrypter-BirIsrip.js} +2 -2
  26. package/dist/packem_shared/{SmimeSigner-CSWbZ41O.js → SmimeSigner-CkyaShTs.js} +2 -2
  27. package/dist/packem_shared/addDarkModeSupport-Ys9U2-GH.js +1 -0
  28. package/dist/packem_shared/address-formatter-CnPg51_n.js +1 -0
  29. package/dist/packem_shared/aggregate-features-BvgdYul-.js +1 -0
  30. package/dist/packem_shared/ahaSendProvider-yuqYMW0n.js +1 -0
  31. package/dist/packem_shared/arcMessageSignatureBase-Cpdnv-H8.js +17 -0
  32. package/dist/packem_shared/attachment-processor-CFUC3V45.js +1 -0
  33. package/dist/packem_shared/azureProvider-CK_Wuw4r.js +1 -0
  34. package/dist/packem_shared/brevoProvider-CNwuzzBA.js +1 -0
  35. package/dist/packem_shared/build-mime-message-D8WEZejb.js +3 -0
  36. package/dist/packem_shared/buildListUnsubscribe-CIbz0rtk.js +1 -0
  37. package/dist/packem_shared/circuitBreakerMiddleware-B7DlzZSG.js +1 -0
  38. package/dist/packem_shared/cloudflareEmailProvider-C-G821Hg.js +1 -0
  39. package/dist/packem_shared/composeMiddleware-CkEhbDjL.js +1 -0
  40. package/dist/packem_shared/createTestEmail-hHdtgmUM.js +1 -0
  41. package/dist/packem_shared/createWorker-Nkc1GHet.js +1 -0
  42. package/dist/packem_shared/dedupeMiddleware-JeJbff46.js +1 -0
  43. package/dist/packem_shared/{detectMimeType-BtkVEtZF.js → detectMimeType-B4QMh7k8.js} +1 -1
  44. package/dist/packem_shared/emailMatchers-CLANeU71.js +1 -0
  45. package/dist/packem_shared/event-bus.d-DEl3w_EW.d.ts +104 -0
  46. package/dist/packem_shared/extractReply-CCWnNRWe.js +5 -0
  47. package/dist/packem_shared/failoverProvider-D90MHT2T.js +1 -0
  48. package/dist/packem_shared/filterSuppressed-DntqRV0q.js +1 -0
  49. package/dist/packem_shared/format-address-Cv6uWTS5.js +1 -0
  50. package/dist/packem_shared/infobipProvider-DdV62IAG.js +1 -0
  51. package/dist/packem_shared/injectPreheader-BxPjb0eJ.js +1 -0
  52. package/dist/packem_shared/inlineCss-BLaEi337.js +1 -0
  53. package/dist/packem_shared/isValidSigningCertUrl-CF_KuCAi.js +3 -0
  54. package/dist/packem_shared/loggingMiddleware-CyHzn37U.js +1 -0
  55. package/dist/packem_shared/loopsProvider-DSedSU3q.js +1 -0
  56. package/dist/packem_shared/mail.d-LmrdSngG.d.ts +861 -0
  57. package/dist/packem_shared/{mailCrabProvider-B7H6HwWu.js → mailCrabProvider-xSLhA1CY.js} +1 -1
  58. package/dist/packem_shared/mailPaceProvider-CWBIjvvJ.js +1 -0
  59. package/dist/packem_shared/mailchannelsProvider-zKcunGDQ.js +1 -0
  60. package/dist/packem_shared/mailerSendProvider-BEvPlBKB.js +1 -0
  61. package/dist/packem_shared/mailgunProvider-CfQAINTC.js +1 -0
  62. package/dist/packem_shared/mailjetProvider-DEfKptWc.js +1 -0
  63. package/dist/packem_shared/mailomatProvider-D5sHlxZh.js +1 -0
  64. package/dist/packem_shared/mailtrapProvider-DwgMKakk.js +1 -0
  65. package/dist/packem_shared/mandrillProvider-CdGjO3Td.js +1 -0
  66. package/dist/packem_shared/normalizeMessageId-B_9mXlh4.js +1 -0
  67. package/dist/packem_shared/oauth2Middleware-B1xz58iP.js +1 -0
  68. package/dist/packem_shared/parseAddress-CrYOac3K.js +1 -0
  69. package/dist/packem_shared/parseArfReport-CUHb8WVj.js +6 -0
  70. package/dist/packem_shared/parseCloudflareInbound-BGgH5u7M.js +1 -0
  71. package/dist/packem_shared/parseDmarcRecord-DjNqCMZc.js +1 -0
  72. package/dist/packem_shared/parseInbound-BP-gEjhh.js +1 -0
  73. package/dist/packem_shared/parseMailgunInbound-C3sZ1TiH.js +1 -0
  74. package/dist/packem_shared/parseMtaStsPolicy-rFOOVXXK.js +6 -0
  75. package/dist/packem_shared/parsePostmarkInbound-C0Ttfroo.js +1 -0
  76. package/dist/packem_shared/parseSendGridInbound-BkvaoYRl.js +4 -0
  77. package/dist/packem_shared/parseSesInbound-BFS--T8X.js +1 -0
  78. package/dist/packem_shared/parseTlsRptRecord-DnLwAWsk.js +1 -0
  79. package/dist/packem_shared/plunkProvider-BIhMU2b5.js +1 -0
  80. package/dist/packem_shared/postProcessHtml-C73e0b9H.js +1 -0
  81. package/dist/packem_shared/postalProvider-CmmbCZSi.js +1 -0
  82. package/dist/packem_shared/postmarkProvider-i9u0h26U.js +1 -0
  83. package/dist/packem_shared/provider-base-BpHE_uK8.js +1 -0
  84. package/dist/packem_shared/{provider.d-DcfYeGJJ.d.ts → provider.d-J-y6iogK.d.ts} +1 -1
  85. package/dist/packem_shared/readFile-BkNfutxp-BS8Q2183.js +1 -0
  86. package/dist/packem_shared/resendProvider-BNduBn0w.js +1 -0
  87. package/dist/packem_shared/retry-UPd8F62N.js +1 -0
  88. package/dist/packem_shared/retryMiddleware-DHespsU2.js +1 -0
  89. package/dist/packem_shared/rewriteCidLinks-B-Sd5XHs.js +1 -0
  90. package/dist/packem_shared/roundRobinProvider-B_60F0BC.js +1 -0
  91. package/dist/packem_shared/scalewayProvider-8gb4sIOB.js +1 -0
  92. package/dist/packem_shared/sendGridProvider-CayLXvPO.js +1 -0
  93. package/dist/packem_shared/smtpProvider-DoXVsN4p.js +24 -0
  94. package/dist/packem_shared/sweegoProvider-C0g9Ajdn.js +1 -0
  95. package/dist/packem_shared/toEmailSnapshot-CYpMmnAA.js +1 -0
  96. package/dist/packem_shared/tracer.d-MU42G1jG.d.ts +494 -0
  97. package/dist/packem_shared/{types.d-CNnnk-Ya.d.ts → types.d-BId55FW2.d.ts} +6 -1
  98. package/dist/packem_shared/types.d-BMpI2UXj.d.ts +51 -0
  99. package/dist/packem_shared/types.d-CmoWvdZi.d.ts +61 -0
  100. package/dist/packem_shared/types.d-Mpu0HZoG.d.ts +24 -0
  101. package/dist/packem_shared/{types.d-wwpgA3to.d.ts → types.d-ejzh-xBP.d.ts} +6 -1
  102. package/dist/packem_shared/types.d-lcJZmwRK.d.ts +69 -0
  103. package/dist/packem_shared/utils-BwolsGlK.js +1 -0
  104. package/dist/packem_shared/verifyMailgunWebhook-Df7n2Quh.js +1 -0
  105. package/dist/packem_shared/verifyPostmarkWebhook-D_eXt_Lq.js +1 -0
  106. package/dist/packem_shared/verifySendGridWebhook-XOSj5yTe.js +1 -0
  107. package/dist/packem_shared/verifyStandardWebhook-DdUTlIVh.js +1 -0
  108. package/dist/packem_shared/withEvents-Q9bwpCFG.js +1 -0
  109. package/dist/packem_shared/withMetrics-BPs3Kdxn.js +1 -0
  110. package/dist/packem_shared/withRender-DQM2zbbI.js +1 -0
  111. package/dist/packem_shared/withSuppression-DfjV_tbI.js +1 -0
  112. package/dist/packem_shared/withTelemetry-CsQsv1DV.js +1 -0
  113. package/dist/packem_shared/zeptomailProvider-BIbHieGJ.js +1 -0
  114. package/dist/providers/ahasend/index.d.ts +3 -3
  115. package/dist/providers/ahasend/index.js +1 -1
  116. package/dist/providers/aws-ses/index.d.ts +3 -3
  117. package/dist/providers/azure/index.d.ts +3 -3
  118. package/dist/providers/azure/index.js +1 -1
  119. package/dist/providers/brevo/index.d.ts +3 -3
  120. package/dist/providers/brevo/index.js +1 -1
  121. package/dist/providers/cloudflare-email/index.d.ts +36 -0
  122. package/dist/providers/cloudflare-email/index.js +1 -0
  123. package/dist/providers/failover/index.d.ts +3 -3
  124. package/dist/providers/failover/index.js +1 -1
  125. package/dist/providers/http/index.d.ts +3 -3
  126. package/dist/providers/infobip/index.d.ts +3 -3
  127. package/dist/providers/infobip/index.js +1 -1
  128. package/dist/providers/loops/index.d.ts +47 -0
  129. package/dist/providers/loops/index.js +1 -0
  130. package/dist/providers/mailchannels/index.d.ts +26 -0
  131. package/dist/providers/mailchannels/index.js +1 -0
  132. package/dist/providers/mailcrab/index.d.ts +3 -3
  133. package/dist/providers/mailcrab/index.js +1 -1
  134. package/dist/providers/mailersend/index.d.ts +3 -3
  135. package/dist/providers/mailersend/index.js +1 -1
  136. package/dist/providers/mailgun/index.d.ts +3 -3
  137. package/dist/providers/mailgun/index.js +1 -1
  138. package/dist/providers/mailjet/index.d.ts +3 -3
  139. package/dist/providers/mailjet/index.js +1 -1
  140. package/dist/providers/mailomat/index.d.ts +3 -3
  141. package/dist/providers/mailomat/index.js +1 -1
  142. package/dist/providers/mailpace/index.d.ts +3 -3
  143. package/dist/providers/mailpace/index.js +1 -1
  144. package/dist/providers/mailtrap/index.d.ts +3 -3
  145. package/dist/providers/mailtrap/index.js +1 -1
  146. package/dist/providers/mandrill/index.d.ts +3 -3
  147. package/dist/providers/mandrill/index.js +1 -1
  148. package/dist/providers/mock/index.d.ts +6 -53
  149. package/dist/providers/nodemailer/index.d.ts +3 -3
  150. package/dist/providers/opentelemetry/index.d.ts +3 -495
  151. package/dist/providers/plunk/index.d.ts +3 -3
  152. package/dist/providers/plunk/index.js +1 -1
  153. package/dist/providers/postal/index.d.ts +3 -3
  154. package/dist/providers/postal/index.js +1 -1
  155. package/dist/providers/postmark/index.d.ts +3 -3
  156. package/dist/providers/postmark/index.js +1 -1
  157. package/dist/providers/resend/index.d.ts +3 -3
  158. package/dist/providers/resend/index.js +1 -1
  159. package/dist/providers/roundrobin/index.d.ts +3 -3
  160. package/dist/providers/roundrobin/index.js +1 -1
  161. package/dist/providers/scaleway/index.d.ts +3 -3
  162. package/dist/providers/scaleway/index.js +1 -1
  163. package/dist/providers/sendgrid/index.d.ts +3 -3
  164. package/dist/providers/sendgrid/index.js +1 -1
  165. package/dist/providers/smtp/index.d.ts +3 -3
  166. package/dist/providers/smtp/index.js +1 -1
  167. package/dist/providers/sweego/index.d.ts +3 -3
  168. package/dist/providers/sweego/index.js +1 -1
  169. package/dist/providers/zeptomail/index.d.ts +3 -3
  170. package/dist/providers/zeptomail/index.js +1 -1
  171. package/dist/queue/bullmq-queue.d.ts +46 -0
  172. package/dist/queue/bullmq-queue.js +1 -0
  173. package/dist/queue/index.d.ts +148 -0
  174. package/dist/queue/index.js +1 -0
  175. package/dist/queue/pg-boss-queue.d.ts +41 -0
  176. package/dist/queue/pg-boss-queue.js +1 -0
  177. package/dist/queue/sqs-queue.d.ts +72 -0
  178. package/dist/queue/sqs-queue.js +1 -0
  179. package/dist/queue/unstorage-queue.d.ts +81 -0
  180. package/dist/queue/unstorage-queue.js +1 -0
  181. package/dist/render/index.d.ts +107 -0
  182. package/dist/render/index.js +1 -0
  183. package/dist/template-engines/i18n.d.ts +61 -0
  184. package/dist/template-engines/i18n.js +1 -0
  185. package/dist/template-engines/jsx-email.d.ts +11 -0
  186. package/dist/template-engines/jsx-email.js +1 -0
  187. package/dist/template-engines/liquid.d.ts +12 -0
  188. package/dist/template-engines/liquid.js +1 -0
  189. package/dist/test/index.d.ts +159 -0
  190. package/dist/test/index.js +1 -0
  191. package/dist/utils/format-email-address.d.ts +1 -1
  192. package/dist/utils/format-email-address.js +1 -1
  193. package/dist/utils/parse-address.d.ts +1 -1
  194. package/dist/utils/result.d.ts +49 -0
  195. package/dist/utils/result.js +1 -0
  196. package/dist/utils/validation/check-feature-support.d.ts +53 -0
  197. package/dist/utils/validation/check-feature-support.js +1 -0
  198. package/dist/webhooks/index.d.ts +231 -0
  199. package/dist/webhooks/index.js +1 -0
  200. package/package.json +119 -3
  201. package/dist/packem_shared/DkimSigner-CX2yGILn.js +0 -18
  202. package/dist/packem_shared/Mail-KMrKXmyB.js +0 -1
  203. package/dist/packem_shared/address-formatter-Cm_E_ZMa.js +0 -1
  204. package/dist/packem_shared/ahaSendProvider-DOAAW65O.js +0 -1
  205. package/dist/packem_shared/attachment-processor-DsmIomKc.js +0 -1
  206. package/dist/packem_shared/azureProvider-EkNYKAiF.js +0 -1
  207. package/dist/packem_shared/brevoProvider-CkR4U4RD.js +0 -1
  208. package/dist/packem_shared/build-mime-message-6xstxaUV.js +0 -2
  209. package/dist/packem_shared/failoverProvider-W5ctAhdC.js +0 -1
  210. package/dist/packem_shared/infobipProvider-BhTsWi7e.js +0 -1
  211. package/dist/packem_shared/mailPaceProvider-DRt6Z9Hr.js +0 -1
  212. package/dist/packem_shared/mailerSendProvider-Dx_iHInH.js +0 -1
  213. package/dist/packem_shared/mailgunProvider-ChkLGZZW.js +0 -1
  214. package/dist/packem_shared/mailjetProvider-BMRhNe6H.js +0 -1
  215. package/dist/packem_shared/mailomatProvider-CydV-JB6.js +0 -1
  216. package/dist/packem_shared/mailtrapProvider-CuAfJWDr.js +0 -1
  217. package/dist/packem_shared/mandrillProvider-BBeLbaw0.js +0 -1
  218. package/dist/packem_shared/plunkProvider-BQyjG6YT.js +0 -1
  219. package/dist/packem_shared/postalProvider-DPHQ620q.js +0 -1
  220. package/dist/packem_shared/postmarkProvider-bMTC2gdJ.js +0 -1
  221. package/dist/packem_shared/provider-base-Cmzx6BTO.js +0 -1
  222. package/dist/packem_shared/readFile-BAVMZg5e-CTXYIyEU.js +0 -1
  223. package/dist/packem_shared/resendProvider-Cns1tvF5.js +0 -1
  224. package/dist/packem_shared/roundRobinProvider-FvZQKl6n.js +0 -1
  225. package/dist/packem_shared/scalewayProvider-O1dHz7iJ.js +0 -1
  226. package/dist/packem_shared/sendGridProvider-DmywC-eT.js +0 -1
  227. package/dist/packem_shared/smtpProvider-Unjao_fn.js +0 -23
  228. package/dist/packem_shared/sweegoProvider-D086G6xG.js +0 -1
  229. package/dist/packem_shared/zeptomailProvider-DKKEpEsW.js +0 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,134 @@
1
+ ## @visulima/email [1.0.0-alpha.35](https://github.com/visulima/visulima/compare/@visulima/email@1.0.0-alpha.34...@visulima/email@1.0.0-alpha.35) (2026-06-04)
2
+
3
+ ### Features
4
+
5
+ * **email:** inbound, webhooks, deliverability, middleware, queue, events, testing + ARC/i18n/batch ([#671](https://github.com/visulima/visulima/issues/671)) ([2ca23f2](https://github.com/visulima/visulima/commit/2ca23f27ecc5064d693c16bd3f44ccaeaf050888))
6
+
7
+ ### Bug Fixes
8
+
9
+ * **email:** 5 bug fixes ([4e87c42](https://github.com/visulima/visulima/commit/4e87c429a56d68d7a0a09325484ed299ffe6493c))
10
+ * **lint:** clear pre-existing eslint rot across packages ([#674](https://github.com/visulima/visulima/issues/674)) ([5354253](https://github.com/visulima/visulima/commit/5354253b163bd50bcefaf8a3fddf831bdb5df32b))
11
+
12
+
13
+ ### Dependencies
14
+
15
+ * **@visulima/disposable-email-domains:** upgraded to 1.0.0-alpha.16
16
+ * **@visulima/error:** upgraded to 6.0.0-alpha.32
17
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.30
18
+ * **@visulima/path:** upgraded to 3.0.0-alpha.12
19
+
20
+ ## @visulima/email [1.0.0-alpha.34](https://github.com/visulima/visulima/compare/@visulima/email@1.0.0-alpha.33...@visulima/email@1.0.0-alpha.34) (2026-06-02)
21
+
22
+ ### Features
23
+
24
+ * **email:** add fail-fast capability guard ([#657](https://github.com/visulima/visulima/issues/657)) ([81f24ab](https://github.com/visulima/visulima/commit/81f24abcde5cb8b6bbbd989a5ad397eefb3292ab))
25
+
26
+ ### Bug Fixes
27
+
28
+ * **tests:** revert unsafe vitest autofixes from the lint sweep ([378f27c](https://github.com/visulima/visulima/commit/378f27caa370f1d3188aef2ed36d46839abc88c4))
29
+
30
+ ### Miscellaneous Chores
31
+
32
+ * apply eslint + prettier autofixes across packages ([c1bb784](https://github.com/visulima/visulima/commit/c1bb7848a0d93d0dfe2960c77e3cda22239c79a0))
33
+
34
+ ### Tests
35
+
36
+ * **email:** cover address normalization branches ([128f9d4](https://github.com/visulima/visulima/commit/128f9d485b0007636cf369f0c9a435c50d445794))
37
+ * **email:** cover ahasend request, attachment and availability branches ([747ba3c](https://github.com/visulima/visulima/commit/747ba3cef6b84cd79d82b8441cb250032e9247eb))
38
+ * **email:** cover ahasend send and messageId branches ([b9c5085](https://github.com/visulima/visulima/commit/b9c5085546f2abad3515d9d899a7f40f2b12cb58))
39
+ * **email:** cover angle-bracket first-bracket fallback ([3f6f8b9](https://github.com/visulima/visulima/commit/3f6f8b9c6d44d370140d59146d8446be3a5b035a))
40
+ * **email:** cover attach/embed empty basename fallback ([b5be774](https://github.com/visulima/visulima/commit/b5be7745cfeed21ec92911f1673c712744f2f311))
41
+ * **email:** cover attachment content-type fallbacks ([94bf172](https://github.com/visulima/visulima/commit/94bf172278f65af5c3e4260ae2aeaf7ed35ca67a))
42
+ * **email:** cover attachment default content type ([ac83c50](https://github.com/visulima/visulima/commit/ac83c501a40a874e721d9a58e5e5b0fd6125795e))
43
+ * **email:** cover aws-ses branch paths ([c299c28](https://github.com/visulima/visulima/commit/c299c2873fcc309ce2c6695fb148dfab36bf795d))
44
+ * **email:** cover aws-ses initialize, isAvailable, request errors and SES params ([b0c90c7](https://github.com/visulima/visulima/commit/b0c90c7245d3a68d891e1673e7acf8d6a9f129d7))
45
+ * **email:** cover azure availability non-error branch ([1fea2cb](https://github.com/visulima/visulima/commit/1fea2cb1bd6908ef87b2de109b7e7159015f30ad))
46
+ * **email:** cover azure connection-string auth and send/getEmail branches ([462d4f9](https://github.com/visulima/visulima/commit/462d4f95bb8d59fd459b1cd812640028abf60237))
47
+ * **email:** cover azure getEmail auth, isAvailable status codes and send failure ([d03fe62](https://github.com/visulima/visulima/commit/d03fe62ceffce0598af844453e40daa64817bb0a))
48
+ * **email:** cover brevo getEmail, replyTo array branches, batch and attachments ([e967213](https://github.com/visulima/visulima/commit/e967213b93e24075d62bd6e12e43015fed045dda))
49
+ * **email:** cover brevo send and getEmail branches ([78389b9](https://github.com/visulima/visulima/commit/78389b90d0bf19e89e6e58ecdb07887a1e8618c4))
50
+ * **email:** cover build-mime-message attachment headers and encodings ([1095d47](https://github.com/visulima/visulima/commit/1095d471f8ed38755b3a847f3b39fdb3e7621722))
51
+ * **email:** cover dkim empty-body canonicalization ([b5a7f4c](https://github.com/visulima/visulima/commit/b5a7f4c24ca211d0ae76d8df9a9f667e890cfcc0))
52
+ * **email:** cover dkim-signer canonicalization branches ([d6c0bec](https://github.com/visulima/visulima/commit/d6c0bece326173678650f5a4f30078e35e17cffb))
53
+ * **email:** cover failover init failures and fallbacks ([2cbead7](https://github.com/visulima/visulima/commit/2cbead75a564c25d3f921e80f49b099595927628))
54
+ * **email:** cover failover unnamed-provider init failure ([38e0060](https://github.com/visulima/visulima/commit/38e0060f3cdfc963b6a85d725b7519b0fa188fb6))
55
+ * **email:** cover handlebars register error rethrow ([b740f8f](https://github.com/visulima/visulima/commit/b740f8f2ed121a953cb5e02f81eebef4f172b598))
56
+ * **email:** cover http initialize, availability, and cc/bcc branches ([b2f6509](https://github.com/visulima/visulima/commit/b2f6509c67fd3ba5e4b4e20be8c48965fa0e1928))
57
+ * **email:** cover http send, init, and message-id branches ([62719bd](https://github.com/visulima/visulima/commit/62719bd9e9e9dece8de1e26b44854c73923b4cf8))
58
+ * **email:** cover in-memory cache delete, clear and eviction ([e4b0333](https://github.com/visulima/visulima/commit/e4b03330889d2f5e822fa61b201411991c19d498))
59
+ * **email:** cover infobip request, attachment and availability branches ([2dac360](https://github.com/visulima/visulima/commit/2dac3608200f75f7f795accadf226f242937831b))
60
+ * **email:** cover infobip send and getEmail branches ([4d8719d](https://github.com/visulima/visulima/commit/4d8719db845882f0c52d580b47f040e5533fbae8))
61
+ * **email:** cover Mail logger, sendMany, and global-config merge paths ([bd5c50b](https://github.com/visulima/visulima/commit/bd5c50be8b6aa110086f0c9975440decf1189ab6))
62
+ * **email:** cover mail message replyTo setter ([afe8dae](https://github.com/visulima/visulima/commit/afe8daed7363d7fdd7354b8e3190602fdc635347))
63
+ * **email:** cover mail send and batch branch paths ([b45b1b0](https://github.com/visulima/visulima/commit/b45b1b0e0066a276bee5a6bfddde13a63f7f415b))
64
+ * **email:** cover mail-message auto-text generation ([2c44d7f](https://github.com/visulima/visulima/commit/2c44d7fa6636ca4c88e38504aa988855f6387436))
65
+ * **email:** cover mail-message logger branches ([23b4496](https://github.com/visulima/visulima/commit/23b44963ed8edf4e794544bdcde94f2d3798994a))
66
+ * **email:** cover mailersend request, attachment and availability branches ([999e22c](https://github.com/visulima/visulima/commit/999e22c94828e382f962d3bb695f2a63bc3e985b))
67
+ * **email:** cover mailersend send and getEmail branches ([e20e805](https://github.com/visulima/visulima/commit/e20e8055fc8058a471fd45fb1526a6e35504865e))
68
+ * **email:** cover mailgun getEmail events, tracking flags, form encoding and attachments ([cf63a01](https://github.com/visulima/visulima/commit/cf63a013cdcfc546fb731ad7c9b381b637490bd5))
69
+ * **email:** cover mailgun send and getEmail branches ([3f63011](https://github.com/visulima/visulima/commit/3f63011a43752e8ba4f19e11857843b1f4830557))
70
+ * **email:** cover mailjet getEmail, send failure, campaign fields and attachments ([2f4147f](https://github.com/visulima/visulima/commit/2f4147ff105386ac13700154a2fb5e081fa6d70b))
71
+ * **email:** cover mailjet send and getEmail branches ([d692d34](https://github.com/visulima/visulima/commit/d692d346dc179f9778857d502824b3f68cd0f769))
72
+ * **email:** cover mailomat and mailpace getEmail and edge paths ([519d057](https://github.com/visulima/visulima/commit/519d057b19f23f2157c379595fa041fb17fff189))
73
+ * **email:** cover mailomat getEmail and branch paths ([8b52328](https://github.com/visulima/visulima/commit/8b52328146ccb0f6f2a10ce4652679e13debdb1a))
74
+ * **email:** cover mailomat send/getEmail branch paths ([df5b5a4](https://github.com/visulima/visulima/commit/df5b5a446c8f373d09f5cab3d98280b35d495657))
75
+ * **email:** cover mailpace availability and send branches ([b89b4ad](https://github.com/visulima/visulima/commit/b89b4ad51cde34d58656944a171434d6b2d361d7))
76
+ * **email:** cover mailpace logger branch ([8e4fe77](https://github.com/visulima/visulima/commit/8e4fe779599f5ad43a63c24f7e7e9fa4d5b631ce))
77
+ * **email:** cover mailtrap request, attachment and availability branches ([ee23353](https://github.com/visulima/visulima/commit/ee2335365cf6aac08578e7010b20752768bc3c8d))
78
+ * **email:** cover mailtrap send and getEmail branches ([be3e1a3](https://github.com/visulima/visulima/commit/be3e1a3b85fc49c7f9848d3d5f12b1aa2df18ab8))
79
+ * **email:** cover make-request non-error rejection ([9626626](https://github.com/visulima/visulima/commit/9626626f57afca5b8dcbb1653d9796575a17d666))
80
+ * **email:** cover make-request timeout cleanup, json fallback and body coercion ([3d76d4e](https://github.com/visulima/visulima/commit/3d76d4ee92da4159ea9a5c6d247ee22f680ed3a4))
81
+ * **email:** cover mandrill request, analytics and availability branches ([1233ff3](https://github.com/visulima/visulima/commit/1233ff327f34246ea2363a0b914e88d7c8471d78))
82
+ * **email:** cover mandrill send and template branches ([297754f](https://github.com/visulima/visulima/commit/297754f8aa984269da98a082e8252b4cca9f1fc2))
83
+ * **email:** cover mock init, recipient, and response branches ([5b301f5](https://github.com/visulima/visulima/commit/5b301f5d8de4bc0778379d9b2da8024913f2bcc2))
84
+ * **email:** cover mock provider send/retrieve catch paths ([bb47683](https://github.com/visulima/visulima/commit/bb47683295e249f37cea1ea6bfb6bdda9f29a8d5))
85
+ * **email:** cover mx lookup non-error rejection ([e52a2b6](https://github.com/visulima/visulima/commit/e52a2b663fe795a1c6f8727dc6ea655425c140b0))
86
+ * **email:** cover nodemailer branch paths and fix lint ([6b5b72b](https://github.com/visulima/visulima/commit/6b5b72b0d8404a25d386d9d6cd0b79199550a1ed))
87
+ * **email:** cover opentelemetry branches and fix lint ([6ac926b](https://github.com/visulima/visulima/commit/6ac926b484a229a66ac38c98dbe8e0c47e431ee8))
88
+ * **email:** cover parse-address domain-literal and quoted-local edge cases ([fa909c7](https://github.com/visulima/visulima/commit/fa909c735d849997f99254f5dcfd0a3bf62b4804))
89
+ * **email:** cover parse-address quote after at-sign ([49143f6](https://github.com/visulima/visulima/commit/49143f65e65b317d1da6e42cab7d2c03f1e63fca))
90
+ * **email:** cover payload builder recipient/template branches ([e629d81](https://github.com/visulima/visulima/commit/e629d814c02576c4b24035235b4fdadf4021a61e))
91
+ * **email:** cover plunk getEmail throw and attachment branches ([c24c2bf](https://github.com/visulima/visulima/commit/c24c2bf0e14247a8bd8538b679ba0f869276107a))
92
+ * **email:** cover plunk send/getEmail branch paths ([96c2097](https://github.com/visulima/visulima/commit/96c2097ae3cb3bec00a57a04d768c83cd816c1db))
93
+ * **email:** cover postal request, attachment and availability branches ([8617ce2](https://github.com/visulima/visulima/commit/8617ce2e43a5244a94434a0995367f5bbb4669b3))
94
+ * **email:** cover postal send and getEmail branches ([9e78f76](https://github.com/visulima/visulima/commit/9e78f769faf6dcb38311995d1f26dee11f2727c8))
95
+ * **email:** cover postmark getEmail, template alias, metadata and attachments ([58236b4](https://github.com/visulima/visulima/commit/58236b47e751a893cca3762e11600fd29fecf4a8))
96
+ * **email:** cover postmark send and template branches ([5c298da](https://github.com/visulima/visulima/commit/5c298da4a20d1125d82cb36cb3c324948ab7c228))
97
+ * **email:** cover provider address formatters ([dd4da80](https://github.com/visulima/visulima/commit/dd4da80afd21074fb145b65d75ad44da5bfaac2f))
98
+ * **email:** cover reply-to validation and mx cache-on-error ([16cc9c2](https://github.com/visulima/visulima/commit/16cc9c2f96368d364271a11a72ec679af5d3df0a))
99
+ * **email:** cover resend getEmail, isAvailable, and full send payload ([e0c4981](https://github.com/visulima/visulima/commit/e0c4981ece5a148c941b3239d53e87dd1b38cb48))
100
+ * **email:** cover resend send, getEmail, availability branches ([bfca30d](https://github.com/visulima/visulima/commit/bfca30d7387d9c351f4b201f21e287fc8a7b2eb6))
101
+ * **email:** cover roundrobin init, wait and failover branches ([8b42738](https://github.com/visulima/visulima/commit/8b427389ff13d9b5cf7d79e318522d54be103ac7))
102
+ * **email:** cover roundrobin name fallbacks and retry paths ([57d56c8](https://github.com/visulima/visulima/commit/57d56c8f8fca3ec17088b09000deac6d0c0707c2))
103
+ * **email:** cover scaleway branch and init failure paths ([5ca4c8f](https://github.com/visulima/visulima/commit/5ca4c8fa479b94d675bc5b6982d6dbe8564a4f0c))
104
+ * **email:** cover scaleway getEmail failure and attachment branches ([1fdbb2f](https://github.com/visulima/visulima/commit/1fdbb2f9404e988129ef485c3ec86a10f870b431))
105
+ * **email:** cover sendgrid getEmail, settings, send failure and attachments ([db99fc8](https://github.com/visulima/visulima/commit/db99fc82e925c5c1187c00185d11872ffc5b5247))
106
+ * **email:** cover sendgrid send and availability branches ([5bca44a](https://github.com/visulima/visulima/commit/5bca44a7fdde5cca30d4079b6ab222271eefb8ad))
107
+ * **email:** cover smime aes128/aes192 algorithm aliases ([715482a](https://github.com/visulima/visulima/commit/715482aeabd6b90949e4a0f70cc9c6b11f0e9170))
108
+ * **email:** cover smime build-message and algorithm paths ([49319c1](https://github.com/visulima/visulima/commit/49319c1c540dc5dd2a1b568791e40e246358c91b))
109
+ * **email:** cover smime empty-body and empty recipient ([bc8ab8c](https://github.com/visulima/visulima/commit/bc8ab8cae1f15c466dfb08eef07312081e358484))
110
+ * **email:** cover smtp 551/553 recipient rejections ([7c4630c](https://github.com/visulima/visulima/commit/7c4630c87496d62c371443412ecb22aabab44be7))
111
+ * **email:** cover smtp branch paths ([d0c135e](https://github.com/visulima/visulima/commit/d0c135eaf7739d1f3025060eaf0bf953c7d41d13))
112
+ * **email:** cover smtp provider via mock-socket harness ([08d98f9](https://github.com/visulima/visulima/commit/08d98f95bb677df4212928a9019cfd7cdf9de898))
113
+ * **email:** cover smtp verify cache write error ([eceaf97](https://github.com/visulima/visulima/commit/eceaf9785081ec4418db0e279009a0c2238a87e8))
114
+ * **email:** cover sweego branch and init failure paths ([99abf7a](https://github.com/visulima/visulima/commit/99abf7a3cd42fba2f4808539f4177368f7186de8))
115
+ * **email:** cover sweego getEmail throw and attachment branches ([139d0ca](https://github.com/visulima/visulima/commit/139d0ca18be97d91a92dbbf9dd6da81693375e0c))
116
+ * **email:** cover to-base64 buffer-less fallback and is-port-available ([c8c7454](https://github.com/visulima/visulima/commit/c8c7454bf0bcf9d734384bac21f24739eeb8de84))
117
+ * **email:** cover validate-email hyphen domain rejection paths ([125eab0](https://github.com/visulima/visulima/commit/125eab0d9a543196496aea6de7d8adf3b3441aae))
118
+ * **email:** cover verify-email mx and smtp branches ([70905d1](https://github.com/visulima/visulima/commit/70905d1430e00efea031116ac675ef30919cee51))
119
+ * **email:** cover verify-smtp socket state machine and caching ([2b84cc1](https://github.com/visulima/visulima/commit/2b84cc1e36c01ef067ec571acdcfe614d9b2d1dc))
120
+ * **email:** cover vue-email default data branch ([c51b812](https://github.com/visulima/visulima/commit/c51b812079f98eca77615c0c08fd206dfb67ad39))
121
+ * **email:** cover zeptomail send error detail and exception branches ([ea74549](https://github.com/visulima/visulima/commit/ea745494f693360cc48d12bfb2bd8af66be0395e))
122
+ * **email:** cover zeptomail send error/header/attachment branches ([5b78e15](https://github.com/visulima/visulima/commit/5b78e15a97a8f0070fe172e5dc92b0a3926bb01b))
123
+ * **email:** fix lint in smtp harness test ([87811af](https://github.com/visulima/visulima/commit/87811af4dc6dea41a5a6ea2f96e3af19b168a0b3))
124
+ * improve coverage across packages ([91bd6d3](https://github.com/visulima/visulima/commit/91bd6d3b61736e3c8bd1fc59b0b5955f76a5d323))
125
+
126
+
127
+ ### Dependencies
128
+
129
+ * **@visulima/error:** upgraded to 6.0.0-alpha.31
130
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.29
131
+
1
132
  ## @visulima/email [1.0.0-alpha.33](https://github.com/visulima/visulima/compare/@visulima/email@1.0.0-alpha.32...@visulima/email@1.0.0-alpha.33) (2026-05-27)
2
133
 
3
134
  ### Bug Fixes
package/README.md CHANGED
@@ -114,6 +114,46 @@ const message = new MailMessage().to("user@example.com").subject("Hello").html("
114
114
  await mail.send(message);
115
115
  ```
116
116
 
117
+ ### Capability Guard (fail-fast field support)
118
+
119
+ Every provider declares which capabilities it supports through its `features` flags (attachments, tagging, scheduling, HTML, custom headers, reply-to, templates, ...). Before a message is handed to the provider, `Mail` runs a fail-fast check: if the message uses a capability the provider has **explicitly** declared unsupported (`features[x] === false`), the send is rejected locally — no wasted network round-trip and no silent data loss.
120
+
121
+ ```typescript
122
+ import { createMail } from "@visulima/email";
123
+ import { awsSesProvider } from "@visulima/email/providers/aws-ses";
124
+
125
+ // AWS SES declares `tagging: false`
126
+ const mail = createMail(awsSesProvider({ accessKeyId, secretAccessKey, region }));
127
+
128
+ const result = await mail.send({
129
+ from: { email: "noreply@example.com" },
130
+ subject: "Hi",
131
+ tags: ["promo"], // not representable by AWS SES
132
+ text: "Body",
133
+ to: { email: "user@example.com" },
134
+ });
135
+
136
+ result.success; // false
137
+ (result.error as { code?: string }).code; // "UNSUPPORTED_FEATURES"
138
+ ```
139
+
140
+ Capabilities left `undefined` are treated as "unknown" and never rejected, so providers that publish a partial (or no) `features` map are never falsely blocked. The behaviour is configurable per `Mail` instance:
141
+
142
+ ```typescript
143
+ createMail(provider, { featureCheck: "error" }); // default — reject unsupported fields
144
+ createMail(provider, { featureCheck: "warn" }); // log a warning and send anyway
145
+ createMail(provider, { featureCheck: "off" }); // skip the check entirely
146
+ ```
147
+
148
+ You can also run the check standalone (e.g. inside a custom provider):
149
+
150
+ ```typescript
151
+ import { checkFeatureSupport } from "@visulima/email";
152
+ // or the focused entry point: "@visulima/email/validation/check-feature-support"
153
+
154
+ const { supported, violations } = checkFeatureSupport(message, provider.features);
155
+ ```
156
+
117
157
  ### Creating Draft Emails
118
158
 
119
159
  You can create draft emails in EML (RFC 822) format without sending them. The `draft()` method returns the email as an EML string with an `X-Unsent: 1` header automatically added:
@@ -1376,6 +1416,83 @@ normalizeEmailAliases("user+tag@gmx.com"); // "user@gmx.com"
1376
1416
  normalizeEmailAliases("user@example.com"); // "user@example.com"
1377
1417
  ```
1378
1418
 
1419
+ ## Batch Sending & Result Helpers
1420
+
1421
+ Send one message per recipient from a shared base, with optional per-recipient template rendering, via `mail.sendBatch(base, personalizations, options?)`. Every `send` returns a `Result<EmailResult>`; the `isOk`/`isErr`/`unwrap`/`unwrapOr`/`mapOk`/`tryAsync` helpers (exported from the root and `@visulima/email/utils/result`) make handling it ergonomic.
1422
+
1423
+ ```typescript
1424
+ import { createMail, isOk, unwrapOr } from "@visulima/email";
1425
+
1426
+ const mail = createMail(provider);
1427
+
1428
+ for await (const receipt of mail.sendBatch(
1429
+ { from: { email: "news@example.com" }, subject: "Hi {{name}}", html: "<p>Hello {{name}}</p>" },
1430
+ [{ to: { email: "a@example.com" }, data: { name: "Ada" } }],
1431
+ { render: (template, data) => renderHandlebars(template, data) },
1432
+ )) {
1433
+ if (receipt.successful) console.log("sent", receipt.messageId);
1434
+ }
1435
+ ```
1436
+
1437
+ See [Sending Mail](https://visulima.com/docs/package/email/getting-started/sending-mail).
1438
+
1439
+ ## Middleware
1440
+
1441
+ Attach resilience middleware with `mail.use(...)`: retry (full-jitter backoff + dead-letter), rate limiting (with per-provider presets), circuit breaker, deduplication, OAuth2 token refresh, and PII-redacting logging.
1442
+
1443
+ ```typescript
1444
+ import { createMail } from "@visulima/email";
1445
+ import { circuitBreakerMiddleware, RATE_LIMIT_PRESETS, rateLimitMiddleware, retryMiddleware } from "@visulima/email/middleware";
1446
+
1447
+ const mail = createMail(provider)
1448
+ .use(rateLimitMiddleware({ rate: RATE_LIMIT_PRESETS.resend }))
1449
+ .use(circuitBreakerMiddleware())
1450
+ .use(retryMiddleware({ retries: 3 }));
1451
+ ```
1452
+
1453
+ See [Middleware](https://visulima.com/docs/package/email/middleware/introduction).
1454
+
1455
+ ## Queue & Worker
1456
+
1457
+ Durable background sending via the `EmailQueue` interface: an in-memory `MemoryQueue`, an `UnstorageQueue` (`@visulima/email/queue/unstorage`) backed by any [unstorage](https://unstorage.unjs.io/) store (Redis/FS/KV/Postgres), and a `createWorker(...)` with bounded concurrency, retry/backoff and dead-lettering.
1458
+
1459
+ ```typescript
1460
+ import { createMail } from "@visulima/email";
1461
+ import { createWorker, MemoryQueue } from "@visulima/email/queue";
1462
+
1463
+ const queue = new MemoryQueue();
1464
+ const mail = createMail(provider);
1465
+
1466
+ await queue.enqueue({ from: { email: "a@x.com" }, to: { email: "b@x.com" }, subject: "Hi", text: "yo" });
1467
+ createWorker({ queue, send: mail.send.bind(mail), concurrency: 5 }).start();
1468
+ ```
1469
+
1470
+ See [Queue](https://visulima.com/docs/package/email/queue/introduction).
1471
+
1472
+ ## Webhook Verification
1473
+
1474
+ Verify provider webhook signatures with `@visulima/email/webhooks`: `verifyStandardWebhook`/`verifyResendWebhook` (Svix/Standard Webhooks), `verifyMailgunWebhook`, `verifySendGridWebhook` (ECDSA + replay window), `verifyPostmarkWebhook` (Basic Auth), and `verifySnsMessage` (AWS SES via SNS, with a tight `sns.<region>.amazonaws.com` cert allowlist). All return `{ valid, reason? }` — always pass the **raw** request body.
1475
+
1476
+ See [Webhooks](https://visulima.com/docs/package/email/webhooks/introduction).
1477
+
1478
+ ## Inbound Parsing
1479
+
1480
+ Normalize inbound webhooks from Postmark, SendGrid, Mailgun, Cloudflare Email and SES into one `InboundEmail` shape, then strip quoted history with `extractReply()` (EN/DE/FR/ES/TR) and group conversations with `stitchThreads()`.
1481
+
1482
+ See [Inbound](https://visulima.com/docs/package/email/inbound/introduction).
1483
+
1484
+ ## Deliverability
1485
+
1486
+ 2024 bulk-sender tooling in `@visulima/email/deliverability`: RFC 8058 one-click `buildListUnsubscribe`, suppression stores (`MemorySuppressionStore` + `filterSuppressed`), and parsers for DMARC records, MTA-STS policies, TLS-RPT records/reports, and ARF feedback-loop complaints. ARC sealing (`signArc`) lives in `@visulima/email/crypto`.
1487
+
1488
+ See [Deliverability](https://visulima.com/docs/package/email/deliverability/introduction).
1489
+
1490
+ ## Events & Testing
1491
+
1492
+ A unified `EmailEvent` stream (`EventBus` + `MemoryEventStore` in `@visulima/email/events`), and a test harness (`@visulima/email/test`): `createTestEmail()` plus Vitest matchers `toHaveSentTo` / `toHaveSentWithSubject` / `toHaveSentWithAttachment` / `toHaveSentMatching`.
1493
+
1494
+ See [Events](https://visulima.com/docs/package/email/events/introduction) and [Testing](https://visulima.com/docs/package/email/testing/introduction).
1495
+
1379
1496
  ## Related
1380
1497
 
1381
1498
  ## Supported Node.js Versions
@@ -1,7 +1,164 @@
1
- import { E as EmailOptions } from "../packem_shared/types.d-wwpgA3to.js";
2
- import { D as DkimOptions, E as EmailSigner, S as SmimeEncryptOptions, a as EmailEncrypter, b as SmimeSignOptions } from "../packem_shared/types.d-CNnnk-Ya.js";
1
+ import { KeyObject } from 'node:crypto';
2
+ import { E as EmailOptions } from "../packem_shared/types.d-ejzh-xBP.js";
3
+ import { D as DkimOptions, E as EmailSigner, S as SmimeEncryptOptions, a as EmailEncrypter, b as SmimeSignOptions } from "../packem_shared/types.d-BId55FW2.js";
3
4
  import 'node:buffer';
4
5
  /**
6
+ * The signature algorithm for the ARC headers. RSA per RFC 8617, Ed25519 per RFC 8463.
7
+ */
8
+ type ArcAlgorithm = "ed25519-sha256" | "rsa-sha256";
9
+ /**
10
+ * Options for {@link signArc}.
11
+ */
12
+ interface ArcSealOptions {
13
+ /**
14
+ * Signature algorithm (`a=`). `rsa-sha256` (default) or `ed25519-sha256` (RFC 8463).
15
+ * @default "rsa-sha256"
16
+ */
17
+ algorithm?: ArcAlgorithm;
18
+ /**
19
+ * The `Authentication-Results` value to chain (authserv-id plus method results),
20
+ * e.g. `example.com; spf=pass smtp.mailfrom=...; dkim=pass header.d=...`.
21
+ */
22
+ authenticationResults: string;
23
+ /**
24
+ * Chain validation status for the seal (`cv`). For an originating sealer (instance 1) this is
25
+ * always `none`.
26
+ * @default "none"
27
+ */
28
+ cv?: "fail" | "none" | "pass";
29
+ /**
30
+ * The signing domain (`d`).
31
+ */
32
+ domainName: string;
33
+ /**
34
+ * Lower-cased header names covered by the ARC-Message-Signature (`h`).
35
+ * @default from, to, cc, subject, date, message-id, mime-version
36
+ */
37
+ headersToSign?: string[];
38
+ /**
39
+ * The ARC instance number (`i`). Only `1` (originating sealer) is supported.
40
+ * @default 1
41
+ */
42
+ instance?: number;
43
+ /**
44
+ * The DKIM/ARC key selector (`s`).
45
+ */
46
+ keySelector: string;
47
+ /**
48
+ * Passphrase for an encrypted private key.
49
+ */
50
+ passphrase?: string;
51
+ /**
52
+ * Private key (PEM string, or a `file://` path). RSA or Ed25519 to match `algorithm`.
53
+ */
54
+ privateKey: string;
55
+ /**
56
+ * Signature timestamp (`t`) in unix seconds. Defaults to now.
57
+ */
58
+ timestamp?: number;
59
+ }
60
+ /**
61
+ * The three ARC header fields produced for one instance.
62
+ */
63
+ interface ArcHeaderSet {
64
+ "ARC-Authentication-Results": string;
65
+ "ARC-Message-Signature": string;
66
+ "ARC-Seal": string;
67
+ }
68
+ /**
69
+ * Options for {@link verifyArc}.
70
+ */
71
+ interface ArcVerifyOptions {
72
+ /**
73
+ * The ARC/DKIM public key for the signing domain+selector — a PEM string or a `KeyObject`. Look it
74
+ * up at `&lt;selector>._domainkey.&lt;d>` (the `p=` tag), decoded to SPKI.
75
+ */
76
+ publicKey: KeyObject | string;
77
+ }
78
+ /**
79
+ * The outcome of {@link verifyArc}.
80
+ */
81
+ interface ArcVerifyResult {
82
+ /**
83
+ * Per-component verification: the ARC-Message-Signature, the ARC-Seal, and the body hash.
84
+ */
85
+ components: {
86
+ ams: boolean;
87
+ bodyHash: boolean;
88
+ seal: boolean;
89
+ };
90
+ /**
91
+ * The chain-validation status (`cv`) from the ARC-Seal.
92
+ */
93
+ cv?: string;
94
+ /**
95
+ * A machine-readable reason when `valid` is `false`.
96
+ */
97
+ reason?: string;
98
+ /**
99
+ * Whether the whole instance verified (signature + seal + body hash).
100
+ */
101
+ valid: boolean;
102
+ }
103
+ /**
104
+ * Computes the exact byte string that the ARC-Message-Signature `b=` value signs.
105
+ *
106
+ * Exposed so ARC verifiers (and tests) can re-derive the signing input.
107
+ * @param email The email being sealed.
108
+ * @param options The seal options.
109
+ * @returns The AMS header (without the `b=` value) and the data signed.
110
+ */
111
+ declare const arcMessageSignatureBase: (email: EmailOptions, options: ArcSealOptions) => {
112
+ header: string;
113
+ signBase: string;
114
+ };
115
+ /**
116
+ * Computes the exact byte string that the ARC-Seal `b=` value signs (for an originating, i=1 seal).
117
+ *
118
+ * Exposed so ARC verifiers (and tests) can re-derive the signing input.
119
+ * @param aarValue The ARC-Authentication-Results value.
120
+ * @param amsValue The full ARC-Message-Signature value (including its `b=` signature).
121
+ * @param options The signing domain, selector, instance, timestamp and chain-validation status.
122
+ * @returns The ARC-Seal header (without the `b=` value) and the data signed.
123
+ */
124
+ declare const arcSealBase: (aarValue: string, amsValue: string, options: ArcSealOptions) => {
125
+ header: string;
126
+ signBase: string;
127
+ };
128
+ /**
129
+ * Seals a message with an ARC (Authenticated Received Chain, RFC 8617) header set for an originating
130
+ * sealer (instance `i=1`).
131
+ *
132
+ * Adds `ARC-Authentication-Results`, `ARC-Message-Signature`, and `ARC-Seal` headers. Use this when
133
+ * your service forwards mail and wants downstream receivers to trust the authentication results you
134
+ * observed. Supports RSA (default) and Ed25519 (`algorithm: "ed25519-sha256"`, RFC 8463) keys.
135
+ *
136
+ * IMPORTANT: the body hash (`bh=`) is computed over `text` + "\n\n" + `html` with relaxed
137
+ * canonicalization — the same simplification as the DKIM signer. For a third-party ARC verifier to
138
+ * accept the seal, the body actually transmitted on the wire must canonicalize to this same value, so
139
+ * apply ARC at the point where the MIME body is finalized (or feed in the exact rendered body).
140
+ * @param email The email to seal.
141
+ * @param options The seal options. See {@link ArcSealOptions}.
142
+ * @returns The email with the ARC header set added, and the raw {@link ArcHeaderSet}.
143
+ * @throws {Error} When the private key cannot be loaded or signing fails.
144
+ */
145
+ declare const signArc: (email: EmailOptions, options: ArcSealOptions) => Promise<{
146
+ email: EmailOptions;
147
+ headers: ArcHeaderSet;
148
+ }>;
149
+ /**
150
+ * Verifies an originating (i=1) ARC header set against the signing domain's public key.
151
+ *
152
+ * Re-derives the AMS and ARC-Seal signing inputs from `email` + the supplied ARC headers, recomputes
153
+ * the body hash, and checks all three. The public key must be the one published for the seal's
154
+ * `s=`/`d=` (the DKIM-style `&lt;selector>._domainkey.&lt;domain>` TXT `p=` value).
155
+ * @param email The message that was sealed (same fields used when signing).
156
+ * @param headers The ARC header set (or any record containing the three `ARC-*` headers).
157
+ * @param options Verification options. See {@link ArcVerifyOptions}.
158
+ * @returns The verification result. See {@link ArcVerifyResult}.
159
+ */
160
+ declare const verifyArc: (email: EmailOptions, headers: ArcHeaderSet | Record<string, string>, options: ArcVerifyOptions) => ArcVerifyResult;
161
+ /**
5
162
  * DKIM signer implementation
6
163
  */
7
164
  declare class DkimSigner implements EmailSigner {
@@ -144,4 +301,4 @@ declare class SmimeSigner implements EmailSigner {
144
301
  * @returns A new SmimeSigner instance ready to sign emails.
145
302
  */
146
303
  declare const createSmimeSigner: (options: SmimeSignOptions) => SmimeSigner;
147
- export { type DkimOptions, DkimSigner, type EmailEncrypter, type EmailSigner, type SmimeEncryptOptions, SmimeEncrypter, type SmimeSignOptions, SmimeSigner, createDkimSigner, createSmimeEncrypter, createSmimeSigner };
304
+ export { type ArcAlgorithm, type ArcHeaderSet, type ArcSealOptions, type ArcVerifyOptions, type ArcVerifyResult, type DkimOptions, DkimSigner, type EmailEncrypter, type EmailSigner, type SmimeEncryptOptions, SmimeEncrypter, type SmimeSignOptions, SmimeSigner, arcMessageSignatureBase, arcSealBase, createDkimSigner, createSmimeEncrypter, createSmimeSigner, signArc, verifyArc };
@@ -1 +1 @@
1
- import{DkimSigner as m,createDkimSigner as i}from"../packem_shared/DkimSigner-CX2yGILn.js";import{SmimeEncrypter as S,createSmimeEncrypter as n}from"../packem_shared/SmimeEncrypter-DInfo-l0.js";import{SmimeSigner as c,createSmimeSigner as p}from"../packem_shared/SmimeSigner-CSWbZ41O.js";export{m as DkimSigner,S as SmimeEncrypter,c as SmimeSigner,i as createDkimSigner,n as createSmimeEncrypter,p as createSmimeSigner};
1
+ import{arcMessageSignatureBase as m,arcSealBase as i,signArc as a,verifyArc as t}from"../packem_shared/arcMessageSignatureBase-Cpdnv-H8.js";import{DkimSigner as c,createDkimSigner as n}from"../packem_shared/DkimSigner-dKZ45Csc.js";import{SmimeEncrypter as g,createSmimeEncrypter as p}from"../packem_shared/SmimeEncrypter-BirIsrip.js";import{SmimeSigner as s,createSmimeSigner as x}from"../packem_shared/SmimeSigner-CkyaShTs.js";export{c as DkimSigner,g as SmimeEncrypter,s as SmimeSigner,m as arcMessageSignatureBase,i as arcSealBase,n as createDkimSigner,p as createSmimeEncrypter,x as createSmimeSigner,a as signArc,t as verifyArc};
@@ -0,0 +1,95 @@
1
+ /**
2
+ * A DKIM/SPF auth result inside a DMARC aggregate record.
3
+ */
4
+ interface DmarcAuthResult {
5
+ domain?: string;
6
+ result?: string;
7
+ }
8
+ /**
9
+ * One `&lt;record>` row of a DMARC aggregate report.
10
+ */
11
+ interface DmarcRecordRow {
12
+ /**
13
+ * The per-mechanism auth results.
14
+ */
15
+ authResults: {
16
+ dkim: DmarcAuthResult[];
17
+ spf: DmarcAuthResult[];
18
+ };
19
+ /**
20
+ * Number of messages this row represents.
21
+ */
22
+ count: number;
23
+ /**
24
+ * The policy disposition applied (`none` / `quarantine` / `reject`).
25
+ */
26
+ disposition?: string;
27
+ /**
28
+ * The DKIM alignment result (`pass` / `fail`).
29
+ */
30
+ dkim?: string;
31
+ /**
32
+ * The `From:` header domain.
33
+ */
34
+ headerFrom?: string;
35
+ /**
36
+ * The source IP that sent the messages.
37
+ */
38
+ sourceIp?: string;
39
+ /**
40
+ * The SPF alignment result (`pass` / `fail`).
41
+ */
42
+ spf?: string;
43
+ }
44
+ /**
45
+ * A parsed DMARC aggregate (RUA) report.
46
+ */
47
+ interface DmarcAggregateReport {
48
+ /**
49
+ * Report window start (`date_range.begin`, unix seconds as a string).
50
+ */
51
+ dateRangeBegin?: string;
52
+ /**
53
+ * Report window end (`date_range.end`, unix seconds as a string).
54
+ */
55
+ dateRangeEnd?: string;
56
+ /**
57
+ * The reporter's contact email.
58
+ */
59
+ email?: string;
60
+ /**
61
+ * The reporting organization.
62
+ */
63
+ organizationName?: string;
64
+ /**
65
+ * The published policy the report was evaluated against.
66
+ */
67
+ policyPublished?: {
68
+ adkim?: string;
69
+ aspf?: string;
70
+ domain?: string;
71
+ p?: string;
72
+ pct?: number;
73
+ sp?: string;
74
+ };
75
+ /**
76
+ * The per-source rows.
77
+ */
78
+ records: DmarcRecordRow[];
79
+ /**
80
+ * The unique report id.
81
+ */
82
+ reportId?: string;
83
+ }
84
+ /**
85
+ * Parses a DMARC aggregate (RUA) report XML document into a structured object.
86
+ *
87
+ * Reports arrive gzipped/zipped — decompress to the XML string first. `fast-xml-parser` is an optional
88
+ * peer dependency (`pnpm add fast-xml-parser`), loaded only via this `./deliverability/dmarc-report`
89
+ * entry point so the rest of the deliverability tooling stays dependency-free.
90
+ * @param xml The DMARC aggregate report XML.
91
+ * @returns The parsed report. See {@link DmarcAggregateReport}.
92
+ * @throws {EmailError} When `fast-xml-parser` is not installed or the XML cannot be parsed.
93
+ */
94
+ declare const parseDmarcReport: (xml: string) => Promise<DmarcAggregateReport>;
95
+ export { type DmarcAggregateReport, type DmarcAuthResult, type DmarcRecordRow, parseDmarcReport };
@@ -0,0 +1 @@
1
+ var R=Object.defineProperty;var f=(e,t)=>R(e,"name",{value:t,configurable:!0});import m from"../packem_shared/EmailError-zm2ffVav.js";var v=Object.defineProperty,o=f((e,t)=>v(e,"name",{value:t,configurable:!0}),"a");const b=o(e=>e==null?[]:Array.isArray(e)?e:[e],"toArray"),r=o(e=>{if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return String(e)},"asString"),g=o(e=>{const t=r(e);if(t===void 0)return;const i=Number(t);return Number.isNaN(i)?void 0:i},"asNumber"),y=o(e=>b(e).map(t=>({domain:r(t.domain),result:r(t.result)})),"toAuthResults"),k=o(async e=>{let t;try{({XMLParser:t}=await import("fast-xml-parser"))}catch(a){throw a instanceof Error&&(a.code==="ERR_MODULE_NOT_FOUND"||a.message.includes("Cannot find module")||a.message.includes("Cannot find package"))?new m("deliverability","fast-xml-parser is not installed. Please install it: pnpm add fast-xml-parser",{cause:a}):new m("deliverability",`Failed to load fast-xml-parser: ${a.message}`,{cause:a})}let i;try{i=new t({ignoreAttributes:!0,parseTagValue:!1}).parse(e)}catch(a){throw new m("deliverability",`Failed to parse DMARC report: ${a.message}`,{cause:a})}const d=i.feedback??{},n=d.report_metadata??{},u=n.date_range??{},s=d.policy_published??{},h=b(d.record).map(a=>{const p=a.row??{},l=p.policy_evaluated??{},_=a.identifiers??{},c=a.auth_results??{};return{authResults:{dkim:y(c.dkim),spf:y(c.spf)},count:g(p.count)??0,disposition:r(l.disposition),dkim:r(l.dkim),headerFrom:r(_.header_from),sourceIp:r(p.source_ip),spf:r(l.spf)}});return{dateRangeBegin:r(u.begin),dateRangeEnd:r(u.end),email:r(n.email),organizationName:r(n.org_name),policyPublished:{adkim:r(s.adkim),aspf:r(s.aspf),domain:r(s.domain),p:r(s.p),pct:g(s.pct),sp:r(s.sp)},records:h,reportId:r(n.report_id)}},"parseDmarcReport");export{k as parseDmarcReport};