@bobfrankston/mailx 1.0.30 → 1.0.32

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 (313) hide show
  1. package/bin/mailx.js +20 -5
  2. package/client/styles/layout.css +12 -7
  3. package/launcher/builder/postinstall.js +7 -7
  4. package/package.json +4 -4
  5. package/packages/mailx-send/mailsend/node_modules/.package-lock.json +0 -49
  6. package/packages/mailx-send/mailsend/node_modules/@types/node/LICENSE +0 -21
  7. package/packages/mailx-send/mailsend/node_modules/@types/node/README.md +0 -15
  8. package/packages/mailx-send/mailsend/node_modules/@types/node/assert/strict.d.ts +0 -111
  9. package/packages/mailx-send/mailsend/node_modules/@types/node/assert.d.ts +0 -1078
  10. package/packages/mailx-send/mailsend/node_modules/@types/node/async_hooks.d.ts +0 -603
  11. package/packages/mailx-send/mailsend/node_modules/@types/node/buffer.buffer.d.ts +0 -472
  12. package/packages/mailx-send/mailsend/node_modules/@types/node/buffer.d.ts +0 -1934
  13. package/packages/mailx-send/mailsend/node_modules/@types/node/child_process.d.ts +0 -1476
  14. package/packages/mailx-send/mailsend/node_modules/@types/node/cluster.d.ts +0 -578
  15. package/packages/mailx-send/mailsend/node_modules/@types/node/compatibility/disposable.d.ts +0 -14
  16. package/packages/mailx-send/mailsend/node_modules/@types/node/compatibility/index.d.ts +0 -9
  17. package/packages/mailx-send/mailsend/node_modules/@types/node/compatibility/indexable.d.ts +0 -20
  18. package/packages/mailx-send/mailsend/node_modules/@types/node/compatibility/iterators.d.ts +0 -20
  19. package/packages/mailx-send/mailsend/node_modules/@types/node/console.d.ts +0 -452
  20. package/packages/mailx-send/mailsend/node_modules/@types/node/constants.d.ts +0 -21
  21. package/packages/mailx-send/mailsend/node_modules/@types/node/crypto.d.ts +0 -4545
  22. package/packages/mailx-send/mailsend/node_modules/@types/node/dgram.d.ts +0 -600
  23. package/packages/mailx-send/mailsend/node_modules/@types/node/diagnostics_channel.d.ts +0 -578
  24. package/packages/mailx-send/mailsend/node_modules/@types/node/dns/promises.d.ts +0 -503
  25. package/packages/mailx-send/mailsend/node_modules/@types/node/dns.d.ts +0 -923
  26. package/packages/mailx-send/mailsend/node_modules/@types/node/domain.d.ts +0 -170
  27. package/packages/mailx-send/mailsend/node_modules/@types/node/events.d.ts +0 -976
  28. package/packages/mailx-send/mailsend/node_modules/@types/node/fs/promises.d.ts +0 -1295
  29. package/packages/mailx-send/mailsend/node_modules/@types/node/fs.d.ts +0 -4461
  30. package/packages/mailx-send/mailsend/node_modules/@types/node/globals.d.ts +0 -172
  31. package/packages/mailx-send/mailsend/node_modules/@types/node/globals.typedarray.d.ts +0 -38
  32. package/packages/mailx-send/mailsend/node_modules/@types/node/http.d.ts +0 -2089
  33. package/packages/mailx-send/mailsend/node_modules/@types/node/http2.d.ts +0 -2644
  34. package/packages/mailx-send/mailsend/node_modules/@types/node/https.d.ts +0 -579
  35. package/packages/mailx-send/mailsend/node_modules/@types/node/index.d.ts +0 -97
  36. package/packages/mailx-send/mailsend/node_modules/@types/node/inspector.d.ts +0 -253
  37. package/packages/mailx-send/mailsend/node_modules/@types/node/inspector.generated.d.ts +0 -4052
  38. package/packages/mailx-send/mailsend/node_modules/@types/node/module.d.ts +0 -891
  39. package/packages/mailx-send/mailsend/node_modules/@types/node/net.d.ts +0 -1057
  40. package/packages/mailx-send/mailsend/node_modules/@types/node/os.d.ts +0 -506
  41. package/packages/mailx-send/mailsend/node_modules/@types/node/package.json +0 -145
  42. package/packages/mailx-send/mailsend/node_modules/@types/node/path.d.ts +0 -200
  43. package/packages/mailx-send/mailsend/node_modules/@types/node/perf_hooks.d.ts +0 -968
  44. package/packages/mailx-send/mailsend/node_modules/@types/node/process.d.ts +0 -2084
  45. package/packages/mailx-send/mailsend/node_modules/@types/node/punycode.d.ts +0 -117
  46. package/packages/mailx-send/mailsend/node_modules/@types/node/querystring.d.ts +0 -152
  47. package/packages/mailx-send/mailsend/node_modules/@types/node/readline/promises.d.ts +0 -161
  48. package/packages/mailx-send/mailsend/node_modules/@types/node/readline.d.ts +0 -594
  49. package/packages/mailx-send/mailsend/node_modules/@types/node/repl.d.ts +0 -428
  50. package/packages/mailx-send/mailsend/node_modules/@types/node/sea.d.ts +0 -153
  51. package/packages/mailx-send/mailsend/node_modules/@types/node/sqlite.d.ts +0 -721
  52. package/packages/mailx-send/mailsend/node_modules/@types/node/stream/consumers.d.ts +0 -38
  53. package/packages/mailx-send/mailsend/node_modules/@types/node/stream/promises.d.ts +0 -90
  54. package/packages/mailx-send/mailsend/node_modules/@types/node/stream/web.d.ts +0 -622
  55. package/packages/mailx-send/mailsend/node_modules/@types/node/stream.d.ts +0 -1664
  56. package/packages/mailx-send/mailsend/node_modules/@types/node/string_decoder.d.ts +0 -67
  57. package/packages/mailx-send/mailsend/node_modules/@types/node/test.d.ts +0 -2163
  58. package/packages/mailx-send/mailsend/node_modules/@types/node/timers/promises.d.ts +0 -108
  59. package/packages/mailx-send/mailsend/node_modules/@types/node/timers.d.ts +0 -287
  60. package/packages/mailx-send/mailsend/node_modules/@types/node/tls.d.ts +0 -1319
  61. package/packages/mailx-send/mailsend/node_modules/@types/node/trace_events.d.ts +0 -197
  62. package/packages/mailx-send/mailsend/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +0 -468
  63. package/packages/mailx-send/mailsend/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +0 -34
  64. package/packages/mailx-send/mailsend/node_modules/@types/node/ts5.6/index.d.ts +0 -97
  65. package/packages/mailx-send/mailsend/node_modules/@types/node/tty.d.ts +0 -208
  66. package/packages/mailx-send/mailsend/node_modules/@types/node/url.d.ts +0 -984
  67. package/packages/mailx-send/mailsend/node_modules/@types/node/util.d.ts +0 -2606
  68. package/packages/mailx-send/mailsend/node_modules/@types/node/v8.d.ts +0 -920
  69. package/packages/mailx-send/mailsend/node_modules/@types/node/vm.d.ts +0 -1000
  70. package/packages/mailx-send/mailsend/node_modules/@types/node/wasi.d.ts +0 -181
  71. package/packages/mailx-send/mailsend/node_modules/@types/node/web-globals/abortcontroller.d.ts +0 -34
  72. package/packages/mailx-send/mailsend/node_modules/@types/node/web-globals/domexception.d.ts +0 -68
  73. package/packages/mailx-send/mailsend/node_modules/@types/node/web-globals/events.d.ts +0 -97
  74. package/packages/mailx-send/mailsend/node_modules/@types/node/web-globals/fetch.d.ts +0 -55
  75. package/packages/mailx-send/mailsend/node_modules/@types/node/web-globals/navigator.d.ts +0 -22
  76. package/packages/mailx-send/mailsend/node_modules/@types/node/web-globals/storage.d.ts +0 -24
  77. package/packages/mailx-send/mailsend/node_modules/@types/node/worker_threads.d.ts +0 -784
  78. package/packages/mailx-send/mailsend/node_modules/@types/node/zlib.d.ts +0 -747
  79. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/LICENSE +0 -21
  80. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/README.md +0 -15
  81. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/index.d.ts +0 -82
  82. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/addressparser/index.d.ts +0 -31
  83. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/base64/index.d.ts +0 -22
  84. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/dkim/index.d.ts +0 -45
  85. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/dkim/message-parser.d.ts +0 -75
  86. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/dkim/relaxed-body.d.ts +0 -75
  87. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/dkim/sign.d.ts +0 -21
  88. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/fetch/cookies.d.ts +0 -54
  89. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/fetch/index.d.ts +0 -38
  90. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/json-transport/index.d.ts +0 -53
  91. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/mail-composer/index.d.ts +0 -25
  92. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/mailer/index.d.ts +0 -283
  93. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/mailer/mail-message.d.ts +0 -32
  94. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/mime-funcs/index.d.ts +0 -87
  95. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/mime-funcs/mime-types.d.ts +0 -2
  96. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/mime-node/index.d.ts +0 -224
  97. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/mime-node/last-newline.d.ts +0 -9
  98. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/qp/index.d.ts +0 -23
  99. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/sendmail-transport/index.d.ts +0 -53
  100. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/sendmail-transport/le-unix.d.ts +0 -7
  101. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/sendmail-transport/le-windows.d.ts +0 -7
  102. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/ses-transport/index.d.ts +0 -146
  103. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/shared/index.d.ts +0 -58
  104. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/smtp-connection/data-stream.d.ts +0 -11
  105. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/smtp-connection/http-proxy-client.d.ts +0 -16
  106. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/smtp-connection/index.d.ts +0 -270
  107. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/smtp-pool/index.d.ts +0 -93
  108. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/smtp-pool/pool-resource.d.ts +0 -66
  109. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/smtp-transport/index.d.ts +0 -115
  110. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/stream-transport/index.d.ts +0 -59
  111. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/well-known/index.d.ts +0 -6
  112. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/lib/xoauth2/index.d.ts +0 -114
  113. package/packages/mailx-send/mailsend/node_modules/@types/nodemailer/package.json +0 -38
  114. package/packages/mailx-send/mailsend/node_modules/nodemailer/.ncurc.js +0 -9
  115. package/packages/mailx-send/mailsend/node_modules/nodemailer/.prettierignore +0 -8
  116. package/packages/mailx-send/mailsend/node_modules/nodemailer/.prettierrc +0 -12
  117. package/packages/mailx-send/mailsend/node_modules/nodemailer/.prettierrc.js +0 -10
  118. package/packages/mailx-send/mailsend/node_modules/nodemailer/.release-please-config.json +0 -9
  119. package/packages/mailx-send/mailsend/node_modules/nodemailer/LICENSE +0 -16
  120. package/packages/mailx-send/mailsend/node_modules/nodemailer/README.md +0 -86
  121. package/packages/mailx-send/mailsend/node_modules/nodemailer/SECURITY.txt +0 -22
  122. package/packages/mailx-send/mailsend/node_modules/nodemailer/eslint.config.js +0 -88
  123. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/addressparser/index.js +0 -383
  124. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/base64/index.js +0 -139
  125. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/dkim/index.js +0 -253
  126. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/dkim/message-parser.js +0 -155
  127. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/dkim/relaxed-body.js +0 -154
  128. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/dkim/sign.js +0 -117
  129. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/fetch/cookies.js +0 -281
  130. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/fetch/index.js +0 -280
  131. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/json-transport/index.js +0 -82
  132. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mail-composer/index.js +0 -629
  133. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mailer/index.js +0 -441
  134. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mailer/mail-message.js +0 -316
  135. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mime-funcs/index.js +0 -625
  136. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mime-funcs/mime-types.js +0 -2113
  137. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mime-node/index.js +0 -1316
  138. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mime-node/last-newline.js +0 -33
  139. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mime-node/le-unix.js +0 -43
  140. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/mime-node/le-windows.js +0 -52
  141. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/nodemailer.js +0 -157
  142. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/punycode/index.js +0 -460
  143. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/qp/index.js +0 -227
  144. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/sendmail-transport/index.js +0 -210
  145. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/ses-transport/index.js +0 -234
  146. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/shared/index.js +0 -754
  147. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/smtp-connection/data-stream.js +0 -108
  148. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/smtp-connection/http-proxy-client.js +0 -143
  149. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/smtp-connection/index.js +0 -1870
  150. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/smtp-pool/index.js +0 -652
  151. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/smtp-pool/pool-resource.js +0 -259
  152. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/smtp-transport/index.js +0 -421
  153. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/stream-transport/index.js +0 -135
  154. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/well-known/index.js +0 -47
  155. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/well-known/services.json +0 -611
  156. package/packages/mailx-send/mailsend/node_modules/nodemailer/lib/xoauth2/index.js +0 -427
  157. package/packages/mailx-send/mailsend/node_modules/nodemailer/package.json +0 -47
  158. package/packages/mailx-send/mailsend/node_modules/undici-types/LICENSE +0 -21
  159. package/packages/mailx-send/mailsend/node_modules/undici-types/README.md +0 -6
  160. package/packages/mailx-send/mailsend/node_modules/undici-types/agent.d.ts +0 -31
  161. package/packages/mailx-send/mailsend/node_modules/undici-types/api.d.ts +0 -43
  162. package/packages/mailx-send/mailsend/node_modules/undici-types/balanced-pool.d.ts +0 -29
  163. package/packages/mailx-send/mailsend/node_modules/undici-types/cache.d.ts +0 -36
  164. package/packages/mailx-send/mailsend/node_modules/undici-types/client.d.ts +0 -108
  165. package/packages/mailx-send/mailsend/node_modules/undici-types/connector.d.ts +0 -34
  166. package/packages/mailx-send/mailsend/node_modules/undici-types/content-type.d.ts +0 -21
  167. package/packages/mailx-send/mailsend/node_modules/undici-types/cookies.d.ts +0 -28
  168. package/packages/mailx-send/mailsend/node_modules/undici-types/diagnostics-channel.d.ts +0 -66
  169. package/packages/mailx-send/mailsend/node_modules/undici-types/dispatcher.d.ts +0 -256
  170. package/packages/mailx-send/mailsend/node_modules/undici-types/env-http-proxy-agent.d.ts +0 -21
  171. package/packages/mailx-send/mailsend/node_modules/undici-types/errors.d.ts +0 -149
  172. package/packages/mailx-send/mailsend/node_modules/undici-types/eventsource.d.ts +0 -61
  173. package/packages/mailx-send/mailsend/node_modules/undici-types/fetch.d.ts +0 -209
  174. package/packages/mailx-send/mailsend/node_modules/undici-types/file.d.ts +0 -39
  175. package/packages/mailx-send/mailsend/node_modules/undici-types/filereader.d.ts +0 -54
  176. package/packages/mailx-send/mailsend/node_modules/undici-types/formdata.d.ts +0 -108
  177. package/packages/mailx-send/mailsend/node_modules/undici-types/global-dispatcher.d.ts +0 -9
  178. package/packages/mailx-send/mailsend/node_modules/undici-types/global-origin.d.ts +0 -7
  179. package/packages/mailx-send/mailsend/node_modules/undici-types/handlers.d.ts +0 -15
  180. package/packages/mailx-send/mailsend/node_modules/undici-types/header.d.ts +0 -4
  181. package/packages/mailx-send/mailsend/node_modules/undici-types/index.d.ts +0 -71
  182. package/packages/mailx-send/mailsend/node_modules/undici-types/interceptors.d.ts +0 -17
  183. package/packages/mailx-send/mailsend/node_modules/undici-types/mock-agent.d.ts +0 -50
  184. package/packages/mailx-send/mailsend/node_modules/undici-types/mock-client.d.ts +0 -25
  185. package/packages/mailx-send/mailsend/node_modules/undici-types/mock-errors.d.ts +0 -12
  186. package/packages/mailx-send/mailsend/node_modules/undici-types/mock-interceptor.d.ts +0 -93
  187. package/packages/mailx-send/mailsend/node_modules/undici-types/mock-pool.d.ts +0 -25
  188. package/packages/mailx-send/mailsend/node_modules/undici-types/package.json +0 -55
  189. package/packages/mailx-send/mailsend/node_modules/undici-types/patch.d.ts +0 -33
  190. package/packages/mailx-send/mailsend/node_modules/undici-types/pool-stats.d.ts +0 -19
  191. package/packages/mailx-send/mailsend/node_modules/undici-types/pool.d.ts +0 -39
  192. package/packages/mailx-send/mailsend/node_modules/undici-types/proxy-agent.d.ts +0 -28
  193. package/packages/mailx-send/mailsend/node_modules/undici-types/readable.d.ts +0 -65
  194. package/packages/mailx-send/mailsend/node_modules/undici-types/retry-agent.d.ts +0 -8
  195. package/packages/mailx-send/mailsend/node_modules/undici-types/retry-handler.d.ts +0 -116
  196. package/packages/mailx-send/mailsend/node_modules/undici-types/util.d.ts +0 -18
  197. package/packages/mailx-send/mailsend/node_modules/undici-types/webidl.d.ts +0 -228
  198. package/packages/mailx-send/mailsend/node_modules/undici-types/websocket.d.ts +0 -150
  199. package/packages/mailx-send/node_modules/.package-lock.json +0 -49
  200. package/packages/mailx-send/node_modules/@types/node/LICENSE +0 -21
  201. package/packages/mailx-send/node_modules/@types/node/README.md +0 -15
  202. package/packages/mailx-send/node_modules/@types/node/assert/strict.d.ts +0 -111
  203. package/packages/mailx-send/node_modules/@types/node/assert.d.ts +0 -1078
  204. package/packages/mailx-send/node_modules/@types/node/async_hooks.d.ts +0 -603
  205. package/packages/mailx-send/node_modules/@types/node/buffer.buffer.d.ts +0 -472
  206. package/packages/mailx-send/node_modules/@types/node/buffer.d.ts +0 -1934
  207. package/packages/mailx-send/node_modules/@types/node/child_process.d.ts +0 -1476
  208. package/packages/mailx-send/node_modules/@types/node/cluster.d.ts +0 -578
  209. package/packages/mailx-send/node_modules/@types/node/compatibility/disposable.d.ts +0 -14
  210. package/packages/mailx-send/node_modules/@types/node/compatibility/index.d.ts +0 -9
  211. package/packages/mailx-send/node_modules/@types/node/compatibility/indexable.d.ts +0 -20
  212. package/packages/mailx-send/node_modules/@types/node/compatibility/iterators.d.ts +0 -20
  213. package/packages/mailx-send/node_modules/@types/node/console.d.ts +0 -452
  214. package/packages/mailx-send/node_modules/@types/node/constants.d.ts +0 -21
  215. package/packages/mailx-send/node_modules/@types/node/crypto.d.ts +0 -4545
  216. package/packages/mailx-send/node_modules/@types/node/dgram.d.ts +0 -600
  217. package/packages/mailx-send/node_modules/@types/node/diagnostics_channel.d.ts +0 -578
  218. package/packages/mailx-send/node_modules/@types/node/dns/promises.d.ts +0 -503
  219. package/packages/mailx-send/node_modules/@types/node/dns.d.ts +0 -923
  220. package/packages/mailx-send/node_modules/@types/node/domain.d.ts +0 -170
  221. package/packages/mailx-send/node_modules/@types/node/events.d.ts +0 -976
  222. package/packages/mailx-send/node_modules/@types/node/fs/promises.d.ts +0 -1295
  223. package/packages/mailx-send/node_modules/@types/node/fs.d.ts +0 -4461
  224. package/packages/mailx-send/node_modules/@types/node/globals.d.ts +0 -172
  225. package/packages/mailx-send/node_modules/@types/node/globals.typedarray.d.ts +0 -38
  226. package/packages/mailx-send/node_modules/@types/node/http.d.ts +0 -2089
  227. package/packages/mailx-send/node_modules/@types/node/http2.d.ts +0 -2644
  228. package/packages/mailx-send/node_modules/@types/node/https.d.ts +0 -579
  229. package/packages/mailx-send/node_modules/@types/node/index.d.ts +0 -97
  230. package/packages/mailx-send/node_modules/@types/node/inspector.d.ts +0 -253
  231. package/packages/mailx-send/node_modules/@types/node/inspector.generated.d.ts +0 -4052
  232. package/packages/mailx-send/node_modules/@types/node/module.d.ts +0 -891
  233. package/packages/mailx-send/node_modules/@types/node/net.d.ts +0 -1057
  234. package/packages/mailx-send/node_modules/@types/node/os.d.ts +0 -506
  235. package/packages/mailx-send/node_modules/@types/node/package.json +0 -145
  236. package/packages/mailx-send/node_modules/@types/node/path.d.ts +0 -200
  237. package/packages/mailx-send/node_modules/@types/node/perf_hooks.d.ts +0 -968
  238. package/packages/mailx-send/node_modules/@types/node/process.d.ts +0 -2084
  239. package/packages/mailx-send/node_modules/@types/node/punycode.d.ts +0 -117
  240. package/packages/mailx-send/node_modules/@types/node/querystring.d.ts +0 -152
  241. package/packages/mailx-send/node_modules/@types/node/readline/promises.d.ts +0 -161
  242. package/packages/mailx-send/node_modules/@types/node/readline.d.ts +0 -594
  243. package/packages/mailx-send/node_modules/@types/node/repl.d.ts +0 -428
  244. package/packages/mailx-send/node_modules/@types/node/sea.d.ts +0 -153
  245. package/packages/mailx-send/node_modules/@types/node/sqlite.d.ts +0 -721
  246. package/packages/mailx-send/node_modules/@types/node/stream/consumers.d.ts +0 -38
  247. package/packages/mailx-send/node_modules/@types/node/stream/promises.d.ts +0 -90
  248. package/packages/mailx-send/node_modules/@types/node/stream/web.d.ts +0 -622
  249. package/packages/mailx-send/node_modules/@types/node/stream.d.ts +0 -1664
  250. package/packages/mailx-send/node_modules/@types/node/string_decoder.d.ts +0 -67
  251. package/packages/mailx-send/node_modules/@types/node/test.d.ts +0 -2163
  252. package/packages/mailx-send/node_modules/@types/node/timers/promises.d.ts +0 -108
  253. package/packages/mailx-send/node_modules/@types/node/timers.d.ts +0 -287
  254. package/packages/mailx-send/node_modules/@types/node/tls.d.ts +0 -1319
  255. package/packages/mailx-send/node_modules/@types/node/trace_events.d.ts +0 -197
  256. package/packages/mailx-send/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +0 -468
  257. package/packages/mailx-send/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +0 -34
  258. package/packages/mailx-send/node_modules/@types/node/ts5.6/index.d.ts +0 -97
  259. package/packages/mailx-send/node_modules/@types/node/tty.d.ts +0 -208
  260. package/packages/mailx-send/node_modules/@types/node/url.d.ts +0 -984
  261. package/packages/mailx-send/node_modules/@types/node/util.d.ts +0 -2606
  262. package/packages/mailx-send/node_modules/@types/node/v8.d.ts +0 -920
  263. package/packages/mailx-send/node_modules/@types/node/vm.d.ts +0 -1000
  264. package/packages/mailx-send/node_modules/@types/node/wasi.d.ts +0 -181
  265. package/packages/mailx-send/node_modules/@types/node/web-globals/abortcontroller.d.ts +0 -34
  266. package/packages/mailx-send/node_modules/@types/node/web-globals/domexception.d.ts +0 -68
  267. package/packages/mailx-send/node_modules/@types/node/web-globals/events.d.ts +0 -97
  268. package/packages/mailx-send/node_modules/@types/node/web-globals/fetch.d.ts +0 -55
  269. package/packages/mailx-send/node_modules/@types/node/web-globals/navigator.d.ts +0 -22
  270. package/packages/mailx-send/node_modules/@types/node/web-globals/storage.d.ts +0 -24
  271. package/packages/mailx-send/node_modules/@types/node/worker_threads.d.ts +0 -784
  272. package/packages/mailx-send/node_modules/@types/node/zlib.d.ts +0 -747
  273. package/packages/mailx-send/node_modules/undici-types/LICENSE +0 -21
  274. package/packages/mailx-send/node_modules/undici-types/README.md +0 -6
  275. package/packages/mailx-send/node_modules/undici-types/agent.d.ts +0 -31
  276. package/packages/mailx-send/node_modules/undici-types/api.d.ts +0 -43
  277. package/packages/mailx-send/node_modules/undici-types/balanced-pool.d.ts +0 -29
  278. package/packages/mailx-send/node_modules/undici-types/cache.d.ts +0 -36
  279. package/packages/mailx-send/node_modules/undici-types/client.d.ts +0 -108
  280. package/packages/mailx-send/node_modules/undici-types/connector.d.ts +0 -34
  281. package/packages/mailx-send/node_modules/undici-types/content-type.d.ts +0 -21
  282. package/packages/mailx-send/node_modules/undici-types/cookies.d.ts +0 -28
  283. package/packages/mailx-send/node_modules/undici-types/diagnostics-channel.d.ts +0 -66
  284. package/packages/mailx-send/node_modules/undici-types/dispatcher.d.ts +0 -256
  285. package/packages/mailx-send/node_modules/undici-types/env-http-proxy-agent.d.ts +0 -21
  286. package/packages/mailx-send/node_modules/undici-types/errors.d.ts +0 -149
  287. package/packages/mailx-send/node_modules/undici-types/eventsource.d.ts +0 -61
  288. package/packages/mailx-send/node_modules/undici-types/fetch.d.ts +0 -209
  289. package/packages/mailx-send/node_modules/undici-types/file.d.ts +0 -39
  290. package/packages/mailx-send/node_modules/undici-types/filereader.d.ts +0 -54
  291. package/packages/mailx-send/node_modules/undici-types/formdata.d.ts +0 -108
  292. package/packages/mailx-send/node_modules/undici-types/global-dispatcher.d.ts +0 -9
  293. package/packages/mailx-send/node_modules/undici-types/global-origin.d.ts +0 -7
  294. package/packages/mailx-send/node_modules/undici-types/handlers.d.ts +0 -15
  295. package/packages/mailx-send/node_modules/undici-types/header.d.ts +0 -4
  296. package/packages/mailx-send/node_modules/undici-types/index.d.ts +0 -71
  297. package/packages/mailx-send/node_modules/undici-types/interceptors.d.ts +0 -17
  298. package/packages/mailx-send/node_modules/undici-types/mock-agent.d.ts +0 -50
  299. package/packages/mailx-send/node_modules/undici-types/mock-client.d.ts +0 -25
  300. package/packages/mailx-send/node_modules/undici-types/mock-errors.d.ts +0 -12
  301. package/packages/mailx-send/node_modules/undici-types/mock-interceptor.d.ts +0 -93
  302. package/packages/mailx-send/node_modules/undici-types/mock-pool.d.ts +0 -25
  303. package/packages/mailx-send/node_modules/undici-types/package.json +0 -55
  304. package/packages/mailx-send/node_modules/undici-types/patch.d.ts +0 -33
  305. package/packages/mailx-send/node_modules/undici-types/pool-stats.d.ts +0 -19
  306. package/packages/mailx-send/node_modules/undici-types/pool.d.ts +0 -39
  307. package/packages/mailx-send/node_modules/undici-types/proxy-agent.d.ts +0 -28
  308. package/packages/mailx-send/node_modules/undici-types/readable.d.ts +0 -65
  309. package/packages/mailx-send/node_modules/undici-types/retry-agent.d.ts +0 -8
  310. package/packages/mailx-send/node_modules/undici-types/retry-handler.d.ts +0 -116
  311. package/packages/mailx-send/node_modules/undici-types/util.d.ts +0 -18
  312. package/packages/mailx-send/node_modules/undici-types/webidl.d.ts +0 -228
  313. package/packages/mailx-send/node_modules/undici-types/websocket.d.ts +0 -150
