@bobfrankston/mailx 1.0.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 (519) hide show
  1. package/.tswalk.json +3366 -0
  2. package/README.md +160 -0
  3. package/bin/mailx.js +58 -0
  4. package/client/app.js +431 -0
  5. package/client/components/folder-tree.js +286 -0
  6. package/client/components/message-list.js +230 -0
  7. package/client/components/message-viewer.js +161 -0
  8. package/client/compose/compose.css +197 -0
  9. package/client/compose/compose.html +45 -0
  10. package/client/compose/compose.js +335 -0
  11. package/client/favicon.svg +11 -0
  12. package/client/index.html +100 -0
  13. package/client/lib/api-client.js +67 -0
  14. package/client/package.json +9 -0
  15. package/client/styles/components.css +361 -0
  16. package/client/styles/layout.css +69 -0
  17. package/launch.ps1 +20 -0
  18. package/launcher/Cargo.lock +3167 -0
  19. package/launcher/Cargo.toml +13 -0
  20. package/launcher/build.cmd +4 -0
  21. package/launcher/build.rs +8 -0
  22. package/launcher/mailx.ico +0 -0
  23. package/launcher/release.cmd +4 -0
  24. package/launcher/src/main.rs +371 -0
  25. package/mailx.cmd +2 -0
  26. package/mailx.db +0 -0
  27. package/mailx.db-shm +0 -0
  28. package/mailx.db-wal +0 -0
  29. package/mailx.json +9 -0
  30. package/package.json +51 -0
  31. package/packages/mailx-api/index.d.ts +9 -0
  32. package/packages/mailx-api/index.js +375 -0
  33. package/packages/mailx-api/node_modules/nodemailer/.ncurc.js +9 -0
  34. package/packages/mailx-api/node_modules/nodemailer/.prettierignore +8 -0
  35. package/packages/mailx-api/node_modules/nodemailer/.prettierrc +12 -0
  36. package/packages/mailx-api/node_modules/nodemailer/.prettierrc.js +10 -0
  37. package/packages/mailx-api/node_modules/nodemailer/.release-please-config.json +9 -0
  38. package/packages/mailx-api/node_modules/nodemailer/LICENSE +16 -0
  39. package/packages/mailx-api/node_modules/nodemailer/README.md +86 -0
  40. package/packages/mailx-api/node_modules/nodemailer/SECURITY.txt +22 -0
  41. package/packages/mailx-api/node_modules/nodemailer/eslint.config.js +88 -0
  42. package/packages/mailx-api/node_modules/nodemailer/lib/addressparser/index.js +383 -0
  43. package/packages/mailx-api/node_modules/nodemailer/lib/base64/index.js +139 -0
  44. package/packages/mailx-api/node_modules/nodemailer/lib/dkim/index.js +253 -0
  45. package/packages/mailx-api/node_modules/nodemailer/lib/dkim/message-parser.js +155 -0
  46. package/packages/mailx-api/node_modules/nodemailer/lib/dkim/relaxed-body.js +154 -0
  47. package/packages/mailx-api/node_modules/nodemailer/lib/dkim/sign.js +117 -0
  48. package/packages/mailx-api/node_modules/nodemailer/lib/fetch/cookies.js +281 -0
  49. package/packages/mailx-api/node_modules/nodemailer/lib/fetch/index.js +280 -0
  50. package/packages/mailx-api/node_modules/nodemailer/lib/json-transport/index.js +82 -0
  51. package/packages/mailx-api/node_modules/nodemailer/lib/mail-composer/index.js +629 -0
  52. package/packages/mailx-api/node_modules/nodemailer/lib/mailer/index.js +441 -0
  53. package/packages/mailx-api/node_modules/nodemailer/lib/mailer/mail-message.js +316 -0
  54. package/packages/mailx-api/node_modules/nodemailer/lib/mime-funcs/index.js +625 -0
  55. package/packages/mailx-api/node_modules/nodemailer/lib/mime-funcs/mime-types.js +2113 -0
  56. package/packages/mailx-api/node_modules/nodemailer/lib/mime-node/index.js +1316 -0
  57. package/packages/mailx-api/node_modules/nodemailer/lib/mime-node/last-newline.js +33 -0
  58. package/packages/mailx-api/node_modules/nodemailer/lib/mime-node/le-unix.js +43 -0
  59. package/packages/mailx-api/node_modules/nodemailer/lib/mime-node/le-windows.js +52 -0
  60. package/packages/mailx-api/node_modules/nodemailer/lib/nodemailer.js +157 -0
  61. package/packages/mailx-api/node_modules/nodemailer/lib/punycode/index.js +460 -0
  62. package/packages/mailx-api/node_modules/nodemailer/lib/qp/index.js +227 -0
  63. package/packages/mailx-api/node_modules/nodemailer/lib/sendmail-transport/index.js +210 -0
  64. package/packages/mailx-api/node_modules/nodemailer/lib/ses-transport/index.js +234 -0
  65. package/packages/mailx-api/node_modules/nodemailer/lib/shared/index.js +754 -0
  66. package/packages/mailx-api/node_modules/nodemailer/lib/smtp-connection/data-stream.js +108 -0
  67. package/packages/mailx-api/node_modules/nodemailer/lib/smtp-connection/http-proxy-client.js +143 -0
  68. package/packages/mailx-api/node_modules/nodemailer/lib/smtp-connection/index.js +1870 -0
  69. package/packages/mailx-api/node_modules/nodemailer/lib/smtp-pool/index.js +652 -0
  70. package/packages/mailx-api/node_modules/nodemailer/lib/smtp-pool/pool-resource.js +259 -0
  71. package/packages/mailx-api/node_modules/nodemailer/lib/smtp-transport/index.js +421 -0
  72. package/packages/mailx-api/node_modules/nodemailer/lib/stream-transport/index.js +135 -0
  73. package/packages/mailx-api/node_modules/nodemailer/lib/well-known/index.js +47 -0
  74. package/packages/mailx-api/node_modules/nodemailer/lib/well-known/services.json +611 -0
  75. package/packages/mailx-api/node_modules/nodemailer/lib/xoauth2/index.js +427 -0
  76. package/packages/mailx-api/node_modules/nodemailer/package.json +47 -0
  77. package/packages/mailx-api/package.json +24 -0
  78. package/packages/mailx-api/tsconfig.tsbuildinfo +1 -0
  79. package/packages/mailx-compose/index.d.ts +21 -0
  80. package/packages/mailx-compose/index.js +61 -0
  81. package/packages/mailx-compose/package.json +14 -0
  82. package/packages/mailx-imap/index.d.ts +105 -0
  83. package/packages/mailx-imap/index.js +1026 -0
  84. package/packages/mailx-imap/node_modules/nodemailer/.ncurc.js +9 -0
  85. package/packages/mailx-imap/node_modules/nodemailer/.prettierignore +8 -0
  86. package/packages/mailx-imap/node_modules/nodemailer/.prettierrc +12 -0
  87. package/packages/mailx-imap/node_modules/nodemailer/.prettierrc.js +10 -0
  88. package/packages/mailx-imap/node_modules/nodemailer/.release-please-config.json +9 -0
  89. package/packages/mailx-imap/node_modules/nodemailer/LICENSE +16 -0
  90. package/packages/mailx-imap/node_modules/nodemailer/README.md +86 -0
  91. package/packages/mailx-imap/node_modules/nodemailer/SECURITY.txt +22 -0
  92. package/packages/mailx-imap/node_modules/nodemailer/eslint.config.js +88 -0
  93. package/packages/mailx-imap/node_modules/nodemailer/lib/addressparser/index.js +383 -0
  94. package/packages/mailx-imap/node_modules/nodemailer/lib/base64/index.js +139 -0
  95. package/packages/mailx-imap/node_modules/nodemailer/lib/dkim/index.js +253 -0
  96. package/packages/mailx-imap/node_modules/nodemailer/lib/dkim/message-parser.js +155 -0
  97. package/packages/mailx-imap/node_modules/nodemailer/lib/dkim/relaxed-body.js +154 -0
  98. package/packages/mailx-imap/node_modules/nodemailer/lib/dkim/sign.js +117 -0
  99. package/packages/mailx-imap/node_modules/nodemailer/lib/fetch/cookies.js +281 -0
  100. package/packages/mailx-imap/node_modules/nodemailer/lib/fetch/index.js +280 -0
  101. package/packages/mailx-imap/node_modules/nodemailer/lib/json-transport/index.js +82 -0
  102. package/packages/mailx-imap/node_modules/nodemailer/lib/mail-composer/index.js +629 -0
  103. package/packages/mailx-imap/node_modules/nodemailer/lib/mailer/index.js +441 -0
  104. package/packages/mailx-imap/node_modules/nodemailer/lib/mailer/mail-message.js +316 -0
  105. package/packages/mailx-imap/node_modules/nodemailer/lib/mime-funcs/index.js +625 -0
  106. package/packages/mailx-imap/node_modules/nodemailer/lib/mime-funcs/mime-types.js +2113 -0
  107. package/packages/mailx-imap/node_modules/nodemailer/lib/mime-node/index.js +1316 -0
  108. package/packages/mailx-imap/node_modules/nodemailer/lib/mime-node/last-newline.js +33 -0
  109. package/packages/mailx-imap/node_modules/nodemailer/lib/mime-node/le-unix.js +43 -0
  110. package/packages/mailx-imap/node_modules/nodemailer/lib/mime-node/le-windows.js +52 -0
  111. package/packages/mailx-imap/node_modules/nodemailer/lib/nodemailer.js +157 -0
  112. package/packages/mailx-imap/node_modules/nodemailer/lib/punycode/index.js +460 -0
  113. package/packages/mailx-imap/node_modules/nodemailer/lib/qp/index.js +227 -0
  114. package/packages/mailx-imap/node_modules/nodemailer/lib/sendmail-transport/index.js +210 -0
  115. package/packages/mailx-imap/node_modules/nodemailer/lib/ses-transport/index.js +234 -0
  116. package/packages/mailx-imap/node_modules/nodemailer/lib/shared/index.js +754 -0
  117. package/packages/mailx-imap/node_modules/nodemailer/lib/smtp-connection/data-stream.js +108 -0
  118. package/packages/mailx-imap/node_modules/nodemailer/lib/smtp-connection/http-proxy-client.js +143 -0
  119. package/packages/mailx-imap/node_modules/nodemailer/lib/smtp-connection/index.js +1870 -0
  120. package/packages/mailx-imap/node_modules/nodemailer/lib/smtp-pool/index.js +652 -0
  121. package/packages/mailx-imap/node_modules/nodemailer/lib/smtp-pool/pool-resource.js +259 -0
  122. package/packages/mailx-imap/node_modules/nodemailer/lib/smtp-transport/index.js +421 -0
  123. package/packages/mailx-imap/node_modules/nodemailer/lib/stream-transport/index.js +135 -0
  124. package/packages/mailx-imap/node_modules/nodemailer/lib/well-known/index.js +47 -0
  125. package/packages/mailx-imap/node_modules/nodemailer/lib/well-known/services.json +611 -0
  126. package/packages/mailx-imap/node_modules/nodemailer/lib/xoauth2/index.js +427 -0
  127. package/packages/mailx-imap/node_modules/nodemailer/package.json +47 -0
  128. package/packages/mailx-imap/package.json +19 -0
  129. package/packages/mailx-imap/tsconfig.tsbuildinfo +1 -0
  130. package/packages/mailx-send/README.md +217 -0
  131. package/packages/mailx-send/cli-queue.d.ts +11 -0
  132. package/packages/mailx-send/cli-queue.js +59 -0
  133. package/packages/mailx-send/cli-send.d.ts +17 -0
  134. package/packages/mailx-send/cli-send.js +75 -0
  135. package/packages/mailx-send/cli.d.ts +22 -0
  136. package/packages/mailx-send/cli.js +115 -0
  137. package/packages/mailx-send/index.d.ts +77 -0
  138. package/packages/mailx-send/index.js +264 -0
  139. package/packages/mailx-send/mailsend/README.md +133 -0
  140. package/packages/mailx-send/mailsend/cli.d.ts +12 -0
  141. package/packages/mailx-send/mailsend/cli.js +70 -0
  142. package/packages/mailx-send/mailsend/index.d.ts +77 -0
  143. package/packages/mailx-send/mailsend/index.js +264 -0
  144. package/packages/mailx-send/mailsend/node_modules/.package-lock.json +49 -0
  145. package/packages/mailx-send/mailsend/node_modules/@types/node/LICENSE +21 -0
  146. package/packages/mailx-send/mailsend/node_modules/@types/node/README.md +15 -0
  147. package/packages/mailx-send/mailsend/node_modules/@types/node/assert/strict.d.ts +111 -0
  148. package/packages/mailx-send/mailsend/node_modules/@types/node/assert.d.ts +1078 -0
  149. package/packages/mailx-send/mailsend/node_modules/@types/node/async_hooks.d.ts +603 -0
  150. package/packages/mailx-send/mailsend/node_modules/@types/node/buffer.buffer.d.ts +472 -0
  151. package/packages/mailx-send/mailsend/node_modules/@types/node/buffer.d.ts +1934 -0
  152. package/packages/mailx-send/mailsend/node_modules/@types/node/child_process.d.ts +1476 -0
  153. package/packages/mailx-send/mailsend/node_modules/@types/node/cluster.d.ts +578 -0
  154. package/packages/mailx-send/mailsend/node_modules/@types/node/compatibility/disposable.d.ts +14 -0
  155. package/packages/mailx-send/mailsend/node_modules/@types/node/compatibility/index.d.ts +9 -0
  156. package/packages/mailx-send/mailsend/node_modules/@types/node/compatibility/indexable.d.ts +20 -0
  157. package/packages/mailx-send/mailsend/node_modules/@types/node/compatibility/iterators.d.ts +20 -0
  158. package/packages/mailx-send/mailsend/node_modules/@types/node/console.d.ts +452 -0
  159. package/packages/mailx-send/mailsend/node_modules/@types/node/constants.d.ts +21 -0
  160. package/packages/mailx-send/mailsend/node_modules/@types/node/crypto.d.ts +4545 -0
  161. package/packages/mailx-send/mailsend/node_modules/@types/node/dgram.d.ts +600 -0
  162. package/packages/mailx-send/mailsend/node_modules/@types/node/diagnostics_channel.d.ts +578 -0
  163. package/packages/mailx-send/mailsend/node_modules/@types/node/dns/promises.d.ts +503 -0
  164. package/packages/mailx-send/mailsend/node_modules/@types/node/dns.d.ts +923 -0
  165. package/packages/mailx-send/mailsend/node_modules/@types/node/domain.d.ts +170 -0
  166. package/packages/mailx-send/mailsend/node_modules/@types/node/events.d.ts +976 -0
  167. package/packages/mailx-send/mailsend/node_modules/@types/node/fs/promises.d.ts +1295 -0
  168. package/packages/mailx-send/mailsend/node_modules/@types/node/fs.d.ts +4461 -0
  169. package/packages/mailx-send/mailsend/node_modules/@types/node/globals.d.ts +172 -0
  170. package/packages/mailx-send/mailsend/node_modules/@types/node/globals.typedarray.d.ts +38 -0
  171. package/packages/mailx-send/mailsend/node_modules/@types/node/http.d.ts +2089 -0
  172. package/packages/mailx-send/mailsend/node_modules/@types/node/http2.d.ts +2644 -0
  173. package/packages/mailx-send/mailsend/node_modules/@types/node/https.d.ts +579 -0
  174. package/packages/mailx-send/mailsend/node_modules/@types/node/index.d.ts +97 -0
  175. package/packages/mailx-send/mailsend/node_modules/@types/node/inspector.d.ts +253 -0
  176. package/packages/mailx-send/mailsend/node_modules/@types/node/inspector.generated.d.ts +4052 -0
  177. package/packages/mailx-send/mailsend/node_modules/@types/node/module.d.ts +891 -0
  178. package/packages/mailx-send/mailsend/node_modules/@types/node/net.d.ts +1057 -0
  179. package/packages/mailx-send/mailsend/node_modules/@types/node/os.d.ts +506 -0
  180. package/packages/mailx-send/mailsend/node_modules/@types/node/package.json +145 -0
  181. package/packages/mailx-send/mailsend/node_modules/@types/node/path.d.ts +200 -0
  182. package/packages/mailx-send/mailsend/node_modules/@types/node/perf_hooks.d.ts +968 -0
  183. package/packages/mailx-send/mailsend/node_modules/@types/node/process.d.ts +2084 -0
  184. package/packages/mailx-send/mailsend/node_modules/@types/node/punycode.d.ts +117 -0
  185. package/packages/mailx-send/mailsend/node_modules/@types/node/querystring.d.ts +152 -0
  186. package/packages/mailx-send/mailsend/node_modules/@types/node/readline/promises.d.ts +161 -0
  187. package/packages/mailx-send/mailsend/node_modules/@types/node/readline.d.ts +594 -0
  188. package/packages/mailx-send/mailsend/node_modules/@types/node/repl.d.ts +428 -0
  189. package/packages/mailx-send/mailsend/node_modules/@types/node/sea.d.ts +153 -0
  190. package/packages/mailx-send/mailsend/node_modules/@types/node/sqlite.d.ts +721 -0
  191. package/packages/mailx-send/mailsend/node_modules/@types/node/stream/consumers.d.ts +38 -0
  192. package/packages/mailx-send/mailsend/node_modules/@types/node/stream/promises.d.ts +90 -0
  193. package/packages/mailx-send/mailsend/node_modules/@types/node/stream/web.d.ts +622 -0
  194. package/packages/mailx-send/mailsend/node_modules/@types/node/stream.d.ts +1664 -0
  195. package/packages/mailx-send/mailsend/node_modules/@types/node/string_decoder.d.ts +67 -0
  196. package/packages/mailx-send/mailsend/node_modules/@types/node/test.d.ts +2163 -0
  197. package/packages/mailx-send/mailsend/node_modules/@types/node/timers/promises.d.ts +108 -0
  198. package/packages/mailx-send/mailsend/node_modules/@types/node/timers.d.ts +287 -0
  199. package/packages/mailx-send/mailsend/node_modules/@types/node/tls.d.ts +1319 -0
  200. package/packages/mailx-send/mailsend/node_modules/@types/node/trace_events.d.ts +197 -0
  201. package/packages/mailx-send/mailsend/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +468 -0
  202. package/packages/mailx-send/mailsend/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +34 -0
  203. package/packages/mailx-send/mailsend/node_modules/@types/node/ts5.6/index.d.ts +97 -0
  204. package/packages/mailx-send/mailsend/node_modules/@types/node/tty.d.ts +208 -0
  205. package/packages/mailx-send/mailsend/node_modules/@types/node/url.d.ts +984 -0
  206. package/packages/mailx-send/mailsend/node_modules/@types/node/util.d.ts +2606 -0
  207. package/packages/mailx-send/mailsend/node_modules/@types/node/v8.d.ts +920 -0
  208. package/packages/mailx-send/mailsend/node_modules/@types/node/vm.d.ts +1000 -0
  209. package/packages/mailx-send/mailsend/node_modules/@types/node/wasi.d.ts +181 -0
  210. package/packages/mailx-send/mailsend/node_modules/@types/node/web-globals/abortcontroller.d.ts +34 -0
  211. package/packages/mailx-send/mailsend/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
  212. package/packages/mailx-send/mailsend/node_modules/@types/node/web-globals/events.d.ts +97 -0
  213. package/packages/mailx-send/mailsend/node_modules/@types/node/web-globals/fetch.d.ts +55 -0
  214. package/packages/mailx-send/mailsend/node_modules/@types/node/web-globals/navigator.d.ts +22 -0
  215. package/packages/mailx-send/mailsend/node_modules/@types/node/web-globals/storage.d.ts +24 -0
  216. package/packages/mailx-send/mailsend/node_modules/@types/node/worker_threads.d.ts +784 -0
  217. package/packages/mailx-send/mailsend/node_modules/@types/node/zlib.d.ts +747 -0
  218. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/LICENSE +21 -0
  219. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/README.md +15 -0
  220. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/index.d.ts +82 -0
  221. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/addressparser/index.d.ts +31 -0
  222. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/base64/index.d.ts +22 -0
  223. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/dkim/index.d.ts +45 -0
  224. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/dkim/message-parser.d.ts +75 -0
  225. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/dkim/relaxed-body.d.ts +75 -0
  226. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/dkim/sign.d.ts +21 -0
  227. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/fetch/cookies.d.ts +54 -0
  228. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/fetch/index.d.ts +38 -0
  229. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/json-transport/index.d.ts +53 -0
  230. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/mail-composer/index.d.ts +25 -0
  231. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/mailer/index.d.ts +283 -0
  232. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/mailer/mail-message.d.ts +32 -0
  233. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/mime-funcs/index.d.ts +87 -0
  234. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/mime-funcs/mime-types.d.ts +2 -0
  235. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/mime-node/index.d.ts +224 -0
  236. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/mime-node/last-newline.d.ts +9 -0
  237. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/qp/index.d.ts +23 -0
  238. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/sendmail-transport/index.d.ts +53 -0
  239. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/sendmail-transport/le-unix.d.ts +7 -0
  240. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/sendmail-transport/le-windows.d.ts +7 -0
  241. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/ses-transport/index.d.ts +146 -0
  242. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/shared/index.d.ts +58 -0
  243. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/smtp-connection/data-stream.d.ts +11 -0
  244. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/smtp-connection/http-proxy-client.d.ts +16 -0
  245. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/smtp-connection/index.d.ts +270 -0
  246. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/smtp-pool/index.d.ts +93 -0
  247. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/smtp-pool/pool-resource.d.ts +66 -0
  248. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/smtp-transport/index.d.ts +115 -0
  249. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/stream-transport/index.d.ts +59 -0
  250. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/well-known/index.d.ts +6 -0
  251. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/xoauth2/index.d.ts +114 -0
  252. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/package.json +38 -0
  253. package/packages/mailx-send/mailsend/node_modules/nodemailer/.ncurc.js +9 -0
  254. package/packages/mailx-send/mailsend/node_modules/nodemailer/.prettierignore +8 -0
  255. package/packages/mailx-send/mailsend/node_modules/nodemailer/.prettierrc +12 -0
  256. package/packages/mailx-send/mailsend/node_modules/nodemailer/.prettierrc.js +10 -0
  257. package/packages/mailx-send/mailsend/node_modules/nodemailer/.release-please-config.json +9 -0
  258. package/packages/mailx-send/mailsend/node_modules/nodemailer/LICENSE +16 -0
  259. package/packages/mailx-send/mailsend/node_modules/nodemailer/README.md +86 -0
  260. package/packages/mailx-send/mailsend/node_modules/nodemailer/SECURITY.txt +22 -0
  261. package/packages/mailx-send/mailsend/node_modules/nodemailer/eslint.config.js +88 -0
  262. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/addressparser/index.js +383 -0
  263. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/base64/index.js +139 -0
  264. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/dkim/index.js +253 -0
  265. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/dkim/message-parser.js +155 -0
  266. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/dkim/relaxed-body.js +154 -0
  267. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/dkim/sign.js +117 -0
  268. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/fetch/cookies.js +281 -0
  269. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/fetch/index.js +280 -0
  270. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/json-transport/index.js +82 -0
  271. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mail-composer/index.js +629 -0
  272. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mailer/index.js +441 -0
  273. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mailer/mail-message.js +316 -0
  274. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mime-funcs/index.js +625 -0
  275. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mime-funcs/mime-types.js +2113 -0
  276. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mime-node/index.js +1316 -0
  277. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mime-node/last-newline.js +33 -0
  278. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mime-node/le-unix.js +43 -0
  279. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mime-node/le-windows.js +52 -0
  280. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/nodemailer.js +157 -0
  281. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/punycode/index.js +460 -0
  282. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/qp/index.js +227 -0
  283. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/sendmail-transport/index.js +210 -0
  284. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/ses-transport/index.js +234 -0
  285. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/shared/index.js +754 -0
  286. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/smtp-connection/data-stream.js +108 -0
  287. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/smtp-connection/http-proxy-client.js +143 -0
  288. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/smtp-connection/index.js +1870 -0
  289. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/smtp-pool/index.js +652 -0
  290. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/smtp-pool/pool-resource.js +259 -0
  291. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/smtp-transport/index.js +421 -0
  292. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/stream-transport/index.js +135 -0
  293. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/well-known/index.js +47 -0
  294. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/well-known/services.json +611 -0
  295. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/xoauth2/index.js +427 -0
  296. package/packages/mailx-send/mailsend/node_modules/nodemailer/package.json +47 -0
  297. package/packages/mailx-send/mailsend/node_modules/undici-types/LICENSE +21 -0
  298. package/packages/mailx-send/mailsend/node_modules/undici-types/README.md +6 -0
  299. package/packages/mailx-send/mailsend/node_modules/undici-types/agent.d.ts +31 -0
  300. package/packages/mailx-send/mailsend/node_modules/undici-types/api.d.ts +43 -0
  301. package/packages/mailx-send/mailsend/node_modules/undici-types/balanced-pool.d.ts +29 -0
  302. package/packages/mailx-send/mailsend/node_modules/undici-types/cache.d.ts +36 -0
  303. package/packages/mailx-send/mailsend/node_modules/undici-types/client.d.ts +108 -0
  304. package/packages/mailx-send/mailsend/node_modules/undici-types/connector.d.ts +34 -0
  305. package/packages/mailx-send/mailsend/node_modules/undici-types/content-type.d.ts +21 -0
  306. package/packages/mailx-send/mailsend/node_modules/undici-types/cookies.d.ts +28 -0
  307. package/packages/mailx-send/mailsend/node_modules/undici-types/diagnostics-channel.d.ts +66 -0
  308. package/packages/mailx-send/mailsend/node_modules/undici-types/dispatcher.d.ts +256 -0
  309. package/packages/mailx-send/mailsend/node_modules/undici-types/env-http-proxy-agent.d.ts +21 -0
  310. package/packages/mailx-send/mailsend/node_modules/undici-types/errors.d.ts +149 -0
  311. package/packages/mailx-send/mailsend/node_modules/undici-types/eventsource.d.ts +61 -0
  312. package/packages/mailx-send/mailsend/node_modules/undici-types/fetch.d.ts +209 -0
  313. package/packages/mailx-send/mailsend/node_modules/undici-types/file.d.ts +39 -0
  314. package/packages/mailx-send/mailsend/node_modules/undici-types/filereader.d.ts +54 -0
  315. package/packages/mailx-send/mailsend/node_modules/undici-types/formdata.d.ts +108 -0
  316. package/packages/mailx-send/mailsend/node_modules/undici-types/global-dispatcher.d.ts +9 -0
  317. package/packages/mailx-send/mailsend/node_modules/undici-types/global-origin.d.ts +7 -0
  318. package/packages/mailx-send/mailsend/node_modules/undici-types/handlers.d.ts +15 -0
  319. package/packages/mailx-send/mailsend/node_modules/undici-types/header.d.ts +4 -0
  320. package/packages/mailx-send/mailsend/node_modules/undici-types/index.d.ts +71 -0
  321. package/packages/mailx-send/mailsend/node_modules/undici-types/interceptors.d.ts +17 -0
  322. package/packages/mailx-send/mailsend/node_modules/undici-types/mock-agent.d.ts +50 -0
  323. package/packages/mailx-send/mailsend/node_modules/undici-types/mock-client.d.ts +25 -0
  324. package/packages/mailx-send/mailsend/node_modules/undici-types/mock-errors.d.ts +12 -0
  325. package/packages/mailx-send/mailsend/node_modules/undici-types/mock-interceptor.d.ts +93 -0
  326. package/packages/mailx-send/mailsend/node_modules/undici-types/mock-pool.d.ts +25 -0
  327. package/packages/mailx-send/mailsend/node_modules/undici-types/package.json +55 -0
  328. package/packages/mailx-send/mailsend/node_modules/undici-types/patch.d.ts +33 -0
  329. package/packages/mailx-send/mailsend/node_modules/undici-types/pool-stats.d.ts +19 -0
  330. package/packages/mailx-send/mailsend/node_modules/undici-types/pool.d.ts +39 -0
  331. package/packages/mailx-send/mailsend/node_modules/undici-types/proxy-agent.d.ts +28 -0
  332. package/packages/mailx-send/mailsend/node_modules/undici-types/readable.d.ts +65 -0
  333. package/packages/mailx-send/mailsend/node_modules/undici-types/retry-agent.d.ts +8 -0
  334. package/packages/mailx-send/mailsend/node_modules/undici-types/retry-handler.d.ts +116 -0
  335. package/packages/mailx-send/mailsend/node_modules/undici-types/util.d.ts +18 -0
  336. package/packages/mailx-send/mailsend/node_modules/undici-types/webidl.d.ts +228 -0
  337. package/packages/mailx-send/mailsend/node_modules/undici-types/websocket.d.ts +150 -0
  338. package/packages/mailx-send/mailsend/package.json +26 -0
  339. package/packages/mailx-send/node_modules/.package-lock.json +49 -0
  340. package/packages/mailx-send/node_modules/@types/node/LICENSE +21 -0
  341. package/packages/mailx-send/node_modules/@types/node/README.md +15 -0
  342. package/packages/mailx-send/node_modules/@types/node/assert/strict.d.ts +111 -0
  343. package/packages/mailx-send/node_modules/@types/node/assert.d.ts +1078 -0
  344. package/packages/mailx-send/node_modules/@types/node/async_hooks.d.ts +603 -0
  345. package/packages/mailx-send/node_modules/@types/node/buffer.buffer.d.ts +472 -0
  346. package/packages/mailx-send/node_modules/@types/node/buffer.d.ts +1934 -0
  347. package/packages/mailx-send/node_modules/@types/node/child_process.d.ts +1476 -0
  348. package/packages/mailx-send/node_modules/@types/node/cluster.d.ts +578 -0
  349. package/packages/mailx-send/node_modules/@types/node/compatibility/disposable.d.ts +14 -0
  350. package/packages/mailx-send/node_modules/@types/node/compatibility/index.d.ts +9 -0
  351. package/packages/mailx-send/node_modules/@types/node/compatibility/indexable.d.ts +20 -0
  352. package/packages/mailx-send/node_modules/@types/node/compatibility/iterators.d.ts +20 -0
  353. package/packages/mailx-send/node_modules/@types/node/console.d.ts +452 -0
  354. package/packages/mailx-send/node_modules/@types/node/constants.d.ts +21 -0
  355. package/packages/mailx-send/node_modules/@types/node/crypto.d.ts +4545 -0
  356. package/packages/mailx-send/node_modules/@types/node/dgram.d.ts +600 -0
  357. package/packages/mailx-send/node_modules/@types/node/diagnostics_channel.d.ts +578 -0
  358. package/packages/mailx-send/node_modules/@types/node/dns/promises.d.ts +503 -0
  359. package/packages/mailx-send/node_modules/@types/node/dns.d.ts +923 -0
  360. package/packages/mailx-send/node_modules/@types/node/domain.d.ts +170 -0
  361. package/packages/mailx-send/node_modules/@types/node/events.d.ts +976 -0
  362. package/packages/mailx-send/node_modules/@types/node/fs/promises.d.ts +1295 -0
  363. package/packages/mailx-send/node_modules/@types/node/fs.d.ts +4461 -0
  364. package/packages/mailx-send/node_modules/@types/node/globals.d.ts +172 -0
  365. package/packages/mailx-send/node_modules/@types/node/globals.typedarray.d.ts +38 -0
  366. package/packages/mailx-send/node_modules/@types/node/http.d.ts +2089 -0
  367. package/packages/mailx-send/node_modules/@types/node/http2.d.ts +2644 -0
  368. package/packages/mailx-send/node_modules/@types/node/https.d.ts +579 -0
  369. package/packages/mailx-send/node_modules/@types/node/index.d.ts +97 -0
  370. package/packages/mailx-send/node_modules/@types/node/inspector.d.ts +253 -0
  371. package/packages/mailx-send/node_modules/@types/node/inspector.generated.d.ts +4052 -0
  372. package/packages/mailx-send/node_modules/@types/node/module.d.ts +891 -0
  373. package/packages/mailx-send/node_modules/@types/node/net.d.ts +1057 -0
  374. package/packages/mailx-send/node_modules/@types/node/os.d.ts +506 -0
  375. package/packages/mailx-send/node_modules/@types/node/package.json +145 -0
  376. package/packages/mailx-send/node_modules/@types/node/path.d.ts +200 -0
  377. package/packages/mailx-send/node_modules/@types/node/perf_hooks.d.ts +968 -0
  378. package/packages/mailx-send/node_modules/@types/node/process.d.ts +2084 -0
  379. package/packages/mailx-send/node_modules/@types/node/punycode.d.ts +117 -0
  380. package/packages/mailx-send/node_modules/@types/node/querystring.d.ts +152 -0
  381. package/packages/mailx-send/node_modules/@types/node/readline/promises.d.ts +161 -0
  382. package/packages/mailx-send/node_modules/@types/node/readline.d.ts +594 -0
  383. package/packages/mailx-send/node_modules/@types/node/repl.d.ts +428 -0
  384. package/packages/mailx-send/node_modules/@types/node/sea.d.ts +153 -0
  385. package/packages/mailx-send/node_modules/@types/node/sqlite.d.ts +721 -0
  386. package/packages/mailx-send/node_modules/@types/node/stream/consumers.d.ts +38 -0
  387. package/packages/mailx-send/node_modules/@types/node/stream/promises.d.ts +90 -0
  388. package/packages/mailx-send/node_modules/@types/node/stream/web.d.ts +622 -0
  389. package/packages/mailx-send/node_modules/@types/node/stream.d.ts +1664 -0
  390. package/packages/mailx-send/node_modules/@types/node/string_decoder.d.ts +67 -0
  391. package/packages/mailx-send/node_modules/@types/node/test.d.ts +2163 -0
  392. package/packages/mailx-send/node_modules/@types/node/timers/promises.d.ts +108 -0
  393. package/packages/mailx-send/node_modules/@types/node/timers.d.ts +287 -0
  394. package/packages/mailx-send/node_modules/@types/node/tls.d.ts +1319 -0
  395. package/packages/mailx-send/node_modules/@types/node/trace_events.d.ts +197 -0
  396. package/packages/mailx-send/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +468 -0
  397. package/packages/mailx-send/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +34 -0
  398. package/packages/mailx-send/node_modules/@types/node/ts5.6/index.d.ts +97 -0
  399. package/packages/mailx-send/node_modules/@types/node/tty.d.ts +208 -0
  400. package/packages/mailx-send/node_modules/@types/node/url.d.ts +984 -0
  401. package/packages/mailx-send/node_modules/@types/node/util.d.ts +2606 -0
  402. package/packages/mailx-send/node_modules/@types/node/v8.d.ts +920 -0
  403. package/packages/mailx-send/node_modules/@types/node/vm.d.ts +1000 -0
  404. package/packages/mailx-send/node_modules/@types/node/wasi.d.ts +181 -0
  405. package/packages/mailx-send/node_modules/@types/node/web-globals/abortcontroller.d.ts +34 -0
  406. package/packages/mailx-send/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
  407. package/packages/mailx-send/node_modules/@types/node/web-globals/events.d.ts +97 -0
  408. package/packages/mailx-send/node_modules/@types/node/web-globals/fetch.d.ts +55 -0
  409. package/packages/mailx-send/node_modules/@types/node/web-globals/navigator.d.ts +22 -0
  410. package/packages/mailx-send/node_modules/@types/node/web-globals/storage.d.ts +24 -0
  411. package/packages/mailx-send/node_modules/@types/node/worker_threads.d.ts +784 -0
  412. package/packages/mailx-send/node_modules/@types/node/zlib.d.ts +747 -0
  413. package/packages/mailx-send/node_modules/nodemailer/.ncurc.js +9 -0
  414. package/packages/mailx-send/node_modules/nodemailer/.prettierignore +8 -0
  415. package/packages/mailx-send/node_modules/nodemailer/.prettierrc +12 -0
  416. package/packages/mailx-send/node_modules/nodemailer/.prettierrc.js +10 -0
  417. package/packages/mailx-send/node_modules/nodemailer/.release-please-config.json +9 -0
  418. package/packages/mailx-send/node_modules/nodemailer/LICENSE +16 -0
  419. package/packages/mailx-send/node_modules/nodemailer/README.md +86 -0
  420. package/packages/mailx-send/node_modules/nodemailer/SECURITY.txt +22 -0
  421. package/packages/mailx-send/node_modules/nodemailer/eslint.config.js +88 -0
  422. package/packages/mailx-send/node_modules/nodemailer/lib/addressparser/index.js +383 -0
  423. package/packages/mailx-send/node_modules/nodemailer/lib/base64/index.js +139 -0
  424. package/packages/mailx-send/node_modules/nodemailer/lib/dkim/index.js +253 -0
  425. package/packages/mailx-send/node_modules/nodemailer/lib/dkim/message-parser.js +155 -0
  426. package/packages/mailx-send/node_modules/nodemailer/lib/dkim/relaxed-body.js +154 -0
  427. package/packages/mailx-send/node_modules/nodemailer/lib/dkim/sign.js +117 -0
  428. package/packages/mailx-send/node_modules/nodemailer/lib/fetch/cookies.js +281 -0
  429. package/packages/mailx-send/node_modules/nodemailer/lib/fetch/index.js +280 -0
  430. package/packages/mailx-send/node_modules/nodemailer/lib/json-transport/index.js +82 -0
  431. package/packages/mailx-send/node_modules/nodemailer/lib/mail-composer/index.js +629 -0
  432. package/packages/mailx-send/node_modules/nodemailer/lib/mailer/index.js +441 -0
  433. package/packages/mailx-send/node_modules/nodemailer/lib/mailer/mail-message.js +316 -0
  434. package/packages/mailx-send/node_modules/nodemailer/lib/mime-funcs/index.js +625 -0
  435. package/packages/mailx-send/node_modules/nodemailer/lib/mime-funcs/mime-types.js +2113 -0
  436. package/packages/mailx-send/node_modules/nodemailer/lib/mime-node/index.js +1316 -0
  437. package/packages/mailx-send/node_modules/nodemailer/lib/mime-node/last-newline.js +33 -0
  438. package/packages/mailx-send/node_modules/nodemailer/lib/mime-node/le-unix.js +43 -0
  439. package/packages/mailx-send/node_modules/nodemailer/lib/mime-node/le-windows.js +52 -0
  440. package/packages/mailx-send/node_modules/nodemailer/lib/nodemailer.js +157 -0
  441. package/packages/mailx-send/node_modules/nodemailer/lib/punycode/index.js +460 -0
  442. package/packages/mailx-send/node_modules/nodemailer/lib/qp/index.js +227 -0
  443. package/packages/mailx-send/node_modules/nodemailer/lib/sendmail-transport/index.js +210 -0
  444. package/packages/mailx-send/node_modules/nodemailer/lib/ses-transport/index.js +234 -0
  445. package/packages/mailx-send/node_modules/nodemailer/lib/shared/index.js +754 -0
  446. package/packages/mailx-send/node_modules/nodemailer/lib/smtp-connection/data-stream.js +108 -0
  447. package/packages/mailx-send/node_modules/nodemailer/lib/smtp-connection/http-proxy-client.js +143 -0
  448. package/packages/mailx-send/node_modules/nodemailer/lib/smtp-connection/index.js +1870 -0
  449. package/packages/mailx-send/node_modules/nodemailer/lib/smtp-pool/index.js +652 -0
  450. package/packages/mailx-send/node_modules/nodemailer/lib/smtp-pool/pool-resource.js +259 -0
  451. package/packages/mailx-send/node_modules/nodemailer/lib/smtp-transport/index.js +421 -0
  452. package/packages/mailx-send/node_modules/nodemailer/lib/stream-transport/index.js +135 -0
  453. package/packages/mailx-send/node_modules/nodemailer/lib/well-known/index.js +47 -0
  454. package/packages/mailx-send/node_modules/nodemailer/lib/well-known/services.json +611 -0
  455. package/packages/mailx-send/node_modules/nodemailer/lib/xoauth2/index.js +427 -0
  456. package/packages/mailx-send/node_modules/nodemailer/package.json +47 -0
  457. package/packages/mailx-send/node_modules/undici-types/LICENSE +21 -0
  458. package/packages/mailx-send/node_modules/undici-types/README.md +6 -0
  459. package/packages/mailx-send/node_modules/undici-types/agent.d.ts +31 -0
  460. package/packages/mailx-send/node_modules/undici-types/api.d.ts +43 -0
  461. package/packages/mailx-send/node_modules/undici-types/balanced-pool.d.ts +29 -0
  462. package/packages/mailx-send/node_modules/undici-types/cache.d.ts +36 -0
  463. package/packages/mailx-send/node_modules/undici-types/client.d.ts +108 -0
  464. package/packages/mailx-send/node_modules/undici-types/connector.d.ts +34 -0
  465. package/packages/mailx-send/node_modules/undici-types/content-type.d.ts +21 -0
  466. package/packages/mailx-send/node_modules/undici-types/cookies.d.ts +28 -0
  467. package/packages/mailx-send/node_modules/undici-types/diagnostics-channel.d.ts +66 -0
  468. package/packages/mailx-send/node_modules/undici-types/dispatcher.d.ts +256 -0
  469. package/packages/mailx-send/node_modules/undici-types/env-http-proxy-agent.d.ts +21 -0
  470. package/packages/mailx-send/node_modules/undici-types/errors.d.ts +149 -0
  471. package/packages/mailx-send/node_modules/undici-types/eventsource.d.ts +61 -0
  472. package/packages/mailx-send/node_modules/undici-types/fetch.d.ts +209 -0
  473. package/packages/mailx-send/node_modules/undici-types/file.d.ts +39 -0
  474. package/packages/mailx-send/node_modules/undici-types/filereader.d.ts +54 -0
  475. package/packages/mailx-send/node_modules/undici-types/formdata.d.ts +108 -0
  476. package/packages/mailx-send/node_modules/undici-types/global-dispatcher.d.ts +9 -0
  477. package/packages/mailx-send/node_modules/undici-types/global-origin.d.ts +7 -0
  478. package/packages/mailx-send/node_modules/undici-types/handlers.d.ts +15 -0
  479. package/packages/mailx-send/node_modules/undici-types/header.d.ts +4 -0
  480. package/packages/mailx-send/node_modules/undici-types/index.d.ts +71 -0
  481. package/packages/mailx-send/node_modules/undici-types/interceptors.d.ts +17 -0
  482. package/packages/mailx-send/node_modules/undici-types/mock-agent.d.ts +50 -0
  483. package/packages/mailx-send/node_modules/undici-types/mock-client.d.ts +25 -0
  484. package/packages/mailx-send/node_modules/undici-types/mock-errors.d.ts +12 -0
  485. package/packages/mailx-send/node_modules/undici-types/mock-interceptor.d.ts +93 -0
  486. package/packages/mailx-send/node_modules/undici-types/mock-pool.d.ts +25 -0
  487. package/packages/mailx-send/node_modules/undici-types/package.json +55 -0
  488. package/packages/mailx-send/node_modules/undici-types/patch.d.ts +33 -0
  489. package/packages/mailx-send/node_modules/undici-types/pool-stats.d.ts +19 -0
  490. package/packages/mailx-send/node_modules/undici-types/pool.d.ts +39 -0
  491. package/packages/mailx-send/node_modules/undici-types/proxy-agent.d.ts +28 -0
  492. package/packages/mailx-send/node_modules/undici-types/readable.d.ts +65 -0
  493. package/packages/mailx-send/node_modules/undici-types/retry-agent.d.ts +8 -0
  494. package/packages/mailx-send/node_modules/undici-types/retry-handler.d.ts +116 -0
  495. package/packages/mailx-send/node_modules/undici-types/util.d.ts +18 -0
  496. package/packages/mailx-send/node_modules/undici-types/webidl.d.ts +228 -0
  497. package/packages/mailx-send/node_modules/undici-types/websocket.d.ts +150 -0
  498. package/packages/mailx-send/package.json +27 -0
  499. package/packages/mailx-server/index.d.ts +8 -0
  500. package/packages/mailx-server/index.js +217 -0
  501. package/packages/mailx-server/package.json +25 -0
  502. package/packages/mailx-server/tsconfig.tsbuildinfo +1 -0
  503. package/packages/mailx-settings/index.d.ts +64 -0
  504. package/packages/mailx-settings/index.js +218 -0
  505. package/packages/mailx-settings/package.json +16 -0
  506. package/packages/mailx-settings/tsconfig.tsbuildinfo +1 -0
  507. package/packages/mailx-store/db.d.ts +100 -0
  508. package/packages/mailx-store/db.js +461 -0
  509. package/packages/mailx-store/file-store.d.ts +22 -0
  510. package/packages/mailx-store/file-store.js +59 -0
  511. package/packages/mailx-store/index.d.ts +7 -0
  512. package/packages/mailx-store/index.js +7 -0
  513. package/packages/mailx-store/package.json +19 -0
  514. package/packages/mailx-store/tsconfig.tsbuildinfo +1 -0
  515. package/packages/mailx-types/index.d.ts +195 -0
  516. package/packages/mailx-types/index.js +7 -0
  517. package/packages/mailx-types/package.json +12 -0
  518. package/packages/mailx-types/tsconfig.tsbuildinfo +1 -0
  519. package/tsconfig.base.json +28 -0
@@ -0,0 +1,253 @@
1
+ 'use strict';
2
+
3
+ // FIXME:
4
+ // replace this Transform mess with a method that pipes input argument to output argument
5
+
6
+ const MessageParser = require('./message-parser');
7
+ const RelaxedBody = require('./relaxed-body');
8
+ const sign = require('./sign');
9
+ const PassThrough = require('stream').PassThrough;
10
+ const fs = require('fs');
11
+ const path = require('path');
12
+ const crypto = require('crypto');
13
+
14
+ const DKIM_ALGO = 'sha256';
15
+ const MAX_MESSAGE_SIZE = 2 * 1024 * 1024; // buffer messages larger than this to disk
16
+
17
+ /*
18
+ // Usage:
19
+
20
+ let dkim = new DKIM({
21
+ domainName: 'example.com',
22
+ keySelector: 'key-selector',
23
+ privateKey,
24
+ cacheDir: '/tmp'
25
+ });
26
+ dkim.sign(input).pipe(process.stdout);
27
+
28
+ // Where inputStream is a rfc822 message (either a stream, string or Buffer)
29
+ // and outputStream is a DKIM signed rfc822 message
30
+ */
31
+
32
+ class DKIMSigner {
33
+ constructor(options, keys, input, output) {
34
+ this.options = options || {};
35
+ this.keys = keys;
36
+
37
+ this.cacheTreshold = Number(this.options.cacheTreshold) || MAX_MESSAGE_SIZE;
38
+ this.hashAlgo = this.options.hashAlgo || DKIM_ALGO;
39
+
40
+ this.cacheDir = this.options.cacheDir || false;
41
+
42
+ this.chunks = [];
43
+ this.chunklen = 0;
44
+ this.readPos = 0;
45
+ this.cachePath = this.cacheDir
46
+ ? path.join(this.cacheDir, 'message.' + Date.now() + '-' + crypto.randomBytes(14).toString('hex'))
47
+ : false;
48
+ this.cache = false;
49
+
50
+ this.headers = false;
51
+ this.bodyHash = false;
52
+ this.parser = false;
53
+ this.relaxedBody = false;
54
+
55
+ this.input = input;
56
+ this.output = output;
57
+ this.output.usingCache = false;
58
+
59
+ this.hasErrored = false;
60
+
61
+ this.input.on('error', err => {
62
+ this.hasErrored = true;
63
+ this.cleanup();
64
+ output.emit('error', err);
65
+ });
66
+ }
67
+
68
+ cleanup() {
69
+ if (!this.cache || !this.cachePath) {
70
+ return;
71
+ }
72
+ fs.unlink(this.cachePath, () => false);
73
+ }
74
+
75
+ createReadCache() {
76
+ // pipe remainings to cache file
77
+ this.cache = fs.createReadStream(this.cachePath);
78
+ this.cache.once('error', err => {
79
+ this.cleanup();
80
+ this.output.emit('error', err);
81
+ });
82
+ this.cache.once('close', () => {
83
+ this.cleanup();
84
+ });
85
+ this.cache.pipe(this.output);
86
+ }
87
+
88
+ sendNextChunk() {
89
+ if (this.hasErrored) {
90
+ return;
91
+ }
92
+
93
+ if (this.readPos >= this.chunks.length) {
94
+ if (!this.cache) {
95
+ return this.output.end();
96
+ }
97
+ return this.createReadCache();
98
+ }
99
+ let chunk = this.chunks[this.readPos++];
100
+ if (this.output.write(chunk) === false) {
101
+ return this.output.once('drain', () => {
102
+ this.sendNextChunk();
103
+ });
104
+ }
105
+ setImmediate(() => this.sendNextChunk());
106
+ }
107
+
108
+ sendSignedOutput() {
109
+ let keyPos = 0;
110
+ let signNextKey = () => {
111
+ if (keyPos >= this.keys.length) {
112
+ this.output.write(this.parser.rawHeaders);
113
+ return setImmediate(() => this.sendNextChunk());
114
+ }
115
+ let key = this.keys[keyPos++];
116
+ let dkimField = sign(this.headers, this.hashAlgo, this.bodyHash, {
117
+ domainName: key.domainName,
118
+ keySelector: key.keySelector,
119
+ privateKey: key.privateKey,
120
+ headerFieldNames: this.options.headerFieldNames,
121
+ skipFields: this.options.skipFields
122
+ });
123
+ if (dkimField) {
124
+ this.output.write(Buffer.from(dkimField + '\r\n'));
125
+ }
126
+ return setImmediate(signNextKey);
127
+ };
128
+
129
+ if (this.bodyHash && this.headers) {
130
+ return signNextKey();
131
+ }
132
+
133
+ this.output.write(this.parser.rawHeaders);
134
+ this.sendNextChunk();
135
+ }
136
+
137
+ createWriteCache() {
138
+ this.output.usingCache = true;
139
+ // pipe remainings to cache file
140
+ this.cache = fs.createWriteStream(this.cachePath);
141
+ this.cache.once('error', err => {
142
+ this.cleanup();
143
+ // drain input
144
+ this.relaxedBody.unpipe(this.cache);
145
+ this.relaxedBody.on('readable', () => {
146
+ while (this.relaxedBody.read() !== null) {
147
+ // do nothing
148
+ }
149
+ });
150
+ this.hasErrored = true;
151
+ // emit error
152
+ this.output.emit('error', err);
153
+ });
154
+ this.cache.once('close', () => {
155
+ this.sendSignedOutput();
156
+ });
157
+ this.relaxedBody.removeAllListeners('readable');
158
+ this.relaxedBody.pipe(this.cache);
159
+ }
160
+
161
+ signStream() {
162
+ this.parser = new MessageParser();
163
+ this.relaxedBody = new RelaxedBody({
164
+ hashAlgo: this.hashAlgo
165
+ });
166
+
167
+ this.parser.on('headers', value => {
168
+ this.headers = value;
169
+ });
170
+
171
+ this.relaxedBody.on('hash', value => {
172
+ this.bodyHash = value;
173
+ });
174
+
175
+ this.relaxedBody.on('readable', () => {
176
+ let chunk;
177
+ if (this.cache) {
178
+ return;
179
+ }
180
+ while ((chunk = this.relaxedBody.read()) !== null) {
181
+ this.chunks.push(chunk);
182
+ this.chunklen += chunk.length;
183
+ if (this.chunklen >= this.cacheTreshold && this.cachePath) {
184
+ return this.createWriteCache();
185
+ }
186
+ }
187
+ });
188
+
189
+ this.relaxedBody.on('end', () => {
190
+ if (this.cache) {
191
+ return;
192
+ }
193
+ this.sendSignedOutput();
194
+ });
195
+
196
+ this.parser.pipe(this.relaxedBody);
197
+ setImmediate(() => this.input.pipe(this.parser));
198
+ }
199
+ }
200
+
201
+ class DKIM {
202
+ constructor(options) {
203
+ this.options = options || {};
204
+ this.keys = [].concat(
205
+ this.options.keys || {
206
+ domainName: options.domainName,
207
+ keySelector: options.keySelector,
208
+ privateKey: options.privateKey
209
+ }
210
+ );
211
+ }
212
+
213
+ sign(input, extraOptions) {
214
+ let output = new PassThrough();
215
+ let inputStream = input;
216
+ let writeValue = false;
217
+
218
+ if (Buffer.isBuffer(input)) {
219
+ writeValue = input;
220
+ inputStream = new PassThrough();
221
+ } else if (typeof input === 'string') {
222
+ writeValue = Buffer.from(input);
223
+ inputStream = new PassThrough();
224
+ }
225
+
226
+ let options = this.options;
227
+ if (extraOptions && Object.keys(extraOptions).length) {
228
+ options = {};
229
+ Object.keys(this.options || {}).forEach(key => {
230
+ options[key] = this.options[key];
231
+ });
232
+ Object.keys(extraOptions || {}).forEach(key => {
233
+ if (!(key in options)) {
234
+ options[key] = extraOptions[key];
235
+ }
236
+ });
237
+ }
238
+
239
+ let signer = new DKIMSigner(options, this.keys, inputStream, output);
240
+ setImmediate(() => {
241
+ signer.signStream();
242
+ if (writeValue) {
243
+ setImmediate(() => {
244
+ inputStream.end(writeValue);
245
+ });
246
+ }
247
+ });
248
+
249
+ return output;
250
+ }
251
+ }
252
+
253
+ module.exports = DKIM;
@@ -0,0 +1,155 @@
1
+ 'use strict';
2
+
3
+ const Transform = require('stream').Transform;
4
+
5
+ /**
6
+ * MessageParser instance is a transform stream that separates message headers
7
+ * from the rest of the body. Headers are emitted with the 'headers' event. Message
8
+ * body is passed on as the resulting stream.
9
+ */
10
+ class MessageParser extends Transform {
11
+ constructor(options) {
12
+ super(options);
13
+ this.lastBytes = Buffer.alloc(4);
14
+ this.headersParsed = false;
15
+ this.headerBytes = 0;
16
+ this.headerChunks = [];
17
+ this.rawHeaders = false;
18
+ this.bodySize = 0;
19
+ }
20
+
21
+ /**
22
+ * Keeps count of the last 4 bytes in order to detect line breaks on chunk boundaries
23
+ *
24
+ * @param {Buffer} data Next data chunk from the stream
25
+ */
26
+ updateLastBytes(data) {
27
+ let lblen = this.lastBytes.length;
28
+ let nblen = Math.min(data.length, lblen);
29
+
30
+ // shift existing bytes
31
+ for (let i = 0, len = lblen - nblen; i < len; i++) {
32
+ this.lastBytes[i] = this.lastBytes[i + nblen];
33
+ }
34
+
35
+ // add new bytes
36
+ for (let i = 1; i <= nblen; i++) {
37
+ this.lastBytes[lblen - i] = data[data.length - i];
38
+ }
39
+ }
40
+
41
+ /**
42
+ * Finds and removes message headers from the remaining body. We want to keep
43
+ * headers separated until final delivery to be able to modify these
44
+ *
45
+ * @param {Buffer} data Next chunk of data
46
+ * @return {Boolean} Returns true if headers are already found or false otherwise
47
+ */
48
+ checkHeaders(data) {
49
+ if (this.headersParsed) {
50
+ return true;
51
+ }
52
+
53
+ let lblen = this.lastBytes.length;
54
+ let headerPos = 0;
55
+ this.curLinePos = 0;
56
+ for (let i = 0, len = this.lastBytes.length + data.length; i < len; i++) {
57
+ let chr;
58
+ if (i < lblen) {
59
+ chr = this.lastBytes[i];
60
+ } else {
61
+ chr = data[i - lblen];
62
+ }
63
+ if (chr === 0x0a && i) {
64
+ let pr1 = i - 1 < lblen ? this.lastBytes[i - 1] : data[i - 1 - lblen];
65
+ let pr2 = i > 1 ? (i - 2 < lblen ? this.lastBytes[i - 2] : data[i - 2 - lblen]) : false;
66
+ if (pr1 === 0x0a) {
67
+ this.headersParsed = true;
68
+ headerPos = i - lblen + 1;
69
+ this.headerBytes += headerPos;
70
+ break;
71
+ } else if (pr1 === 0x0d && pr2 === 0x0a) {
72
+ this.headersParsed = true;
73
+ headerPos = i - lblen + 1;
74
+ this.headerBytes += headerPos;
75
+ break;
76
+ }
77
+ }
78
+ }
79
+
80
+ if (this.headersParsed) {
81
+ this.headerChunks.push(data.slice(0, headerPos));
82
+ this.rawHeaders = Buffer.concat(this.headerChunks, this.headerBytes);
83
+ this.headerChunks = null;
84
+ this.emit('headers', this.parseHeaders());
85
+ if (data.length - 1 > headerPos) {
86
+ let chunk = data.slice(headerPos);
87
+ this.bodySize += chunk.length;
88
+ // this would be the first chunk of data sent downstream
89
+ setImmediate(() => this.push(chunk));
90
+ }
91
+ return false;
92
+ } else {
93
+ this.headerBytes += data.length;
94
+ this.headerChunks.push(data);
95
+ }
96
+
97
+ // store last 4 bytes to catch header break
98
+ this.updateLastBytes(data);
99
+
100
+ return false;
101
+ }
102
+
103
+ _transform(chunk, encoding, callback) {
104
+ if (!chunk || !chunk.length) {
105
+ return callback();
106
+ }
107
+
108
+ if (typeof chunk === 'string') {
109
+ chunk = Buffer.from(chunk, encoding);
110
+ }
111
+
112
+ let headersFound;
113
+
114
+ try {
115
+ headersFound = this.checkHeaders(chunk);
116
+ } catch (E) {
117
+ return callback(E);
118
+ }
119
+
120
+ if (headersFound) {
121
+ this.bodySize += chunk.length;
122
+ this.push(chunk);
123
+ }
124
+
125
+ setImmediate(callback);
126
+ }
127
+
128
+ _flush(callback) {
129
+ if (this.headerChunks) {
130
+ let chunk = Buffer.concat(this.headerChunks, this.headerBytes);
131
+ this.bodySize += chunk.length;
132
+ this.push(chunk);
133
+ this.headerChunks = null;
134
+ }
135
+ callback();
136
+ }
137
+
138
+ parseHeaders() {
139
+ let lines = (this.rawHeaders || '').toString().split(/\r?\n/);
140
+ for (let i = lines.length - 1; i > 0; i--) {
141
+ if (/^\s/.test(lines[i])) {
142
+ lines[i - 1] += '\n' + lines[i];
143
+ lines.splice(i, 1);
144
+ }
145
+ }
146
+ return lines
147
+ .filter(line => line.trim())
148
+ .map(line => ({
149
+ key: line.substr(0, line.indexOf(':')).trim().toLowerCase(),
150
+ line
151
+ }));
152
+ }
153
+ }
154
+
155
+ module.exports = MessageParser;
@@ -0,0 +1,154 @@
1
+ 'use strict';
2
+
3
+ // streams through a message body and calculates relaxed body hash
4
+
5
+ const Transform = require('stream').Transform;
6
+ const crypto = require('crypto');
7
+
8
+ class RelaxedBody extends Transform {
9
+ constructor(options) {
10
+ super();
11
+ options = options || {};
12
+ this.chunkBuffer = [];
13
+ this.chunkBufferLen = 0;
14
+ this.bodyHash = crypto.createHash(options.hashAlgo || 'sha1');
15
+ this.remainder = '';
16
+ this.byteLength = 0;
17
+
18
+ this.debug = options.debug;
19
+ this._debugBody = options.debug ? [] : false;
20
+ }
21
+
22
+ updateHash(chunk) {
23
+ let bodyStr;
24
+
25
+ // find next remainder
26
+ let nextRemainder = '';
27
+
28
+ // This crux finds and removes the spaces from the last line and the newline characters after the last non-empty line
29
+ // If we get another chunk that does not match this description then we can restore the previously processed data
30
+ let state = 'file';
31
+ for (let i = chunk.length - 1; i >= 0; i--) {
32
+ let c = chunk[i];
33
+
34
+ if (state === 'file' && (c === 0x0a || c === 0x0d)) {
35
+ // do nothing, found \n or \r at the end of chunk, stil end of file
36
+ } else if (state === 'file' && (c === 0x09 || c === 0x20)) {
37
+ // switch to line ending mode, this is the last non-empty line
38
+ state = 'line';
39
+ } else if (state === 'line' && (c === 0x09 || c === 0x20)) {
40
+ // do nothing, found ' ' or \t at the end of line, keep processing the last non-empty line
41
+ } else if (state === 'file' || state === 'line') {
42
+ // non line/file ending character found, switch to body mode
43
+ state = 'body';
44
+ if (i === chunk.length - 1) {
45
+ // final char is not part of line end or file end, so do nothing
46
+ break;
47
+ }
48
+ }
49
+
50
+ if (i === 0) {
51
+ // reached to the beginning of the chunk, check if it is still about the ending
52
+ // and if the remainder also matches
53
+ if (
54
+ (state === 'file' && (!this.remainder || /[\r\n]$/.test(this.remainder))) ||
55
+ (state === 'line' && (!this.remainder || /[ \t]$/.test(this.remainder)))
56
+ ) {
57
+ // keep everything
58
+ this.remainder += chunk.toString('binary');
59
+ return;
60
+ } else if (state === 'line' || state === 'file') {
61
+ // process existing remainder as normal line but store the current chunk
62
+ nextRemainder = chunk.toString('binary');
63
+ chunk = false;
64
+ break;
65
+ }
66
+ }
67
+
68
+ if (state !== 'body') {
69
+ continue;
70
+ }
71
+
72
+ // reached first non ending byte
73
+ nextRemainder = chunk.slice(i + 1).toString('binary');
74
+ chunk = chunk.slice(0, i + 1);
75
+ break;
76
+ }
77
+
78
+ let needsFixing = !!this.remainder;
79
+ if (chunk && !needsFixing) {
80
+ // check if we even need to change anything
81
+ for (let i = 0, len = chunk.length; i < len; i++) {
82
+ if (i && chunk[i] === 0x0a && chunk[i - 1] !== 0x0d) {
83
+ // missing \r before \n
84
+ needsFixing = true;
85
+ break;
86
+ } else if (i && chunk[i] === 0x0d && chunk[i - 1] === 0x20) {
87
+ // trailing WSP found
88
+ needsFixing = true;
89
+ break;
90
+ } else if (i && chunk[i] === 0x20 && chunk[i - 1] === 0x20) {
91
+ // multiple spaces found, needs to be replaced with just one
92
+ needsFixing = true;
93
+ break;
94
+ } else if (chunk[i] === 0x09) {
95
+ // TAB found, needs to be replaced with a space
96
+ needsFixing = true;
97
+ break;
98
+ }
99
+ }
100
+ }
101
+
102
+ if (needsFixing) {
103
+ bodyStr = this.remainder + (chunk ? chunk.toString('binary') : '');
104
+ this.remainder = nextRemainder;
105
+ bodyStr = bodyStr
106
+ .replace(/\r?\n/g, '\n') // use js line endings
107
+ .replace(/[ \t]*$/gm, '') // remove line endings, rtrim
108
+ .replace(/[ \t]+/gm, ' ') // single spaces
109
+ .replace(/\n/g, '\r\n'); // restore rfc822 line endings
110
+ chunk = Buffer.from(bodyStr, 'binary');
111
+ } else if (nextRemainder) {
112
+ this.remainder = nextRemainder;
113
+ }
114
+
115
+ if (this.debug) {
116
+ this._debugBody.push(chunk);
117
+ }
118
+ this.bodyHash.update(chunk);
119
+ }
120
+
121
+ _transform(chunk, encoding, callback) {
122
+ if (!chunk || !chunk.length) {
123
+ return callback();
124
+ }
125
+
126
+ if (typeof chunk === 'string') {
127
+ chunk = Buffer.from(chunk, encoding);
128
+ }
129
+
130
+ this.updateHash(chunk);
131
+
132
+ this.byteLength += chunk.length;
133
+ this.push(chunk);
134
+ callback();
135
+ }
136
+
137
+ _flush(callback) {
138
+ // generate final hash and emit it
139
+ if (/[\r\n]$/.test(this.remainder) && this.byteLength > 2) {
140
+ // add terminating line end
141
+ this.bodyHash.update(Buffer.from('\r\n'));
142
+ }
143
+ if (!this.byteLength) {
144
+ // emit empty line buffer to keep the stream flowing
145
+ this.push(Buffer.from('\r\n'));
146
+ // this.bodyHash.update(Buffer.from('\r\n'));
147
+ }
148
+
149
+ this.emit('hash', this.bodyHash.digest('base64'), this.debug ? Buffer.concat(this._debugBody) : false);
150
+ callback();
151
+ }
152
+ }
153
+
154
+ module.exports = RelaxedBody;
@@ -0,0 +1,117 @@
1
+ 'use strict';
2
+
3
+ const punycode = require('../punycode');
4
+ const mimeFuncs = require('../mime-funcs');
5
+ const crypto = require('crypto');
6
+
7
+ /**
8
+ * Returns DKIM signature header line
9
+ *
10
+ * @param {Object} headers Parsed headers object from MessageParser
11
+ * @param {String} bodyHash Base64 encoded hash of the message
12
+ * @param {Object} options DKIM options
13
+ * @param {String} options.domainName Domain name to be signed for
14
+ * @param {String} options.keySelector DKIM key selector to use
15
+ * @param {String} options.privateKey DKIM private key to use
16
+ * @return {String} Complete header line
17
+ */
18
+
19
+ module.exports = (headers, hashAlgo, bodyHash, options) => {
20
+ options = options || {};
21
+
22
+ // all listed fields from RFC4871 #5.5
23
+ let defaultFieldNames =
24
+ 'From:Sender:Reply-To:Subject:Date:Message-ID:To:' +
25
+ 'Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID:' +
26
+ 'Content-Description:Resent-Date:Resent-From:Resent-Sender:' +
27
+ 'Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:' +
28
+ 'List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:' +
29
+ 'List-Owner:List-Archive';
30
+
31
+ let fieldNames = options.headerFieldNames || defaultFieldNames;
32
+
33
+ let canonicalizedHeaderData = relaxedHeaders(headers, fieldNames, options.skipFields);
34
+ let dkimHeader = generateDKIMHeader(options.domainName, options.keySelector, canonicalizedHeaderData.fieldNames, hashAlgo, bodyHash);
35
+
36
+ let signer, signature;
37
+
38
+ canonicalizedHeaderData.headers += 'dkim-signature:' + relaxedHeaderLine(dkimHeader);
39
+
40
+ signer = crypto.createSign(('rsa-' + hashAlgo).toUpperCase());
41
+ signer.update(canonicalizedHeaderData.headers);
42
+ try {
43
+ signature = signer.sign(options.privateKey, 'base64');
44
+ } catch (_E) {
45
+ return false;
46
+ }
47
+
48
+ return dkimHeader + signature.replace(/(^.{73}|.{75}(?!\r?\n|\r))/g, '$&\r\n ').trim();
49
+ };
50
+
51
+ module.exports.relaxedHeaders = relaxedHeaders;
52
+
53
+ function generateDKIMHeader(domainName, keySelector, fieldNames, hashAlgo, bodyHash) {
54
+ let dkim = [
55
+ 'v=1',
56
+ 'a=rsa-' + hashAlgo,
57
+ 'c=relaxed/relaxed',
58
+ 'd=' + punycode.toASCII(domainName),
59
+ 'q=dns/txt',
60
+ 's=' + keySelector,
61
+ 'bh=' + bodyHash,
62
+ 'h=' + fieldNames
63
+ ].join('; ');
64
+
65
+ return mimeFuncs.foldLines('DKIM-Signature: ' + dkim, 76) + ';\r\n b=';
66
+ }
67
+
68
+ function relaxedHeaders(headers, fieldNames, skipFields) {
69
+ let includedFields = new Set();
70
+ let skip = new Set();
71
+ let headerFields = new Map();
72
+
73
+ (skipFields || '')
74
+ .toLowerCase()
75
+ .split(':')
76
+ .forEach(field => {
77
+ skip.add(field.trim());
78
+ });
79
+
80
+ (fieldNames || '')
81
+ .toLowerCase()
82
+ .split(':')
83
+ .filter(field => !skip.has(field.trim()))
84
+ .forEach(field => {
85
+ includedFields.add(field.trim());
86
+ });
87
+
88
+ for (let i = headers.length - 1; i >= 0; i--) {
89
+ let line = headers[i];
90
+ // only include the first value from bottom to top
91
+ if (includedFields.has(line.key) && !headerFields.has(line.key)) {
92
+ headerFields.set(line.key, relaxedHeaderLine(line.line));
93
+ }
94
+ }
95
+
96
+ let headersList = [];
97
+ let fields = [];
98
+ includedFields.forEach(field => {
99
+ if (headerFields.has(field)) {
100
+ fields.push(field);
101
+ headersList.push(field + ':' + headerFields.get(field));
102
+ }
103
+ });
104
+
105
+ return {
106
+ headers: headersList.join('\r\n') + '\r\n',
107
+ fieldNames: fields.join(':')
108
+ };
109
+ }
110
+
111
+ function relaxedHeaderLine(line) {
112
+ return line
113
+ .substr(line.indexOf(':') + 1)
114
+ .replace(/\r?\n/g, '')
115
+ .replace(/\s+/g, ' ')
116
+ .trim();
117
+ }