@@ -1,629 +0,0 @@
1
- /* eslint no-undefined: 0 */
2
-
3
- 'use strict';
4
-
5
- const MimeNode = require('../mime-node');
6
- const mimeFuncs = require('../mime-funcs');
7
- const parseDataURI = require('../shared').parseDataURI;
8
-
9
- /**
10
- * Creates the object for composing a MimeNode instance out from the mail options
11
- *
12
- * @constructor
13
- * @param {Object} mail Mail options
14
- */
15
- class MailComposer {
16
- constructor(mail) {
17
- this.mail = mail || {};
18
- this.message = false;
19
- }
20
-
21
- /**
22
- * Builds MimeNode instance
23
- */
24
- compile() {
25
- this._alternatives = this.getAlternatives();
26
- this._htmlNode = this._alternatives.filter(alternative => /^text\/html\b/i.test(alternative.contentType)).pop();
27
- this._attachments = this.getAttachments(!!this._htmlNode);
28
-
29
- this._useRelated = !!(this._htmlNode && this._attachments.related.length);
30
- this._useAlternative = this._alternatives.length > 1;
31
- this._useMixed = this._attachments.attached.length > 1 || (this._alternatives.length && this._attachments.attached.length === 1);
32
-
33
- // Compose MIME tree
34
- if (this.mail.raw) {
35
- this.message = new MimeNode('message/rfc822', { newline: this.mail.newline }).setRaw(this.mail.raw);
36
- } else if (this._useMixed) {
37
- this.message = this._createMixed();
38
- } else if (this._useAlternative) {
39
- this.message = this._createAlternative();
40
- } else if (this._useRelated) {
41
- this.message = this._createRelated();
42
- } else {
43
- this.message = this._createContentNode(
44
- false,
45
- []
46
- .concat(this._alternatives || [])
47
- .concat(this._attachments.attached || [])
48
- .shift() || {
49
- contentType: 'text/plain',
50
- content: ''
51
- }
52
- );
53
- }
54
-
55
- // Add custom headers
56
- if (this.mail.headers) {
57
- this.message.addHeader(this.mail.headers);
58
- }
59
-
60
- // Add headers to the root node, always overrides custom headers
61
- ['from', 'sender', 'to', 'cc', 'bcc', 'reply-to', 'in-reply-to', 'references', 'subject', 'message-id', 'date'].forEach(header => {
62
- let key = header.replace(/-(\w)/g, (o, c) => c.toUpperCase());
63
- if (this.mail[key]) {
64
- this.message.setHeader(header, this.mail[key]);
65
- }
66
- });
67
-
68
- // Sets custom envelope
69
- if (this.mail.envelope) {
70
- this.message.setEnvelope(this.mail.envelope);
71
- }
72
-
73
- // ensure Message-Id value
74
- this.message.messageId();
75
-
76
- return this.message;
77
- }
78
-
79
- /**
80
- * List all attachments. Resulting attachment objects can be used as input for MimeNode nodes
81
- *
82
- * @param {Boolean} findRelated If true separate related attachments from attached ones
83
- * @returns {Object} An object of arrays (`related` and `attached`)
84
- */
85
- getAttachments(findRelated) {
86
- let icalEvent, eventObject;
87
- let attachments = [].concat(this.mail.attachments || []).map((attachment, i) => {
88
- let data;
89
-
90
- if (/^data:/i.test(attachment.path || attachment.href)) {
91
- attachment = this._processDataUrl(attachment);
92
- }
93
-
94
- let contentType =
95
- attachment.contentType || mimeFuncs.detectMimeType(attachment.filename || attachment.path || attachment.href || 'bin');
96
-
97
- let isImage = /^image\//i.test(contentType);
98
- let isMessageNode = /^message\//i.test(contentType);
99
-
100
- let contentDisposition =
101
- attachment.contentDisposition || (isMessageNode || (isImage && attachment.cid) ? 'inline' : 'attachment');
102
-
103
- let contentTransferEncoding;
104
- if ('contentTransferEncoding' in attachment) {
105
- // also contains `false`, to set
106
- contentTransferEncoding = attachment.contentTransferEncoding;
107
- } else if (isMessageNode) {
108
- // the content might include non-ASCII bytes but at this point we do not know it yet
109
- contentTransferEncoding = '8bit';
110
- } else {
111
- contentTransferEncoding = 'base64'; // the default
112
- }
113
-
114
- data = {
115
- contentType,
116
- contentDisposition,
117
- contentTransferEncoding
118
- };
119
-
120
- if (attachment.filename) {
121
- data.filename = attachment.filename;
122
- } else if (!isMessageNode && attachment.filename !== false) {
123
- data.filename = (attachment.path || attachment.href || '').split('/').pop().split('?').shift() || 'attachment-' + (i + 1);
124
- if (data.filename.indexOf('.') < 0) {
125
- data.filename += '.' + mimeFuncs.detectExtension(data.contentType);
126
- }
127
- }
128
-
129
- if (/^https?:\/\//i.test(attachment.path)) {
130
- attachment.href = attachment.path;
131
- attachment.path = undefined;
132
- }
133
-
134
- if (attachment.cid) {
135
- data.cid = attachment.cid;
136
- }
137
-
138
- if (attachment.raw) {
139
- data.raw = attachment.raw;
140
- } else if (attachment.path) {
141
- data.content = {
142
- path: attachment.path
143
- };
144
- } else if (attachment.href) {
145
- data.content = {
146
- href: attachment.href,
147
- httpHeaders: attachment.httpHeaders
148
- };
149
- } else {
150
- data.content = attachment.content || '';
151
- }
152
-
153
- if (attachment.encoding) {
154
- data.encoding = attachment.encoding;
155
- }
156
-
157
- if (attachment.headers) {
158
- data.headers = attachment.headers;
159
- }
160
-
161
- return data;
162
- });
163
-
164
- if (this.mail.icalEvent) {
165
- if (
166
- typeof this.mail.icalEvent === 'object' &&
167
- (this.mail.icalEvent.content || this.mail.icalEvent.path || this.mail.icalEvent.href || this.mail.icalEvent.raw)
168
- ) {
169
- icalEvent = this.mail.icalEvent;
170
- } else {
171
- icalEvent = {
172
- content: this.mail.icalEvent
173
- };
174
- }
175
-
176
- eventObject = {};
177
- Object.keys(icalEvent).forEach(key => {
178
- eventObject[key] = icalEvent[key];
179
- });
180
-
181
- eventObject.contentType = 'application/ics';
182
- if (!eventObject.headers) {
183
- eventObject.headers = {};
184
- }
185
- eventObject.filename = eventObject.filename || 'invite.ics';
186
- eventObject.headers['Content-Disposition'] = 'attachment';
187
- eventObject.headers['Content-Transfer-Encoding'] = 'base64';
188
- }
189
-
190
- if (!findRelated) {
191
- return {
192
- attached: attachments.concat(eventObject || []),
193
- related: []
194
- };
195
- } else {
196
- return {
197
- attached: attachments.filter(attachment => !attachment.cid).concat(eventObject || []),
198
- related: attachments.filter(attachment => !!attachment.cid)
199
- };
200
- }
201
- }
202
-
203
- /**
204
- * List alternatives. Resulting objects can be used as input for MimeNode nodes
205
- *
206
- * @returns {Array} An array of alternative elements. Includes the `text` and `html` values as well
207
- */
208
- getAlternatives() {
209
- let alternatives = [],
210
- text,
211
- html,
212
- watchHtml,
213
- amp,
214
- icalEvent,
215
- eventObject;
216
-
217
- if (this.mail.text) {
218
- if (
219
- typeof this.mail.text === 'object' &&
220
- (this.mail.text.content || this.mail.text.path || this.mail.text.href || this.mail.text.raw)
221
- ) {
222
- text = this.mail.text;
223
- } else {
224
- text = {
225
- content: this.mail.text
226
- };
227
- }
228
- text.contentType = 'text/plain; charset=utf-8';
229
- }
230
-
231
- if (this.mail.watchHtml) {
232
- if (
233
- typeof this.mail.watchHtml === 'object' &&
234
- (this.mail.watchHtml.content || this.mail.watchHtml.path || this.mail.watchHtml.href || this.mail.watchHtml.raw)
235
- ) {
236
- watchHtml = this.mail.watchHtml;
237
- } else {
238
- watchHtml = {
239
- content: this.mail.watchHtml
240
- };
241
- }
242
- watchHtml.contentType = 'text/watch-html; charset=utf-8';
243
- }
244
-
245
- if (this.mail.amp) {
246
- if (
247
- typeof this.mail.amp === 'object' &&
248
- (this.mail.amp.content || this.mail.amp.path || this.mail.amp.href || this.mail.amp.raw)
249
- ) {
250
- amp = this.mail.amp;
251
- } else {
252
- amp = {
253
- content: this.mail.amp
254
- };
255
- }
256
- amp.contentType = 'text/x-amp-html; charset=utf-8';
257
- }
258
-
259
- // NB! when including attachments with a calendar alternative you might end up in a blank screen on some clients
260
- if (this.mail.icalEvent) {
261
- if (
262
- typeof this.mail.icalEvent === 'object' &&
263
- (this.mail.icalEvent.content || this.mail.icalEvent.path || this.mail.icalEvent.href || this.mail.icalEvent.raw)
264
- ) {
265
- icalEvent = this.mail.icalEvent;
266
- } else {
267
- icalEvent = {
268
- content: this.mail.icalEvent
269
- };
270
- }
271
-
272
- eventObject = {};
273
- Object.keys(icalEvent).forEach(key => {
274
- eventObject[key] = icalEvent[key];
275
- });
276
-
277
- if (eventObject.content && typeof eventObject.content === 'object') {
278
- // we are going to have the same attachment twice, so mark this to be
279
- // resolved just once
280
- eventObject.content._resolve = true;
281
- }
282
-
283
- eventObject.filename = false;
284
- eventObject.contentType =
285
- 'text/calendar; charset=utf-8; method=' + (eventObject.method || 'PUBLISH').toString().trim().toUpperCase();
286
- if (!eventObject.headers) {
287
- eventObject.headers = {};
288
- }
289
- }
290
-
291
- if (this.mail.html) {
292
- if (
293
- typeof this.mail.html === 'object' &&
294
- (this.mail.html.content || this.mail.html.path || this.mail.html.href || this.mail.html.raw)
295
- ) {
296
- html = this.mail.html;
297
- } else {
298
- html = {
299
- content: this.mail.html
300
- };
301
- }
302
- html.contentType = 'text/html; charset=utf-8';
303
- }
304
-
305
- []
306
- .concat(text || [])
307
- .concat(watchHtml || [])
308
- .concat(amp || [])
309
- .concat(html || [])
310
- .concat(eventObject || [])
311
- .concat(this.mail.alternatives || [])
312
- .forEach(alternative => {
313
- let data;
314
-
315
- if (/^data:/i.test(alternative.path || alternative.href)) {
316
- alternative = this._processDataUrl(alternative);
317
- }
318
-
319
- data = {
320
- contentType:
321
- alternative.contentType ||
322
- mimeFuncs.detectMimeType(alternative.filename || alternative.path || alternative.href || 'txt'),
323
- contentTransferEncoding: alternative.contentTransferEncoding
324
- };
325
-
326
- if (alternative.filename) {
327
- data.filename = alternative.filename;
328
- }
329
-
330
- if (/^https?:\/\//i.test(alternative.path)) {
331
- alternative.href = alternative.path;
332
- alternative.path = undefined;
333
- }
334
-
335
- if (alternative.raw) {
336
- data.raw = alternative.raw;
337
- } else if (alternative.path) {
338
- data.content = {
339
- path: alternative.path
340
- };
341
- } else if (alternative.href) {
342
- data.content = {
343
- href: alternative.href
344
- };
345
- } else {
346
- data.content = alternative.content || '';
347
- }
348
-
349
- if (alternative.encoding) {
350
- data.encoding = alternative.encoding;
351
- }
352
-
353
- if (alternative.headers) {
354
- data.headers = alternative.headers;
355
- }
356
-
357
- alternatives.push(data);
358
- });
359
-
360
- return alternatives;
361
- }
362
-
363
- /**
364
- * Builds multipart/mixed node. It should always contain different type of elements on the same level
365
- * eg. text + attachments
366
- *
367
- * @param {Object} parentNode Parent for this note. If it does not exist, a root node is created
368
- * @returns {Object} MimeNode node element
369
- */
370
- _createMixed(parentNode) {
371
- let node;
372
-
373
- if (!parentNode) {
374
- node = new MimeNode('multipart/mixed', {
375
- baseBoundary: this.mail.baseBoundary,
376
- textEncoding: this.mail.textEncoding,
377
- boundaryPrefix: this.mail.boundaryPrefix,
378
- disableUrlAccess: this.mail.disableUrlAccess,
379
- disableFileAccess: this.mail.disableFileAccess,
380
- normalizeHeaderKey: this.mail.normalizeHeaderKey,
381
- newline: this.mail.newline
382
- });
383
- } else {
384
- node = parentNode.createChild('multipart/mixed', {
385
- disableUrlAccess: this.mail.disableUrlAccess,
386
- disableFileAccess: this.mail.disableFileAccess,
387
- normalizeHeaderKey: this.mail.normalizeHeaderKey,
388
- newline: this.mail.newline
389
- });
390
- }
391
-
392
- if (this._useAlternative) {
393
- this._createAlternative(node);
394
- } else if (this._useRelated) {
395
- this._createRelated(node);
396
- }
397
-
398
- []
399
- .concat((!this._useAlternative && this._alternatives) || [])
400
- .concat(this._attachments.attached || [])
401
- .forEach(element => {
402
- // if the element is a html node from related subpart then ignore it
403
- if (!this._useRelated || element !== this._htmlNode) {
404
- this._createContentNode(node, element);
405
- }
406
- });
407
-
408
- return node;
409
- }
410
-
411
- /**
412
- * Builds multipart/alternative node. It should always contain same type of elements on the same level
413
- * eg. text + html view of the same data
414
- *
415
- * @param {Object} parentNode Parent for this note. If it does not exist, a root node is created
416
- * @returns {Object} MimeNode node element
417
- */
418
- _createAlternative(parentNode) {
419
- let node;
420
-
421
- if (!parentNode) {
422
- node = new MimeNode('multipart/alternative', {
423
- baseBoundary: this.mail.baseBoundary,
424
- textEncoding: this.mail.textEncoding,
425
- boundaryPrefix: this.mail.boundaryPrefix,
426
- disableUrlAccess: this.mail.disableUrlAccess,
427
- disableFileAccess: this.mail.disableFileAccess,
428
- normalizeHeaderKey: this.mail.normalizeHeaderKey,
429
- newline: this.mail.newline
430
- });
431
- } else {
432
- node = parentNode.createChild('multipart/alternative', {
433
- disableUrlAccess: this.mail.disableUrlAccess,
434
- disableFileAccess: this.mail.disableFileAccess,
435
- normalizeHeaderKey: this.mail.normalizeHeaderKey,
436
- newline: this.mail.newline
437
- });
438
- }
439
-
440
- this._alternatives.forEach(alternative => {
441
- if (this._useRelated && this._htmlNode === alternative) {
442
- this._createRelated(node);
443
- } else {
444
- this._createContentNode(node, alternative);
445
- }
446
- });
447
-
448
- return node;
449
- }
450
-
451
- /**
452
- * Builds multipart/related node. It should always contain html node with related attachments
453
- *
454
- * @param {Object} parentNode Parent for this note. If it does not exist, a root node is created
455
- * @returns {Object} MimeNode node element
456
- */
457
- _createRelated(parentNode) {
458
- let node;
459
-
460
- if (!parentNode) {
461
- node = new MimeNode('multipart/related; type="text/html"', {
462
- baseBoundary: this.mail.baseBoundary,
463
- textEncoding: this.mail.textEncoding,
464
- boundaryPrefix: this.mail.boundaryPrefix,
465
- disableUrlAccess: this.mail.disableUrlAccess,
466
- disableFileAccess: this.mail.disableFileAccess,
467
- normalizeHeaderKey: this.mail.normalizeHeaderKey,
468
- newline: this.mail.newline
469
- });
470
- } else {
471
- node = parentNode.createChild('multipart/related; type="text/html"', {
472
- disableUrlAccess: this.mail.disableUrlAccess,
473
- disableFileAccess: this.mail.disableFileAccess,
474
- normalizeHeaderKey: this.mail.normalizeHeaderKey,
475
- newline: this.mail.newline
476
- });
477
- }
478
-
479
- this._createContentNode(node, this._htmlNode);
480
-
481
- this._attachments.related.forEach(alternative => this._createContentNode(node, alternative));
482
-
483
- return node;
484
- }
485
-
486
- /**
487
- * Creates a regular node with contents
488
- *
489
- * @param {Object} parentNode Parent for this note. If it does not exist, a root node is created
490
- * @param {Object} element Node data
491
- * @returns {Object} MimeNode node element
492
- */
493
- _createContentNode(parentNode, element) {
494
- element = element || {};
495
- element.content = element.content || '';
496
-
497
- let node;
498
- let encoding = (element.encoding || 'utf8')
499
- .toString()
500
- .toLowerCase()
501
- .replace(/[-_\s]/g, '');
502
-
503
- if (!parentNode) {
504
- node = new MimeNode(element.contentType, {
505
- filename: element.filename,
506
- baseBoundary: this.mail.baseBoundary,
507
- textEncoding: this.mail.textEncoding,
508
- boundaryPrefix: this.mail.boundaryPrefix,
509
- disableUrlAccess: this.mail.disableUrlAccess,
510
- disableFileAccess: this.mail.disableFileAccess,
511
- normalizeHeaderKey: this.mail.normalizeHeaderKey,
512
- newline: this.mail.newline
513
- });
514
- } else {
515
- node = parentNode.createChild(element.contentType, {
516
- filename: element.filename,
517
- textEncoding: this.mail.textEncoding,
518
- disableUrlAccess: this.mail.disableUrlAccess,
519
- disableFileAccess: this.mail.disableFileAccess,
520
- normalizeHeaderKey: this.mail.normalizeHeaderKey,
521
- newline: this.mail.newline
522
- });
523
- }
524
-
525
- // add custom headers
526
- if (element.headers) {
527
- node.addHeader(element.headers);
528
- }
529
-
530
- if (element.cid) {
531
- node.setHeader('Content-Id', '<' + element.cid.replace(/[<>]/g, '') + '>');
532
- }
533
-
534
- if (element.contentTransferEncoding) {
535
- node.setHeader('Content-Transfer-Encoding', element.contentTransferEncoding);
536
- } else if (this.mail.encoding && /^text\//i.test(element.contentType)) {
537
- node.setHeader('Content-Transfer-Encoding', this.mail.encoding);
538
- }
539
-
540
- if (!/^text\//i.test(element.contentType) || element.contentDisposition) {
541
- node.setHeader(
542
- 'Content-Disposition',
543
- element.contentDisposition || (element.cid && /^image\//i.test(element.contentType) ? 'inline' : 'attachment')
544
- );
545
- }
546
-
547
- if (typeof element.content === 'string' && !['utf8', 'usascii', 'ascii'].includes(encoding)) {
548
- element.content = Buffer.from(element.content, encoding);
549
- }
550
-
551
- // prefer pregenerated raw content
552
- if (element.raw) {
553
- node.setRaw(element.raw);
554
- } else {
555
- node.setContent(element.content);
556
- }
557
-
558
- return node;
559
- }
560
-
561
- /**
562
- * Parses data uri and converts it to a Buffer
563
- *
564
- * @param {Object} element Content element
565
- * @return {Object} Parsed element
566
- */
567
- _processDataUrl(element) {
568
- const dataUrl = element.path || element.href;
569
-
570
- // Early validation to prevent ReDoS
571
- if (!dataUrl || typeof dataUrl !== 'string') {
572
- return element;
573
- }
574
-
575
- if (!dataUrl.startsWith('data:')) {
576
- return element;
577
- }
578
-
579
- if (dataUrl.length > 52428800) {
580
- // 52428800 chars = 50MB limit for data URL string (~37.5MB decoded image)
581
- // Extract content type before rejecting to preserve MIME type
582
- let detectedType = 'application/octet-stream';
583
- const commaPos = dataUrl.indexOf(',');
584
-
585
- if (commaPos > 0 && commaPos < 200) {
586
- // Parse header safely with size limit
587
- const header = dataUrl.substring(5, commaPos); // skip 'data:'
588
- const parts = header.split(';');
589
- if (parts[0] && parts[0].includes('/')) {
590
- detectedType = parts[0].trim();
591
- }
592
- }
593
-
594
- // Return empty content for excessively long data URLs
595
- return Object.assign({}, element, {
596
- path: false,
597
- href: false,
598
- content: Buffer.alloc(0),
599
- contentType: element.contentType || detectedType
600
- });
601
- }
602
-
603
- let parsedDataUri;
604
- try {
605
- parsedDataUri = parseDataURI(dataUrl);
606
- } catch (_err) {
607
- return element;
608
- }
609
-
610
- if (!parsedDataUri) {
611
- return element;
612
- }
613
-
614
- element.content = parsedDataUri.data;
615
- element.contentType = element.contentType || parsedDataUri.contentType;
616
-
617
- if ('path' in element) {
618
- element.path = false;
619
- }
620
-
621
- if ('href' in element) {
622
- element.href = false;
623
- }
624
-
625
- return element;
626
- }
627
- }
628
-
629
- module.exports = MailComposer;