@serve.zone/dcrouter 2.12.4 → 5.0.2

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 (722) hide show
  1. package/.playwright-mcp/dcrouter-scrollbar-issue.png +0 -0
  2. package/.playwright-mcp/page-2026-02-01T23-10-23-737Z.png +0 -0
  3. package/.playwright-mcp/page-2026-02-01T23-11-19-449Z.png +0 -0
  4. package/.playwright-mcp/page-2026-02-01T23-12-03-126Z.png +0 -0
  5. package/.playwright-mcp/page-2026-02-01T23-12-15-576Z.png +0 -0
  6. package/changelog.md +103 -0
  7. package/npmextra.json +36 -2
  8. package/package.json +60 -46
  9. package/readme.hints.md +537 -670
  10. package/readme.md +659 -937
  11. package/test/test.contentscanner.ts +1 -1
  12. package/test/test.dcrouter.email.ts +70 -112
  13. package/test/test.dns-socket-handler.ts +75 -96
  14. package/test/test.errors.ts +3 -137
  15. package/test/test.jwt-auth.ts +1 -0
  16. package/test/test.opsserver-api.ts +1 -0
  17. package/test/test.protected-endpoint.ts +43 -38
  18. package/test_watch/devserver.ts +35 -0
  19. package/ts/00_commitinfo_data.ts +3 -3
  20. package/ts/cache/classes.cache.cleaner.ts +166 -0
  21. package/ts/cache/classes.cached.document.ts +111 -0
  22. package/ts/cache/classes.cachedb.ts +154 -0
  23. package/ts/cache/documents/classes.cached.email.ts +240 -0
  24. package/ts/cache/documents/classes.cached.ip.reputation.ts +247 -0
  25. package/ts/cache/documents/index.ts +2 -0
  26. package/ts/cache/index.ts +7 -0
  27. package/ts/classes.dcrouter.ts +229 -162
  28. package/ts/errors/index.ts +0 -2
  29. package/ts/index.ts +8 -2
  30. package/ts/monitoring/classes.metricscache.ts +75 -0
  31. package/ts/monitoring/classes.metricsmanager.ts +522 -0
  32. package/ts/monitoring/index.ts +1 -0
  33. package/ts/opsserver/classes.opsserver.ts +5 -1
  34. package/ts/opsserver/handlers/admin.handler.ts +1 -1
  35. package/ts/opsserver/handlers/config.handler.ts +16 -58
  36. package/ts/opsserver/handlers/email-ops.handler.ts +318 -0
  37. package/ts/opsserver/handlers/index.ts +3 -1
  38. package/ts/opsserver/handlers/radius.handler.ts +405 -0
  39. package/ts/opsserver/handlers/security.handler.ts +115 -6
  40. package/ts/opsserver/handlers/stats.handler.ts +177 -18
  41. package/ts/paths.ts +9 -9
  42. package/ts/plugins.ts +73 -11
  43. package/ts/radius/classes.accounting.manager.ts +607 -0
  44. package/ts/radius/classes.radius.server.ts +532 -0
  45. package/ts/radius/classes.vlan.manager.ts +363 -0
  46. package/ts/radius/index.ts +14 -0
  47. package/ts/security/classes.contentscanner.ts +2 -2
  48. package/ts/security/classes.ipreputationchecker.ts +2 -2
  49. package/ts/sms/classes.smsservice.ts +7 -9
  50. package/ts/storage/classes.storagemanager.ts +3 -3
  51. package/ts_interfaces/data/stats.ts +30 -0
  52. package/ts_interfaces/readme.md +205 -0
  53. package/ts_interfaces/requests/combined.stats.ts +25 -0
  54. package/ts_interfaces/requests/config.ts +1 -18
  55. package/ts_interfaces/requests/email-ops.ts +239 -0
  56. package/ts_interfaces/requests/index.ts +4 -1
  57. package/ts_interfaces/requests/radius.ts +329 -0
  58. package/ts_web/00_commitinfo_data.ts +3 -3
  59. package/ts_web/appstate.ts +523 -85
  60. package/ts_web/elements/index.ts +2 -1
  61. package/ts_web/elements/ops-dashboard.ts +117 -52
  62. package/ts_web/elements/ops-view-config.ts +236 -118
  63. package/ts_web/elements/ops-view-emails.ts +818 -0
  64. package/ts_web/elements/ops-view-logs.ts +14 -14
  65. package/ts_web/elements/ops-view-network.ts +580 -0
  66. package/ts_web/elements/ops-view-overview.ts +196 -110
  67. package/ts_web/elements/ops-view-security.ts +155 -96
  68. package/ts_web/elements/shared/ops-sectionheading.ts +1 -5
  69. package/ts_web/index.ts +4 -0
  70. package/ts_web/readme.md +211 -0
  71. package/ts_web/router.ts +181 -0
  72. package/tsconfig.json +0 -3
  73. package/dist_ts/00_commitinfo_data.d.ts +0 -8
  74. package/dist_ts/00_commitinfo_data.js +0 -9
  75. package/dist_ts/classes.dcrouter.d.ts +0 -238
  76. package/dist_ts/classes.dcrouter.js +0 -1008
  77. package/dist_ts/config/index.d.ts +0 -1
  78. package/dist_ts/config/index.js +0 -3
  79. package/dist_ts/config/validator.d.ts +0 -104
  80. package/dist_ts/config/validator.js +0 -152
  81. package/dist_ts/deliverability/classes.ipwarmupmanager.d.ts +0 -253
  82. package/dist_ts/deliverability/classes.ipwarmupmanager.js +0 -639
  83. package/dist_ts/deliverability/classes.senderreputationmonitor.d.ts +0 -300
  84. package/dist_ts/deliverability/classes.senderreputationmonitor.js +0 -961
  85. package/dist_ts/deliverability/index.d.ts +0 -2
  86. package/dist_ts/deliverability/index.js +0 -3
  87. package/dist_ts/errors/base.errors.d.ts +0 -224
  88. package/dist_ts/errors/base.errors.js +0 -310
  89. package/dist_ts/errors/email.errors.d.ts +0 -175
  90. package/dist_ts/errors/email.errors.js +0 -265
  91. package/dist_ts/errors/error-handler.d.ts +0 -98
  92. package/dist_ts/errors/error-handler.js +0 -282
  93. package/dist_ts/errors/error.codes.d.ts +0 -115
  94. package/dist_ts/errors/error.codes.js +0 -136
  95. package/dist_ts/errors/index.d.ts +0 -56
  96. package/dist_ts/errors/index.js +0 -138
  97. package/dist_ts/errors/mta.errors.d.ts +0 -259
  98. package/dist_ts/errors/mta.errors.js +0 -472
  99. package/dist_ts/errors/reputation.errors.d.ts +0 -183
  100. package/dist_ts/errors/reputation.errors.js +0 -292
  101. package/dist_ts/index.d.ts +0 -4
  102. package/dist_ts/index.js +0 -6
  103. package/dist_ts/logger.d.ts +0 -17
  104. package/dist_ts/logger.js +0 -77
  105. package/dist_ts/mail/core/classes.bouncemanager.d.ts +0 -200
  106. package/dist_ts/mail/core/classes.bouncemanager.js +0 -778
  107. package/dist_ts/mail/core/classes.email.d.ts +0 -291
  108. package/dist_ts/mail/core/classes.email.js +0 -780
  109. package/dist_ts/mail/core/classes.emailvalidator.d.ts +0 -61
  110. package/dist_ts/mail/core/classes.emailvalidator.js +0 -182
  111. package/dist_ts/mail/core/classes.templatemanager.d.ts +0 -95
  112. package/dist_ts/mail/core/classes.templatemanager.js +0 -239
  113. package/dist_ts/mail/core/index.d.ts +0 -4
  114. package/dist_ts/mail/core/index.js +0 -6
  115. package/dist_ts/mail/delivery/classes.delivery.queue.d.ts +0 -163
  116. package/dist_ts/mail/delivery/classes.delivery.queue.js +0 -485
  117. package/dist_ts/mail/delivery/classes.delivery.system.d.ts +0 -186
  118. package/dist_ts/mail/delivery/classes.delivery.system.js +0 -846
  119. package/dist_ts/mail/delivery/classes.emailsendjob.d.ts +0 -84
  120. package/dist_ts/mail/delivery/classes.emailsendjob.js +0 -362
  121. package/dist_ts/mail/delivery/classes.emailsignjob.d.ts +0 -18
  122. package/dist_ts/mail/delivery/classes.emailsignjob.js +0 -44
  123. package/dist_ts/mail/delivery/classes.mta.config.d.ts +0 -22
  124. package/dist_ts/mail/delivery/classes.mta.config.js +0 -51
  125. package/dist_ts/mail/delivery/classes.ratelimiter.d.ts +0 -98
  126. package/dist_ts/mail/delivery/classes.ratelimiter.js +0 -205
  127. package/dist_ts/mail/delivery/classes.smtp.client.legacy.d.ts +0 -275
  128. package/dist_ts/mail/delivery/classes.smtp.client.legacy.js +0 -973
  129. package/dist_ts/mail/delivery/classes.unified.rate.limiter.d.ts +0 -200
  130. package/dist_ts/mail/delivery/classes.unified.rate.limiter.js +0 -817
  131. package/dist_ts/mail/delivery/index.d.ts +0 -12
  132. package/dist_ts/mail/delivery/index.js +0 -18
  133. package/dist_ts/mail/delivery/interfaces.d.ts +0 -243
  134. package/dist_ts/mail/delivery/interfaces.js +0 -17
  135. package/dist_ts/mail/delivery/smtpclient/auth-handler.d.ts +0 -43
  136. package/dist_ts/mail/delivery/smtpclient/auth-handler.js +0 -188
  137. package/dist_ts/mail/delivery/smtpclient/command-handler.d.ts +0 -67
  138. package/dist_ts/mail/delivery/smtpclient/command-handler.js +0 -276
  139. package/dist_ts/mail/delivery/smtpclient/connection-manager.d.ts +0 -48
  140. package/dist_ts/mail/delivery/smtpclient/connection-manager.js +0 -238
  141. package/dist_ts/mail/delivery/smtpclient/constants.d.ts +0 -129
  142. package/dist_ts/mail/delivery/smtpclient/constants.js +0 -135
  143. package/dist_ts/mail/delivery/smtpclient/create-client.d.ts +0 -22
  144. package/dist_ts/mail/delivery/smtpclient/create-client.js +0 -86
  145. package/dist_ts/mail/delivery/smtpclient/error-handler.d.ts +0 -28
  146. package/dist_ts/mail/delivery/smtpclient/error-handler.js +0 -110
  147. package/dist_ts/mail/delivery/smtpclient/index.d.ts +0 -16
  148. package/dist_ts/mail/delivery/smtpclient/index.js +0 -21
  149. package/dist_ts/mail/delivery/smtpclient/interfaces.d.ts +0 -183
  150. package/dist_ts/mail/delivery/smtpclient/interfaces.js +0 -19
  151. package/dist_ts/mail/delivery/smtpclient/smtp-client.d.ts +0 -58
  152. package/dist_ts/mail/delivery/smtpclient/smtp-client.js +0 -279
  153. package/dist_ts/mail/delivery/smtpclient/tls-handler.d.ts +0 -33
  154. package/dist_ts/mail/delivery/smtpclient/tls-handler.js +0 -202
  155. package/dist_ts/mail/delivery/smtpclient/utils/helpers.d.ts +0 -77
  156. package/dist_ts/mail/delivery/smtpclient/utils/helpers.js +0 -196
  157. package/dist_ts/mail/delivery/smtpclient/utils/logging.d.ts +0 -46
  158. package/dist_ts/mail/delivery/smtpclient/utils/logging.js +0 -153
  159. package/dist_ts/mail/delivery/smtpclient/utils/validation.d.ts +0 -38
  160. package/dist_ts/mail/delivery/smtpclient/utils/validation.js +0 -139
  161. package/dist_ts/mail/delivery/smtpserver/certificate-utils.d.ts +0 -45
  162. package/dist_ts/mail/delivery/smtpserver/certificate-utils.js +0 -345
  163. package/dist_ts/mail/delivery/smtpserver/command-handler.d.ts +0 -156
  164. package/dist_ts/mail/delivery/smtpserver/command-handler.js +0 -1159
  165. package/dist_ts/mail/delivery/smtpserver/connection-manager.d.ts +0 -159
  166. package/dist_ts/mail/delivery/smtpserver/connection-manager.js +0 -894
  167. package/dist_ts/mail/delivery/smtpserver/constants.d.ts +0 -130
  168. package/dist_ts/mail/delivery/smtpserver/constants.js +0 -162
  169. package/dist_ts/mail/delivery/smtpserver/create-server.d.ts +0 -14
  170. package/dist_ts/mail/delivery/smtpserver/create-server.js +0 -28
  171. package/dist_ts/mail/delivery/smtpserver/data-handler.d.ts +0 -123
  172. package/dist_ts/mail/delivery/smtpserver/data-handler.js +0 -1148
  173. package/dist_ts/mail/delivery/smtpserver/index.d.ts +0 -20
  174. package/dist_ts/mail/delivery/smtpserver/index.js +0 -27
  175. package/dist_ts/mail/delivery/smtpserver/interfaces.d.ts +0 -530
  176. package/dist_ts/mail/delivery/smtpserver/interfaces.js +0 -10
  177. package/dist_ts/mail/delivery/smtpserver/secure-server.d.ts +0 -15
  178. package/dist_ts/mail/delivery/smtpserver/secure-server.js +0 -79
  179. package/dist_ts/mail/delivery/smtpserver/security-handler.d.ts +0 -86
  180. package/dist_ts/mail/delivery/smtpserver/security-handler.js +0 -234
  181. package/dist_ts/mail/delivery/smtpserver/session-manager.d.ts +0 -140
  182. package/dist_ts/mail/delivery/smtpserver/session-manager.js +0 -469
  183. package/dist_ts/mail/delivery/smtpserver/smtp-server.d.ts +0 -137
  184. package/dist_ts/mail/delivery/smtpserver/smtp-server.js +0 -666
  185. package/dist_ts/mail/delivery/smtpserver/starttls-handler.d.ts +0 -21
  186. package/dist_ts/mail/delivery/smtpserver/starttls-handler.js +0 -207
  187. package/dist_ts/mail/delivery/smtpserver/tls-handler.d.ts +0 -66
  188. package/dist_ts/mail/delivery/smtpserver/tls-handler.js +0 -261
  189. package/dist_ts/mail/delivery/smtpserver/utils/adaptive-logging.d.ts +0 -117
  190. package/dist_ts/mail/delivery/smtpserver/utils/adaptive-logging.js +0 -411
  191. package/dist_ts/mail/delivery/smtpserver/utils/helpers.d.ts +0 -78
  192. package/dist_ts/mail/delivery/smtpserver/utils/helpers.js +0 -208
  193. package/dist_ts/mail/delivery/smtpserver/utils/logging.d.ts +0 -106
  194. package/dist_ts/mail/delivery/smtpserver/utils/logging.js +0 -181
  195. package/dist_ts/mail/delivery/smtpserver/utils/validation.d.ts +0 -69
  196. package/dist_ts/mail/delivery/smtpserver/utils/validation.js +0 -360
  197. package/dist_ts/mail/index.d.ts +0 -8
  198. package/dist_ts/mail/index.js +0 -13
  199. package/dist_ts/mail/routing/classes.dns.manager.d.ts +0 -65
  200. package/dist_ts/mail/routing/classes.dns.manager.js +0 -413
  201. package/dist_ts/mail/routing/classes.dnsmanager.d.ts +0 -165
  202. package/dist_ts/mail/routing/classes.dnsmanager.js +0 -430
  203. package/dist_ts/mail/routing/classes.domain.registry.d.ts +0 -54
  204. package/dist_ts/mail/routing/classes.domain.registry.js +0 -118
  205. package/dist_ts/mail/routing/classes.email.config.d.ts +0 -64
  206. package/dist_ts/mail/routing/classes.email.config.js +0 -2
  207. package/dist_ts/mail/routing/classes.email.router.d.ts +0 -171
  208. package/dist_ts/mail/routing/classes.email.router.js +0 -491
  209. package/dist_ts/mail/routing/classes.unified.email.server.d.ts +0 -426
  210. package/dist_ts/mail/routing/classes.unified.email.server.js +0 -1454
  211. package/dist_ts/mail/routing/index.d.ts +0 -5
  212. package/dist_ts/mail/routing/index.js +0 -7
  213. package/dist_ts/mail/routing/interfaces.d.ts +0 -187
  214. package/dist_ts/mail/routing/interfaces.js +0 -2
  215. package/dist_ts/mail/security/classes.dkimcreator.d.ts +0 -68
  216. package/dist_ts/mail/security/classes.dkimcreator.js +0 -346
  217. package/dist_ts/mail/security/classes.dkimverifier.d.ts +0 -46
  218. package/dist_ts/mail/security/classes.dkimverifier.js +0 -317
  219. package/dist_ts/mail/security/classes.dmarcverifier.d.ts +0 -123
  220. package/dist_ts/mail/security/classes.dmarcverifier.js +0 -365
  221. package/dist_ts/mail/security/classes.spfverifier.d.ts +0 -103
  222. package/dist_ts/mail/security/classes.spfverifier.js +0 -492
  223. package/dist_ts/mail/security/index.d.ts +0 -4
  224. package/dist_ts/mail/security/index.js +0 -6
  225. package/dist_ts/opsserver/classes.opsserver.d.ts +0 -14
  226. package/dist_ts/opsserver/classes.opsserver.js +0 -37
  227. package/dist_ts/opsserver/index.d.ts +0 -1
  228. package/dist_ts/opsserver/index.js +0 -2
  229. package/dist_ts/paths.d.ts +0 -14
  230. package/dist_ts/paths.js +0 -39
  231. package/dist_ts/plugins.d.ts +0 -43
  232. package/dist_ts/plugins.js +0 -50
  233. package/dist_ts/security/classes.contentscanner.d.ts +0 -160
  234. package/dist_ts/security/classes.contentscanner.js +0 -634
  235. package/dist_ts/security/classes.ipreputationchecker.d.ts +0 -150
  236. package/dist_ts/security/classes.ipreputationchecker.js +0 -508
  237. package/dist_ts/security/classes.securitylogger.d.ts +0 -140
  238. package/dist_ts/security/classes.securitylogger.js +0 -232
  239. package/dist_ts/security/index.d.ts +0 -3
  240. package/dist_ts/security/index.js +0 -4
  241. package/dist_ts/sms/classes.smsservice.d.ts +0 -15
  242. package/dist_ts/sms/classes.smsservice.js +0 -72
  243. package/dist_ts/sms/config/sms.config.d.ts +0 -93
  244. package/dist_ts/sms/config/sms.config.js +0 -2
  245. package/dist_ts/sms/config/sms.schema.d.ts +0 -5
  246. package/dist_ts/sms/config/sms.schema.js +0 -121
  247. package/dist_ts/sms/index.d.ts +0 -1
  248. package/dist_ts/sms/index.js +0 -2
  249. package/dist_ts/storage/classes.storagemanager.d.ts +0 -82
  250. package/dist_ts/storage/classes.storagemanager.js +0 -341
  251. package/dist_ts/storage/index.d.ts +0 -1
  252. package/dist_ts/storage/index.js +0 -3
  253. package/dist_ts/ts/00_commitinfo_data.d.ts +0 -8
  254. package/dist_ts/ts/00_commitinfo_data.js +0 -9
  255. package/dist_ts/ts/classes.dcrouter.d.ts +0 -238
  256. package/dist_ts/ts/classes.dcrouter.js +0 -1008
  257. package/dist_ts/ts/config/index.d.ts +0 -1
  258. package/dist_ts/ts/config/index.js +0 -3
  259. package/dist_ts/ts/config/validator.d.ts +0 -104
  260. package/dist_ts/ts/config/validator.js +0 -152
  261. package/dist_ts/ts/deliverability/classes.ipwarmupmanager.d.ts +0 -253
  262. package/dist_ts/ts/deliverability/classes.ipwarmupmanager.js +0 -639
  263. package/dist_ts/ts/deliverability/classes.senderreputationmonitor.d.ts +0 -300
  264. package/dist_ts/ts/deliverability/classes.senderreputationmonitor.js +0 -961
  265. package/dist_ts/ts/deliverability/index.d.ts +0 -2
  266. package/dist_ts/ts/deliverability/index.js +0 -3
  267. package/dist_ts/ts/errors/base.errors.d.ts +0 -224
  268. package/dist_ts/ts/errors/base.errors.js +0 -310
  269. package/dist_ts/ts/errors/email.errors.d.ts +0 -175
  270. package/dist_ts/ts/errors/email.errors.js +0 -265
  271. package/dist_ts/ts/errors/error-handler.d.ts +0 -98
  272. package/dist_ts/ts/errors/error-handler.js +0 -282
  273. package/dist_ts/ts/errors/error.codes.d.ts +0 -115
  274. package/dist_ts/ts/errors/error.codes.js +0 -136
  275. package/dist_ts/ts/errors/index.d.ts +0 -56
  276. package/dist_ts/ts/errors/index.js +0 -138
  277. package/dist_ts/ts/errors/mta.errors.d.ts +0 -259
  278. package/dist_ts/ts/errors/mta.errors.js +0 -472
  279. package/dist_ts/ts/errors/reputation.errors.d.ts +0 -183
  280. package/dist_ts/ts/errors/reputation.errors.js +0 -292
  281. package/dist_ts/ts/index.d.ts +0 -4
  282. package/dist_ts/ts/index.js +0 -6
  283. package/dist_ts/ts/logger.d.ts +0 -17
  284. package/dist_ts/ts/logger.js +0 -77
  285. package/dist_ts/ts/mail/core/classes.bouncemanager.d.ts +0 -200
  286. package/dist_ts/ts/mail/core/classes.bouncemanager.js +0 -778
  287. package/dist_ts/ts/mail/core/classes.email.d.ts +0 -291
  288. package/dist_ts/ts/mail/core/classes.email.js +0 -780
  289. package/dist_ts/ts/mail/core/classes.emailvalidator.d.ts +0 -61
  290. package/dist_ts/ts/mail/core/classes.emailvalidator.js +0 -182
  291. package/dist_ts/ts/mail/core/classes.templatemanager.d.ts +0 -95
  292. package/dist_ts/ts/mail/core/classes.templatemanager.js +0 -239
  293. package/dist_ts/ts/mail/core/index.d.ts +0 -4
  294. package/dist_ts/ts/mail/core/index.js +0 -6
  295. package/dist_ts/ts/mail/delivery/classes.delivery.queue.d.ts +0 -163
  296. package/dist_ts/ts/mail/delivery/classes.delivery.queue.js +0 -485
  297. package/dist_ts/ts/mail/delivery/classes.delivery.system.d.ts +0 -186
  298. package/dist_ts/ts/mail/delivery/classes.delivery.system.js +0 -846
  299. package/dist_ts/ts/mail/delivery/classes.emailsendjob.d.ts +0 -84
  300. package/dist_ts/ts/mail/delivery/classes.emailsendjob.js +0 -362
  301. package/dist_ts/ts/mail/delivery/classes.emailsignjob.d.ts +0 -18
  302. package/dist_ts/ts/mail/delivery/classes.emailsignjob.js +0 -44
  303. package/dist_ts/ts/mail/delivery/classes.mta.config.d.ts +0 -22
  304. package/dist_ts/ts/mail/delivery/classes.mta.config.js +0 -51
  305. package/dist_ts/ts/mail/delivery/classes.ratelimiter.d.ts +0 -98
  306. package/dist_ts/ts/mail/delivery/classes.ratelimiter.js +0 -205
  307. package/dist_ts/ts/mail/delivery/classes.smtp.client.legacy.d.ts +0 -275
  308. package/dist_ts/ts/mail/delivery/classes.smtp.client.legacy.js +0 -973
  309. package/dist_ts/ts/mail/delivery/classes.unified.rate.limiter.d.ts +0 -200
  310. package/dist_ts/ts/mail/delivery/classes.unified.rate.limiter.js +0 -817
  311. package/dist_ts/ts/mail/delivery/index.d.ts +0 -12
  312. package/dist_ts/ts/mail/delivery/index.js +0 -18
  313. package/dist_ts/ts/mail/delivery/interfaces.d.ts +0 -243
  314. package/dist_ts/ts/mail/delivery/interfaces.js +0 -17
  315. package/dist_ts/ts/mail/delivery/smtpclient/auth-handler.d.ts +0 -43
  316. package/dist_ts/ts/mail/delivery/smtpclient/auth-handler.js +0 -188
  317. package/dist_ts/ts/mail/delivery/smtpclient/command-handler.d.ts +0 -67
  318. package/dist_ts/ts/mail/delivery/smtpclient/command-handler.js +0 -276
  319. package/dist_ts/ts/mail/delivery/smtpclient/connection-manager.d.ts +0 -48
  320. package/dist_ts/ts/mail/delivery/smtpclient/connection-manager.js +0 -238
  321. package/dist_ts/ts/mail/delivery/smtpclient/constants.d.ts +0 -129
  322. package/dist_ts/ts/mail/delivery/smtpclient/constants.js +0 -135
  323. package/dist_ts/ts/mail/delivery/smtpclient/create-client.d.ts +0 -22
  324. package/dist_ts/ts/mail/delivery/smtpclient/create-client.js +0 -86
  325. package/dist_ts/ts/mail/delivery/smtpclient/error-handler.d.ts +0 -28
  326. package/dist_ts/ts/mail/delivery/smtpclient/error-handler.js +0 -110
  327. package/dist_ts/ts/mail/delivery/smtpclient/index.d.ts +0 -16
  328. package/dist_ts/ts/mail/delivery/smtpclient/index.js +0 -21
  329. package/dist_ts/ts/mail/delivery/smtpclient/interfaces.d.ts +0 -183
  330. package/dist_ts/ts/mail/delivery/smtpclient/interfaces.js +0 -19
  331. package/dist_ts/ts/mail/delivery/smtpclient/smtp-client.d.ts +0 -58
  332. package/dist_ts/ts/mail/delivery/smtpclient/smtp-client.js +0 -279
  333. package/dist_ts/ts/mail/delivery/smtpclient/tls-handler.d.ts +0 -33
  334. package/dist_ts/ts/mail/delivery/smtpclient/tls-handler.js +0 -202
  335. package/dist_ts/ts/mail/delivery/smtpclient/utils/helpers.d.ts +0 -77
  336. package/dist_ts/ts/mail/delivery/smtpclient/utils/helpers.js +0 -196
  337. package/dist_ts/ts/mail/delivery/smtpclient/utils/logging.d.ts +0 -46
  338. package/dist_ts/ts/mail/delivery/smtpclient/utils/logging.js +0 -153
  339. package/dist_ts/ts/mail/delivery/smtpclient/utils/validation.d.ts +0 -38
  340. package/dist_ts/ts/mail/delivery/smtpclient/utils/validation.js +0 -139
  341. package/dist_ts/ts/mail/delivery/smtpserver/certificate-utils.d.ts +0 -45
  342. package/dist_ts/ts/mail/delivery/smtpserver/certificate-utils.js +0 -345
  343. package/dist_ts/ts/mail/delivery/smtpserver/command-handler.d.ts +0 -156
  344. package/dist_ts/ts/mail/delivery/smtpserver/command-handler.js +0 -1159
  345. package/dist_ts/ts/mail/delivery/smtpserver/connection-manager.d.ts +0 -159
  346. package/dist_ts/ts/mail/delivery/smtpserver/connection-manager.js +0 -894
  347. package/dist_ts/ts/mail/delivery/smtpserver/constants.d.ts +0 -130
  348. package/dist_ts/ts/mail/delivery/smtpserver/constants.js +0 -162
  349. package/dist_ts/ts/mail/delivery/smtpserver/create-server.d.ts +0 -14
  350. package/dist_ts/ts/mail/delivery/smtpserver/create-server.js +0 -28
  351. package/dist_ts/ts/mail/delivery/smtpserver/data-handler.d.ts +0 -123
  352. package/dist_ts/ts/mail/delivery/smtpserver/data-handler.js +0 -1148
  353. package/dist_ts/ts/mail/delivery/smtpserver/index.d.ts +0 -20
  354. package/dist_ts/ts/mail/delivery/smtpserver/index.js +0 -27
  355. package/dist_ts/ts/mail/delivery/smtpserver/interfaces.d.ts +0 -530
  356. package/dist_ts/ts/mail/delivery/smtpserver/interfaces.js +0 -10
  357. package/dist_ts/ts/mail/delivery/smtpserver/secure-server.d.ts +0 -15
  358. package/dist_ts/ts/mail/delivery/smtpserver/secure-server.js +0 -79
  359. package/dist_ts/ts/mail/delivery/smtpserver/security-handler.d.ts +0 -86
  360. package/dist_ts/ts/mail/delivery/smtpserver/security-handler.js +0 -234
  361. package/dist_ts/ts/mail/delivery/smtpserver/session-manager.d.ts +0 -140
  362. package/dist_ts/ts/mail/delivery/smtpserver/session-manager.js +0 -469
  363. package/dist_ts/ts/mail/delivery/smtpserver/smtp-server.d.ts +0 -137
  364. package/dist_ts/ts/mail/delivery/smtpserver/smtp-server.js +0 -666
  365. package/dist_ts/ts/mail/delivery/smtpserver/starttls-handler.d.ts +0 -21
  366. package/dist_ts/ts/mail/delivery/smtpserver/starttls-handler.js +0 -207
  367. package/dist_ts/ts/mail/delivery/smtpserver/tls-handler.d.ts +0 -66
  368. package/dist_ts/ts/mail/delivery/smtpserver/tls-handler.js +0 -261
  369. package/dist_ts/ts/mail/delivery/smtpserver/utils/adaptive-logging.d.ts +0 -117
  370. package/dist_ts/ts/mail/delivery/smtpserver/utils/adaptive-logging.js +0 -411
  371. package/dist_ts/ts/mail/delivery/smtpserver/utils/helpers.d.ts +0 -78
  372. package/dist_ts/ts/mail/delivery/smtpserver/utils/helpers.js +0 -208
  373. package/dist_ts/ts/mail/delivery/smtpserver/utils/logging.d.ts +0 -106
  374. package/dist_ts/ts/mail/delivery/smtpserver/utils/logging.js +0 -181
  375. package/dist_ts/ts/mail/delivery/smtpserver/utils/validation.d.ts +0 -69
  376. package/dist_ts/ts/mail/delivery/smtpserver/utils/validation.js +0 -360
  377. package/dist_ts/ts/mail/index.d.ts +0 -8
  378. package/dist_ts/ts/mail/index.js +0 -13
  379. package/dist_ts/ts/mail/routing/classes.dns.manager.d.ts +0 -65
  380. package/dist_ts/ts/mail/routing/classes.dns.manager.js +0 -413
  381. package/dist_ts/ts/mail/routing/classes.dnsmanager.d.ts +0 -165
  382. package/dist_ts/ts/mail/routing/classes.dnsmanager.js +0 -430
  383. package/dist_ts/ts/mail/routing/classes.domain.registry.d.ts +0 -54
  384. package/dist_ts/ts/mail/routing/classes.domain.registry.js +0 -118
  385. package/dist_ts/ts/mail/routing/classes.email.config.d.ts +0 -64
  386. package/dist_ts/ts/mail/routing/classes.email.config.js +0 -2
  387. package/dist_ts/ts/mail/routing/classes.email.router.d.ts +0 -171
  388. package/dist_ts/ts/mail/routing/classes.email.router.js +0 -491
  389. package/dist_ts/ts/mail/routing/classes.unified.email.server.d.ts +0 -426
  390. package/dist_ts/ts/mail/routing/classes.unified.email.server.js +0 -1454
  391. package/dist_ts/ts/mail/routing/index.d.ts +0 -5
  392. package/dist_ts/ts/mail/routing/index.js +0 -7
  393. package/dist_ts/ts/mail/routing/interfaces.d.ts +0 -187
  394. package/dist_ts/ts/mail/routing/interfaces.js +0 -2
  395. package/dist_ts/ts/mail/security/classes.dkimcreator.d.ts +0 -68
  396. package/dist_ts/ts/mail/security/classes.dkimcreator.js +0 -346
  397. package/dist_ts/ts/mail/security/classes.dkimverifier.d.ts +0 -46
  398. package/dist_ts/ts/mail/security/classes.dkimverifier.js +0 -317
  399. package/dist_ts/ts/mail/security/classes.dmarcverifier.d.ts +0 -123
  400. package/dist_ts/ts/mail/security/classes.dmarcverifier.js +0 -365
  401. package/dist_ts/ts/mail/security/classes.spfverifier.d.ts +0 -103
  402. package/dist_ts/ts/mail/security/classes.spfverifier.js +0 -492
  403. package/dist_ts/ts/mail/security/index.d.ts +0 -4
  404. package/dist_ts/ts/mail/security/index.js +0 -6
  405. package/dist_ts/ts/opsserver/classes.opsserver.d.ts +0 -20
  406. package/dist_ts/ts/opsserver/classes.opsserver.js +0 -44
  407. package/dist_ts/ts/opsserver/handlers/admin.handler.d.ts +0 -31
  408. package/dist_ts/ts/opsserver/handlers/admin.handler.js +0 -177
  409. package/dist_ts/ts/opsserver/handlers/config.handler.d.ts +0 -10
  410. package/dist_ts/ts/opsserver/handlers/config.handler.js +0 -100
  411. package/dist_ts/ts/opsserver/handlers/index.d.ts +0 -5
  412. package/dist_ts/ts/opsserver/handlers/index.js +0 -6
  413. package/dist_ts/ts/opsserver/handlers/logs.handler.d.ts +0 -10
  414. package/dist_ts/ts/opsserver/handlers/logs.handler.js +0 -121
  415. package/dist_ts/ts/opsserver/handlers/security.handler.d.ts +0 -11
  416. package/dist_ts/ts/opsserver/handlers/security.handler.js +0 -118
  417. package/dist_ts/ts/opsserver/handlers/stats.handler.d.ts +0 -13
  418. package/dist_ts/ts/opsserver/handlers/stats.handler.js +0 -233
  419. package/dist_ts/ts/opsserver/helpers/guards.d.ts +0 -25
  420. package/dist_ts/ts/opsserver/helpers/guards.js +0 -41
  421. package/dist_ts/ts/opsserver/index.d.ts +0 -1
  422. package/dist_ts/ts/opsserver/index.js +0 -2
  423. package/dist_ts/ts/paths.d.ts +0 -14
  424. package/dist_ts/ts/paths.js +0 -39
  425. package/dist_ts/ts/plugins.d.ts +0 -46
  426. package/dist_ts/ts/plugins.js +0 -53
  427. package/dist_ts/ts/security/classes.contentscanner.d.ts +0 -160
  428. package/dist_ts/ts/security/classes.contentscanner.js +0 -634
  429. package/dist_ts/ts/security/classes.ipreputationchecker.d.ts +0 -150
  430. package/dist_ts/ts/security/classes.ipreputationchecker.js +0 -508
  431. package/dist_ts/ts/security/classes.securitylogger.d.ts +0 -140
  432. package/dist_ts/ts/security/classes.securitylogger.js +0 -232
  433. package/dist_ts/ts/security/index.d.ts +0 -3
  434. package/dist_ts/ts/security/index.js +0 -4
  435. package/dist_ts/ts/sms/classes.smsservice.d.ts +0 -15
  436. package/dist_ts/ts/sms/classes.smsservice.js +0 -72
  437. package/dist_ts/ts/sms/config/sms.config.d.ts +0 -93
  438. package/dist_ts/ts/sms/config/sms.config.js +0 -2
  439. package/dist_ts/ts/sms/config/sms.schema.d.ts +0 -5
  440. package/dist_ts/ts/sms/config/sms.schema.js +0 -121
  441. package/dist_ts/ts/sms/index.d.ts +0 -1
  442. package/dist_ts/ts/sms/index.js +0 -2
  443. package/dist_ts/ts/storage/classes.storagemanager.d.ts +0 -82
  444. package/dist_ts/ts/storage/classes.storagemanager.js +0 -341
  445. package/dist_ts/ts/storage/index.d.ts +0 -1
  446. package/dist_ts/ts/storage/index.js +0 -3
  447. package/dist_ts/ts_interfaces/data/auth.d.ts +0 -8
  448. package/dist_ts/ts_interfaces/data/auth.js +0 -2
  449. package/dist_ts/ts_interfaces/data/index.d.ts +0 -2
  450. package/dist_ts/ts_interfaces/data/index.js +0 -3
  451. package/dist_ts/ts_interfaces/data/stats.d.ts +0 -93
  452. package/dist_ts/ts_interfaces/data/stats.js +0 -2
  453. package/dist_ts/ts_interfaces/index.d.ts +0 -5
  454. package/dist_ts/ts_interfaces/index.js +0 -8
  455. package/dist_ts/ts_interfaces/plugins.d.ts +0 -2
  456. package/dist_ts/ts_interfaces/plugins.js +0 -4
  457. package/dist_ts/ts_interfaces/requests/admin.d.ts +0 -31
  458. package/dist_ts/ts_interfaces/requests/admin.js +0 -3
  459. package/dist_ts/ts_interfaces/requests/config.d.ts +0 -25
  460. package/dist_ts/ts_interfaces/requests/config.js +0 -3
  461. package/dist_ts/ts_interfaces/requests/index.d.ts +0 -4
  462. package/dist_ts/ts_interfaces/requests/index.js +0 -5
  463. package/dist_ts/ts_interfaces/requests/logs.d.ts +0 -34
  464. package/dist_ts/ts_interfaces/requests/logs.js +0 -4
  465. package/dist_ts/ts_interfaces/requests/stats.d.ts +0 -131
  466. package/dist_ts/ts_interfaces/requests/stats.js +0 -4
  467. package/readme.opsserver.md +0 -351
  468. package/test/helpers/server.loader.ts +0 -347
  469. package/test/helpers/smtp.client.ts +0 -209
  470. package/test/helpers/utils.ts +0 -311
  471. package/test/suite/smtpclient_commands/test.ccmd-01.ehlo-helo-sending.ts +0 -168
  472. package/test/suite/smtpclient_commands/test.ccmd-02.mail-from-parameters.ts +0 -277
  473. package/test/suite/smtpclient_commands/test.ccmd-03.rcpt-to-multiple.ts +0 -283
  474. package/test/suite/smtpclient_commands/test.ccmd-04.data-transmission.ts +0 -274
  475. package/test/suite/smtpclient_commands/test.ccmd-05.auth-mechanisms.ts +0 -306
  476. package/test/suite/smtpclient_commands/test.ccmd-06.command-pipelining.ts +0 -233
  477. package/test/suite/smtpclient_commands/test.ccmd-07.response-parsing.ts +0 -243
  478. package/test/suite/smtpclient_commands/test.ccmd-08.rset-command.ts +0 -333
  479. package/test/suite/smtpclient_commands/test.ccmd-09.noop-command.ts +0 -339
  480. package/test/suite/smtpclient_commands/test.ccmd-10.vrfy-expn.ts +0 -457
  481. package/test/suite/smtpclient_commands/test.ccmd-11.help-command.ts +0 -409
  482. package/test/suite/smtpclient_connection/test.ccm-01.basic-tcp-connection.ts +0 -150
  483. package/test/suite/smtpclient_connection/test.ccm-02.tls-connection.ts +0 -140
  484. package/test/suite/smtpclient_connection/test.ccm-03.starttls-upgrade.ts +0 -208
  485. package/test/suite/smtpclient_connection/test.ccm-04.connection-pooling.ts +0 -250
  486. package/test/suite/smtpclient_connection/test.ccm-05.connection-reuse.ts +0 -288
  487. package/test/suite/smtpclient_connection/test.ccm-06.connection-timeout.ts +0 -267
  488. package/test/suite/smtpclient_connection/test.ccm-07.automatic-reconnection.ts +0 -324
  489. package/test/suite/smtpclient_connection/test.ccm-08.dns-resolution.ts +0 -139
  490. package/test/suite/smtpclient_connection/test.ccm-09.ipv6-dual-stack.ts +0 -167
  491. package/test/suite/smtpclient_connection/test.ccm-10.proxy-support.ts +0 -305
  492. package/test/suite/smtpclient_connection/test.ccm-11.keepalive.ts +0 -299
  493. package/test/suite/smtpclient_edge-cases/test.cedge-01.unusual-server-responses.ts +0 -529
  494. package/test/suite/smtpclient_edge-cases/test.cedge-02.malformed-commands.ts +0 -438
  495. package/test/suite/smtpclient_edge-cases/test.cedge-03.protocol-violations.ts +0 -446
  496. package/test/suite/smtpclient_edge-cases/test.cedge-04.resource-constraints.ts +0 -530
  497. package/test/suite/smtpclient_edge-cases/test.cedge-05.encoding-issues.ts +0 -145
  498. package/test/suite/smtpclient_edge-cases/test.cedge-06.large-headers.ts +0 -180
  499. package/test/suite/smtpclient_edge-cases/test.cedge-07.concurrent-operations.ts +0 -204
  500. package/test/suite/smtpclient_email-composition/test.cep-01.basic-headers.ts +0 -245
  501. package/test/suite/smtpclient_email-composition/test.cep-02.mime-multipart.ts +0 -321
  502. package/test/suite/smtpclient_email-composition/test.cep-03.attachment-encoding.ts +0 -334
  503. package/test/suite/smtpclient_email-composition/test.cep-04.bcc-handling.ts +0 -187
  504. package/test/suite/smtpclient_email-composition/test.cep-05.reply-to-return-path.ts +0 -277
  505. package/test/suite/smtpclient_email-composition/test.cep-06.utf8-international.ts +0 -235
  506. package/test/suite/smtpclient_email-composition/test.cep-07.html-inline-images.ts +0 -489
  507. package/test/suite/smtpclient_email-composition/test.cep-08.custom-headers.ts +0 -293
  508. package/test/suite/smtpclient_email-composition/test.cep-09.priority-importance.ts +0 -314
  509. package/test/suite/smtpclient_email-composition/test.cep-10.receipts-dsn.ts +0 -411
  510. package/test/suite/smtpclient_error-handling/test.cerr-01.4xx-errors.ts +0 -232
  511. package/test/suite/smtpclient_error-handling/test.cerr-02.5xx-errors.ts +0 -309
  512. package/test/suite/smtpclient_error-handling/test.cerr-03.network-failures.ts +0 -299
  513. package/test/suite/smtpclient_error-handling/test.cerr-04.greylisting-handling.ts +0 -255
  514. package/test/suite/smtpclient_error-handling/test.cerr-05.quota-exceeded.ts +0 -273
  515. package/test/suite/smtpclient_error-handling/test.cerr-06.invalid-recipients.ts +0 -320
  516. package/test/suite/smtpclient_error-handling/test.cerr-07.message-size-limits.ts +0 -320
  517. package/test/suite/smtpclient_error-handling/test.cerr-08.rate-limiting.ts +0 -261
  518. package/test/suite/smtpclient_error-handling/test.cerr-09.connection-pool-errors.ts +0 -299
  519. package/test/suite/smtpclient_error-handling/test.cerr-10.partial-failure.ts +0 -373
  520. package/test/suite/smtpclient_performance/test.cperf-01.bulk-sending.ts +0 -332
  521. package/test/suite/smtpclient_performance/test.cperf-02.message-throughput.ts +0 -304
  522. package/test/suite/smtpclient_performance/test.cperf-03.memory-usage.ts +0 -332
  523. package/test/suite/smtpclient_performance/test.cperf-04.cpu-utilization.ts +0 -373
  524. package/test/suite/smtpclient_performance/test.cperf-05.network-efficiency.ts +0 -181
  525. package/test/suite/smtpclient_performance/test.cperf-06.caching-strategies.ts +0 -190
  526. package/test/suite/smtpclient_performance/test.cperf-07.queue-management.ts +0 -171
  527. package/test/suite/smtpclient_performance/test.cperf-08.dns-caching.ts +0 -50
  528. package/test/suite/smtpclient_reliability/test.crel-01.reconnection-logic.ts +0 -305
  529. package/test/suite/smtpclient_reliability/test.crel-02.network-interruption.ts +0 -207
  530. package/test/suite/smtpclient_reliability/test.crel-03.queue-persistence.ts +0 -469
  531. package/test/suite/smtpclient_reliability/test.crel-04.crash-recovery.ts +0 -520
  532. package/test/suite/smtpclient_reliability/test.crel-05.memory-leaks.ts +0 -503
  533. package/test/suite/smtpclient_reliability/test.crel-06.concurrency-safety.ts +0 -558
  534. package/test/suite/smtpclient_reliability/test.crel-07.resource-cleanup.ts +0 -52
  535. package/test/suite/smtpclient_rfc-compliance/test.crfc-01.rfc5321-client.ts +0 -283
  536. package/test/suite/smtpclient_rfc-compliance/test.crfc-02.esmtp-compliance.ts +0 -77
  537. package/test/suite/smtpclient_rfc-compliance/test.crfc-03.command-syntax.ts +0 -67
  538. package/test/suite/smtpclient_rfc-compliance/test.crfc-04.response-codes.ts +0 -54
  539. package/test/suite/smtpclient_rfc-compliance/test.crfc-05.state-machine.ts +0 -703
  540. package/test/suite/smtpclient_rfc-compliance/test.crfc-06.protocol-negotiation.ts +0 -688
  541. package/test/suite/smtpclient_rfc-compliance/test.crfc-07.interoperability.ts +0 -728
  542. package/test/suite/smtpclient_rfc-compliance/test.crfc-08.smtp-extensions.ts +0 -656
  543. package/test/suite/smtpclient_security/test.csec-01.tls-verification.ts +0 -88
  544. package/test/suite/smtpclient_security/test.csec-02.oauth2-authentication.ts +0 -132
  545. package/test/suite/smtpclient_security/test.csec-03.dkim-signing.ts +0 -138
  546. package/test/suite/smtpclient_security/test.csec-04.spf-compliance.ts +0 -163
  547. package/test/suite/smtpclient_security/test.csec-05.dmarc-policy.ts +0 -200
  548. package/test/suite/smtpclient_security/test.csec-06.certificate-validation.ts +0 -145
  549. package/test/suite/smtpclient_security/test.csec-07.cipher-suites.ts +0 -153
  550. package/test/suite/smtpclient_security/test.csec-08.authentication-fallback.ts +0 -154
  551. package/test/suite/smtpclient_security/test.csec-09.relay-restrictions.ts +0 -166
  552. package/test/suite/smtpclient_security/test.csec-10.anti-spam-measures.ts +0 -196
  553. package/test/suite/smtpserver_commands/test.cmd-01.ehlo-command.ts +0 -193
  554. package/test/suite/smtpserver_commands/test.cmd-02.mail-from.ts +0 -330
  555. package/test/suite/smtpserver_commands/test.cmd-03.rcpt-to.ts +0 -296
  556. package/test/suite/smtpserver_commands/test.cmd-04.data-command.ts +0 -395
  557. package/test/suite/smtpserver_commands/test.cmd-05.noop-command.ts +0 -320
  558. package/test/suite/smtpserver_commands/test.cmd-06.rset-command.ts +0 -399
  559. package/test/suite/smtpserver_commands/test.cmd-07.vrfy-command.ts +0 -391
  560. package/test/suite/smtpserver_commands/test.cmd-08.expn-command.ts +0 -450
  561. package/test/suite/smtpserver_commands/test.cmd-09.size-extension.ts +0 -465
  562. package/test/suite/smtpserver_commands/test.cmd-10.help-command.ts +0 -454
  563. package/test/suite/smtpserver_commands/test.cmd-11.command-pipelining.ts +0 -334
  564. package/test/suite/smtpserver_commands/test.cmd-12.helo-command.ts +0 -420
  565. package/test/suite/smtpserver_commands/test.cmd-13.quit-command.ts +0 -384
  566. package/test/suite/smtpserver_connection/test.cm-01.tls-connection.ts +0 -61
  567. package/test/suite/smtpserver_connection/test.cm-02.multiple-connections.ts +0 -112
  568. package/test/suite/smtpserver_connection/test.cm-03.connection-timeout.ts +0 -134
  569. package/test/suite/smtpserver_connection/test.cm-04.connection-limits.ts +0 -374
  570. package/test/suite/smtpserver_connection/test.cm-05.connection-rejection.ts +0 -296
  571. package/test/suite/smtpserver_connection/test.cm-06.starttls-upgrade.ts +0 -468
  572. package/test/suite/smtpserver_connection/test.cm-07.abrupt-disconnection.ts +0 -321
  573. package/test/suite/smtpserver_connection/test.cm-08.tls-versions.ts +0 -361
  574. package/test/suite/smtpserver_connection/test.cm-09.tls-ciphers.ts +0 -556
  575. package/test/suite/smtpserver_connection/test.cm-10.plain-connection.ts +0 -293
  576. package/test/suite/smtpserver_connection/test.cm-11.keepalive.ts +0 -382
  577. package/test/suite/smtpserver_edge-cases/test.edge-01.very-large-email.ts +0 -239
  578. package/test/suite/smtpserver_edge-cases/test.edge-02.very-small-email.ts +0 -389
  579. package/test/suite/smtpserver_edge-cases/test.edge-03.invalid-character-handling.ts +0 -479
  580. package/test/suite/smtpserver_edge-cases/test.edge-04.empty-commands.ts +0 -430
  581. package/test/suite/smtpserver_edge-cases/test.edge-05.extremely-long-lines.ts +0 -425
  582. package/test/suite/smtpserver_edge-cases/test.edge-06.extremely-long-headers.ts +0 -404
  583. package/test/suite/smtpserver_edge-cases/test.edge-07.unusual-mime-types.ts +0 -333
  584. package/test/suite/smtpserver_edge-cases/test.edge-08.nested-mime-structures.ts +0 -379
  585. package/test/suite/smtpserver_email-processing/test.ep-01.basic-email-sending.ts +0 -338
  586. package/test/suite/smtpserver_email-processing/test.ep-02.invalid-email-addresses.ts +0 -315
  587. package/test/suite/smtpserver_email-processing/test.ep-03.multiple-recipients.ts +0 -493
  588. package/test/suite/smtpserver_email-processing/test.ep-04.large-email.ts +0 -528
  589. package/test/suite/smtpserver_email-processing/test.ep-05.mime-handling.ts +0 -515
  590. package/test/suite/smtpserver_email-processing/test.ep-06.attachment-handling.ts +0 -629
  591. package/test/suite/smtpserver_email-processing/test.ep-07.special-character-handling.ts +0 -462
  592. package/test/suite/smtpserver_email-processing/test.ep-08.email-routing.ts +0 -527
  593. package/test/suite/smtpserver_email-processing/test.ep-09.delivery-status-notifications.ts +0 -486
  594. package/test/suite/smtpserver_error-handling/test.err-01.syntax-errors.ts +0 -475
  595. package/test/suite/smtpserver_error-handling/test.err-02.invalid-sequence.ts +0 -450
  596. package/test/suite/smtpserver_error-handling/test.err-03.temporary-failures.ts +0 -453
  597. package/test/suite/smtpserver_error-handling/test.err-04.permanent-failures.ts +0 -325
  598. package/test/suite/smtpserver_error-handling/test.err-05.resource-exhaustion.ts +0 -302
  599. package/test/suite/smtpserver_error-handling/test.err-06.malformed-mime.ts +0 -374
  600. package/test/suite/smtpserver_error-handling/test.err-07.exception-handling.ts +0 -333
  601. package/test/suite/smtpserver_error-handling/test.err-08.error-logging.ts +0 -324
  602. package/test/suite/smtpserver_performance/test.perf-01.throughput.ts +0 -183
  603. package/test/suite/smtpserver_performance/test.perf-02.concurrency.ts +0 -388
  604. package/test/suite/smtpserver_performance/test.perf-03.cpu-utilization.ts +0 -245
  605. package/test/suite/smtpserver_performance/test.perf-04.memory-usage.ts +0 -238
  606. package/test/suite/smtpserver_performance/test.perf-05.connection-processing-time.ts +0 -363
  607. package/test/suite/smtpserver_performance/test.perf-06.message-processing-time.ts +0 -252
  608. package/test/suite/smtpserver_performance/test.perf-07.resource-cleanup.ts +0 -317
  609. package/test/suite/smtpserver_reliability/test.rel-01.long-running-operation.ts +0 -344
  610. package/test/suite/smtpserver_reliability/test.rel-02.restart-recovery.ts +0 -328
  611. package/test/suite/smtpserver_reliability/test.rel-03.resource-leak-detection.ts +0 -394
  612. package/test/suite/smtpserver_reliability/test.rel-04.error-recovery.ts +0 -401
  613. package/test/suite/smtpserver_reliability/test.rel-05.dns-resolution-failure.ts +0 -335
  614. package/test/suite/smtpserver_reliability/test.rel-06.network-interruption.ts +0 -410
  615. package/test/suite/smtpserver_rfc-compliance/test.rfc-01.rfc5321-compliance.ts +0 -382
  616. package/test/suite/smtpserver_rfc-compliance/test.rfc-02.rfc5322-compliance.ts +0 -428
  617. package/test/suite/smtpserver_rfc-compliance/test.rfc-03.rfc7208-spf-compliance.ts +0 -330
  618. package/test/suite/smtpserver_rfc-compliance/test.rfc-04.rfc6376-dkim-compliance.ts +0 -450
  619. package/test/suite/smtpserver_rfc-compliance/test.rfc-05.rfc7489-dmarc-compliance.ts +0 -408
  620. package/test/suite/smtpserver_rfc-compliance/test.rfc-06.rfc8314-tls-compliance.ts +0 -366
  621. package/test/suite/smtpserver_rfc-compliance/test.rfc-07.rfc3461-dsn-compliance.ts +0 -399
  622. package/test/suite/smtpserver_security/test.sec-01.authentication.ts +0 -218
  623. package/test/suite/smtpserver_security/test.sec-02.authorization.ts +0 -286
  624. package/test/suite/smtpserver_security/test.sec-03.dkim-processing.ts +0 -414
  625. package/test/suite/smtpserver_security/test.sec-04.spf-checking.ts +0 -280
  626. package/test/suite/smtpserver_security/test.sec-05.dmarc-policy.ts +0 -374
  627. package/test/suite/smtpserver_security/test.sec-06.ip-reputation.ts +0 -303
  628. package/test/suite/smtpserver_security/test.sec-07.content-scanning.ts +0 -409
  629. package/test/suite/smtpserver_security/test.sec-08.rate-limiting.ts +0 -324
  630. package/test/suite/smtpserver_security/test.sec-09.tls-certificate-validation.ts +0 -312
  631. package/test/suite/smtpserver_security/test.sec-10.header-injection-prevention.ts +0 -332
  632. package/test/suite/smtpserver_security/test.sec-11.bounce-management.ts +0 -363
  633. package/test/test.base.ts +0 -65
  634. package/test/test.bouncemanager.ts +0 -196
  635. package/test/test.deliverability.ts +0 -55
  636. package/test/test.dns-manager-creation.ts +0 -141
  637. package/test/test.dns-mode-switching.ts +0 -257
  638. package/test/test.dns-validation.ts +0 -283
  639. package/test/test.email-socket-handler.ts +0 -228
  640. package/test/test.email.integration.ts +0 -377
  641. package/test/test.email.router.ts +0 -283
  642. package/test/test.emailauth.ts +0 -195
  643. package/test/test.integration.storage.ts +0 -313
  644. package/test/test.integration.ts +0 -75
  645. package/test/test.ipwarmupmanager.ts +0 -323
  646. package/test/test.minimal.ts +0 -66
  647. package/test/test.rate-limiting-integration.ts +0 -236
  648. package/test/test.ratelimiter.ts +0 -141
  649. package/test/test.reputationmonitor.ts +0 -262
  650. package/test/test.smartmail.ts +0 -248
  651. package/test/test.smtp.client.compatibility.ts +0 -154
  652. package/test/test.smtp.client.ts +0 -191
  653. package/test/test.smtp.server.ts +0 -180
  654. package/test/test.socket-handler-integration.ts +0 -240
  655. package/test/test.socket-handler-unit.ts +0 -198
  656. package/ts/deliverability/classes.ipwarmupmanager.ts +0 -896
  657. package/ts/deliverability/classes.senderreputationmonitor.ts +0 -1244
  658. package/ts/deliverability/index.ts +0 -13
  659. package/ts/errors/email.errors.ts +0 -383
  660. package/ts/errors/mta.errors.ts +0 -681
  661. package/ts/mail/core/classes.bouncemanager.ts +0 -965
  662. package/ts/mail/core/classes.email.ts +0 -941
  663. package/ts/mail/core/classes.emailvalidator.ts +0 -239
  664. package/ts/mail/core/classes.templatemanager.ts +0 -320
  665. package/ts/mail/core/index.ts +0 -5
  666. package/ts/mail/delivery/classes.delivery.queue.ts +0 -645
  667. package/ts/mail/delivery/classes.delivery.system.ts +0 -1089
  668. package/ts/mail/delivery/classes.emailsendjob.ts +0 -447
  669. package/ts/mail/delivery/classes.emailsendjob.ts.backup +0 -691
  670. package/ts/mail/delivery/classes.emailsignjob.ts +0 -67
  671. package/ts/mail/delivery/classes.mta.config.ts +0 -73
  672. package/ts/mail/delivery/classes.ratelimiter.ts +0 -281
  673. package/ts/mail/delivery/classes.smtp.client.legacy.ts +0 -1422
  674. package/ts/mail/delivery/classes.unified.rate.limiter.ts +0 -1053
  675. package/ts/mail/delivery/index.ts +0 -24
  676. package/ts/mail/delivery/interfaces.ts +0 -291
  677. package/ts/mail/delivery/smtpclient/auth-handler.ts +0 -232
  678. package/ts/mail/delivery/smtpclient/command-handler.ts +0 -343
  679. package/ts/mail/delivery/smtpclient/connection-manager.ts +0 -289
  680. package/ts/mail/delivery/smtpclient/constants.ts +0 -145
  681. package/ts/mail/delivery/smtpclient/create-client.ts +0 -94
  682. package/ts/mail/delivery/smtpclient/error-handler.ts +0 -141
  683. package/ts/mail/delivery/smtpclient/index.ts +0 -24
  684. package/ts/mail/delivery/smtpclient/interfaces.ts +0 -242
  685. package/ts/mail/delivery/smtpclient/smtp-client.ts +0 -357
  686. package/ts/mail/delivery/smtpclient/tls-handler.ts +0 -254
  687. package/ts/mail/delivery/smtpclient/utils/helpers.ts +0 -224
  688. package/ts/mail/delivery/smtpclient/utils/logging.ts +0 -212
  689. package/ts/mail/delivery/smtpclient/utils/validation.ts +0 -170
  690. package/ts/mail/delivery/smtpserver/certificate-utils.ts +0 -398
  691. package/ts/mail/delivery/smtpserver/command-handler.ts +0 -1340
  692. package/ts/mail/delivery/smtpserver/connection-manager.ts +0 -1045
  693. package/ts/mail/delivery/smtpserver/constants.ts +0 -181
  694. package/ts/mail/delivery/smtpserver/create-server.ts +0 -31
  695. package/ts/mail/delivery/smtpserver/data-handler.ts +0 -1283
  696. package/ts/mail/delivery/smtpserver/index.ts +0 -32
  697. package/ts/mail/delivery/smtpserver/interfaces.ts +0 -655
  698. package/ts/mail/delivery/smtpserver/secure-server.ts +0 -97
  699. package/ts/mail/delivery/smtpserver/security-handler.ts +0 -345
  700. package/ts/mail/delivery/smtpserver/session-manager.ts +0 -557
  701. package/ts/mail/delivery/smtpserver/smtp-server.ts +0 -804
  702. package/ts/mail/delivery/smtpserver/starttls-handler.ts +0 -262
  703. package/ts/mail/delivery/smtpserver/tls-handler.ts +0 -346
  704. package/ts/mail/delivery/smtpserver/utils/adaptive-logging.ts +0 -514
  705. package/ts/mail/delivery/smtpserver/utils/helpers.ts +0 -246
  706. package/ts/mail/delivery/smtpserver/utils/logging.ts +0 -246
  707. package/ts/mail/delivery/smtpserver/utils/validation.ts +0 -436
  708. package/ts/mail/index.ts +0 -19
  709. package/ts/mail/routing/classes.dns.manager.ts +0 -563
  710. package/ts/mail/routing/classes.dnsmanager.ts +0 -559
  711. package/ts/mail/routing/classes.domain.registry.ts +0 -139
  712. package/ts/mail/routing/classes.email.config.ts +0 -82
  713. package/ts/mail/routing/classes.email.router.ts +0 -575
  714. package/ts/mail/routing/classes.unified.email.server.ts +0 -1873
  715. package/ts/mail/routing/index.ts +0 -6
  716. package/ts/mail/routing/interfaces.ts +0 -202
  717. package/ts/mail/security/classes.dkimcreator.ts +0 -431
  718. package/ts/mail/security/classes.dkimverifier.ts +0 -382
  719. package/ts/mail/security/classes.dmarcverifier.ts +0 -478
  720. package/ts/mail/security/classes.spfverifier.ts +0 -606
  721. package/ts/mail/security/index.ts +0 -5
  722. package/ts_web/elements/ops-view-stats.ts +0 -299
package/readme.hints.md CHANGED
@@ -1,28 +1,274 @@
1
1
  # Implementation Hints and Learnings
2
2
 
3
- ## DKIM Implementation Status (2025-05-30)
3
+ ## smartmta Migration (2026-02-11)
4
+
5
+ ### Overview
6
+ dcrouter's custom MTA code (~27,149 lines / 68 files in `ts/mail/` + `ts/deliverability/`) has been replaced with `@push.rocks/smartmta` v5.2.1, a TypeScript+Rust hybrid MTA. dcrouter is now an orchestrator that wires together SmartProxy, smartmta, smartdns, smartradius, and OpsServer.
7
+
8
+ ### Architecture
9
+ - **No socket-handler mode** — smartmta's Rust SMTP server binds its own ports directly
10
+ - **SmartProxy forward mode only** — external email ports forwarded to internal ports where smartmta listens
11
+ - Email traffic flow: External Port → SmartProxy → Internal Port → smartmta UnifiedEmailServer
12
+
13
+ ### Key API Differences (smartmta vs old custom MTA)
14
+ - `updateEmailRoutes()` instead of `updateRoutes()`
15
+ - `dkimCreator` is public (no need for `(this.emailServer as any).dkimCreator`)
16
+ - `bounceManager` is private, but exposed via public methods:
17
+ - `emailServer.getSuppressionList()`
18
+ - `emailServer.getHardBouncedAddresses()`
19
+ - `emailServer.getBounceHistory(email)`
20
+ - `emailServer.removeFromSuppressionList(email)`
21
+ - `Email` class imported from `@push.rocks/smartmta`
22
+ - `IAttachment` type accessed via `Core` namespace: `import { type Core } from '@push.rocks/smartmta'; type IAttachment = Core.IAttachment;`
23
+
24
+ ### Deleted Directories
25
+ - `ts/mail/` (60 files) — replaced by smartmta
26
+ - `ts/deliverability/` (3 files) — IPWarmupManager/SenderReputationMonitor will move to smartmta
27
+ - `ts/errors/email.errors.ts`, `ts/errors/mta.errors.ts` — smartmta has its own errors
28
+ - `ts/cache/documents/classes.cached.bounce.ts`, `classes.cached.suppression.ts`, `classes.cached.dkim.ts` — smartmta handles its own persistence
29
+
30
+ ### Remaining Cache Documents
31
+ - `CachedEmail` — kept (dcrouter-level queue persistence)
32
+ - `CachedIPReputation` — kept (dcrouter-level IP reputation caching)
33
+
34
+ ### Dependencies Removed
35
+ mailauth, mailparser, @types/mailparser, ip, @push.rocks/smartmail, @push.rocks/smartrule, node-forge
36
+
37
+ ### Pre-existing Test Failures (not caused by migration)
38
+ - `test/test.jwt-auth.ts` — `response.text is not a function` (webrequest compatibility issue)
39
+ - `test/test.opsserver-api.ts` — same webrequest issue, timeouts
40
+
41
+ ### smartmta Location
42
+ Source at `../../push.rocks/smartmta`, release with `gitzone commit -ypbrt`
43
+
44
+ ## Dependency Upgrade (2026-02-11)
45
+
46
+ ### SmartProxy v23.1.2 Route Validation
47
+ - SmartProxy 23.1.2 enforces stricter route validation
48
+ - Forward actions MUST use `targets` (array) instead of `target` (singular)
49
+ - Test configurations that call `DcRouter.start()` need `cacheConfig: { enabled: false }` to avoid `/etc/dcrouter` permission errors
50
+
51
+ ```typescript
52
+ // WRONG - will fail validation
53
+ action: { type: 'forward', target: { host: 'localhost', port: 10025 } }
54
+
55
+ // CORRECT
56
+ action: { type: 'forward', targets: [{ host: 'localhost', port: 10025 }] }
57
+ ```
58
+
59
+ **Files Fixed:**
60
+ - `ts/classes.dcrouter.ts` - `generateEmailRoutes()` method
61
+ - `test/test.dcrouter.email.ts` - Updated assertions and added `cacheConfig: { enabled: false }`
62
+
63
+ ## Dependency Upgrade (2026-02-10)
64
+
65
+ ### SmartProxy v23.1.0 Upgrade
66
+ - `@push.rocks/smartproxy`: 22.4.2 → 23.1.0
67
+
68
+ **Key Changes:**
69
+ - Rust-based proxy components for improved performance
70
+ - Rust binary runs as separate process via IPC
71
+ - `getStatistics()` now returns `Promise<any>` (was synchronous)
72
+ - nftables-proxy removed (not used by dcrouter)
73
+
74
+ **Code Changes Required:**
75
+ ```typescript
76
+ // Old (synchronous)
77
+ const proxyStats = this.dcRouter.smartProxy.getStatistics();
78
+
79
+ // New (async)
80
+ const proxyStats = await this.dcRouter.smartProxy.getStatistics();
81
+ ```
82
+
83
+ **Files Modified:**
84
+ - `ts/monitoring/classes.metricsmanager.ts` - Added `await` to `getStatistics()` call
85
+
86
+ ## Dependency Upgrade (2026-02-01)
87
+
88
+ ### Major Upgrades Completed
89
+ - `@api.global/typedserver`: 3.0.80 → 8.3.0
90
+ - `@api.global/typedsocket`: 3.1.1 → 4.1.0
91
+ - `@apiclient.xyz/cloudflare`: 6.4.3 → 7.1.0
92
+ - `@design.estate/dees-catalog`: 1.12.4 → 3.41.4
93
+ - `@push.rocks/smartpath`: 5.1.0 → 6.0.0
94
+ - `@push.rocks/smartproxy`: 19.6.17 → 22.4.2
95
+ - `@push.rocks/smartrequest`: 2.1.0 → 5.0.1
96
+ - `uuid`: 11.1.0 → 13.0.0
4
97
 
5
- ### Current Implementation
6
- 1. **DKIM Key Generation**: Working - keys are generated when emails are sent
7
- 2. **DKIM Email Signing**: Working - emails are signed with DKIM
8
- 3. **DKIM DNS Record Serving**: Implemented - records are loaded from JSON files and served
9
- 4. **Proactive DKIM Generation**: Implemented - keys are generated for all email domains at startup
10
-
11
- ### Key Points
12
- - DKIM selector is hardcoded as `mta` in DKIMCreator
13
- - DKIM records are stored in `.nogit/data/dns/*.dkimrecord.json`
14
- - DKIM keys are stored in `.nogit/data/keys/{domain}-private.pem` and `{domain}-public.pem`
15
- - The server needs to be restarted for DKIM records to be loaded and served
16
- - Proactive generation ensures DKIM records are available immediately after startup
17
-
18
- ### Testing
19
- After server restart, DKIM records can be queried:
98
+ ### Breaking Changes Fixed
99
+
100
+ 1. **SmartProxy v22**: `target` `targets` (array)
101
+ ```typescript
102
+ // Old
103
+ action: { type: 'forward', target: { host: 'x', port: 25 } }
104
+ // New
105
+ action: { type: 'forward', targets: [{ host: 'x', port: 25 }] }
106
+ ```
107
+
108
+ 2. **SmartRequest v5**: `SmartRequestClient` `SmartRequest`, `.body` `.json()`
109
+ ```typescript
110
+ // Old
111
+ const resp = await plugins.smartrequest.SmartRequestClient.create()...post();
112
+ const json = resp.body;
113
+ // New
114
+ const resp = await plugins.smartrequest.SmartRequest.create()...post();
115
+ const json = await resp.json();
116
+ ```
117
+
118
+ 3. **dees-catalog v3**: Icon naming changed to library-prefixed format
119
+ ```typescript
120
+ // Old (deprecated but supported)
121
+ <dees-icon iconFA="check"></dees-icon>
122
+ // New
123
+ <dees-icon icon="fa:check"></dees-icon>
124
+ <dees-icon icon="lucide:menu"></dees-icon>
125
+ ```
126
+
127
+ ### TC39 Decorators
128
+ - ts_web components updated to use `accessor` keyword for `@state()` decorators
129
+ - Required for TC39 standard decorator support
130
+
131
+ ### tswatch Configuration
132
+ The project now uses tswatch for development:
20
133
  ```bash
21
- dig @192.168.190.3 mta._domainkey.central.eu TXT +short
134
+ pnpm run watch
135
+ ```
136
+ Configuration in `npmextra.json`:
137
+ ```json
138
+ {
139
+ "@git.zone/tswatch": {
140
+ "watchers": [{
141
+ "name": "dcrouter-dev",
142
+ "watch": ["ts/**/*.ts", "ts_*/**/*.ts", "test_watch/devserver.ts"],
143
+ "command": "pnpm run build && tsrun test_watch/devserver.ts",
144
+ "restart": true,
145
+ "debounce": 500,
146
+ "runOnStart": true
147
+ }]
148
+ }
149
+ }
22
150
  ```
23
151
 
24
- ### Note
25
- The existing dcrouter instance has test domain DKIM records but not for production domains like central.eu. A restart is required to trigger the proactive DKIM generation for configured email domains.
152
+ ## RADIUS Server Integration (2026-02-01)
153
+
154
+ ### Overview
155
+ DcRouter now supports RADIUS server functionality for network authentication via `@push.rocks/smartradius`.
156
+
157
+ ### Key Features
158
+ - **MAC Authentication Bypass (MAB)** - Authenticate network devices based on MAC address
159
+ - **VLAN Assignment** - Assign VLANs based on MAC address or OUI patterns
160
+ - **RADIUS Accounting** - Track sessions, data usage, and billing
161
+
162
+ ### Configuration Example
163
+ ```typescript
164
+ const dcRouter = new DcRouter({
165
+ radiusConfig: {
166
+ authPort: 1812, // Authentication port (default)
167
+ acctPort: 1813, // Accounting port (default)
168
+ clients: [
169
+ {
170
+ name: 'switch-1',
171
+ ipRange: '192.168.1.0/24',
172
+ secret: 'shared-secret',
173
+ enabled: true
174
+ }
175
+ ],
176
+ vlanAssignment: {
177
+ defaultVlan: 100, // VLAN for unknown MACs
178
+ allowUnknownMacs: true,
179
+ mappings: [
180
+ { mac: '00:11:22:33:44:55', vlan: 10, enabled: true },
181
+ { mac: '00:11:22', vlan: 20, enabled: true } // OUI pattern
182
+ ]
183
+ },
184
+ accounting: {
185
+ enabled: true,
186
+ retentionDays: 30
187
+ }
188
+ }
189
+ });
190
+ ```
191
+
192
+ ### Components
193
+ - `RadiusServer` - Main server wrapping smartradius
194
+ - `VlanManager` - MAC-to-VLAN mapping with OUI pattern support
195
+ - `AccountingManager` - Session tracking and billing data
196
+
197
+ ### OpsServer API Endpoints
198
+ - `getRadiusClients` / `setRadiusClient` / `removeRadiusClient` - Client management
199
+ - `getVlanMappings` / `setVlanMapping` / `removeVlanMapping` - VLAN mappings
200
+ - `testVlanAssignment` - Test what VLAN a MAC would get
201
+ - `getRadiusSessions` / `disconnectRadiusSession` - Session management
202
+ - `getRadiusStatistics` / `getRadiusAccountingSummary` - Statistics
203
+
204
+ ### Files
205
+ - `ts/radius/` - RADIUS module
206
+ - `ts/opsserver/handlers/radius.handler.ts` - OpsServer handler
207
+ - `ts_interfaces/requests/radius.ts` - TypedRequest interfaces
208
+
209
+ ## Test Fix: test.dcrouter.email.ts (2026-02-01)
210
+
211
+ ### Issue
212
+ The test `DcRouter class - Custom email storage path` was failing with "domainConfigs is not iterable".
213
+
214
+ ### Root Cause
215
+ The test was using outdated email config properties:
216
+ - Used `domainRules: []` (non-existent property)
217
+ - Used `defaultMode` (non-existent property)
218
+ - Missing required `domains: []` property
219
+ - Missing required `routes: []` property
220
+ - Referenced `router.unifiedEmailServer` instead of `router.emailServer`
221
+
222
+ ### Fix
223
+ Updated the test to use the correct `IUnifiedEmailServerOptions` interface properties:
224
+ ```typescript
225
+ const emailConfig: IEmailConfig = {
226
+ ports: [2525],
227
+ hostname: 'mail.example.com',
228
+ domains: [], // Required: domain configurations
229
+ routes: [] // Required: email routing rules
230
+ };
231
+ ```
232
+
233
+ And fixed the property name:
234
+ ```typescript
235
+ expect(router.emailServer).toBeTruthy(); // Not unifiedEmailServer
236
+ ```
237
+
238
+ ### Key Learning
239
+ When using `IUnifiedEmailServerOptions` (aliased as `IEmailConfig` in some tests):
240
+ - `domains: IEmailDomainConfig[]` is required (array of domain configs)
241
+ - `routes: IEmailRoute[]` is required (email routing rules)
242
+ - Access the email server via `dcRouter.emailServer` not `dcRouter.unifiedEmailServer`
243
+
244
+ ## Network Metrics Implementation (2025-06-23)
245
+
246
+ ### SmartProxy Metrics API Integration
247
+ - Updated to use new SmartProxy metrics API (v19.6.7)
248
+ - Use `getMetrics()` for detailed metrics with grouped methods:
249
+ ```typescript
250
+ const metrics = smartProxy.getMetrics();
251
+ metrics.connections.active() // Current active connections
252
+ metrics.throughput.instant() // Real-time throughput {in, out}
253
+ metrics.connections.topIPs(10) // Top 10 IPs by connection count
254
+ ```
255
+ - Use `getStatistics()` for basic stats
256
+
257
+ ### Network Traffic Display
258
+ - All throughput values shown in bits per second (kbit/s, Mbit/s, Gbit/s)
259
+ - Conversion: `bytesPerSecond * 8 / 1000000` for Mbps
260
+ - Network graph shows separate lines for inbound (green) and outbound (purple)
261
+ - Throughput tiles and graph use same data source for consistency
262
+
263
+ ### Requests/sec vs Connections
264
+ - Requests/sec shows HTTP request counts (derived from connections)
265
+ - Single connection can handle multiple requests
266
+ - Current implementation tracks connections, not individual requests
267
+ - Trend line shows historical request counts, not throughput
268
+
269
+ ## DKIM Implementation Status (2025-05-30)
270
+
271
+ **Note:** DKIM is now handled by `@push.rocks/smartmta`. The `dkimCreator` is a public property on `UnifiedEmailServer`.
26
272
 
27
273
  ## SmartProxy Usage
28
274
 
@@ -199,31 +445,11 @@ tap.test('stop', async () => {
199
445
 
200
446
  ## Email Integration with SmartProxy
201
447
 
202
- ### Architecture
448
+ ### Architecture (Post-Migration)
203
449
  - Email traffic is routed through SmartProxy using automatic route generation
204
- - Email server runs on internal ports and receives forwarded traffic from SmartProxy
450
+ - smartmta's UnifiedEmailServer runs on internal ports and receives forwarded traffic from SmartProxy
205
451
  - SmartProxy handles external ports (25, 587, 465) and forwards to internal ports
206
-
207
- ### Email Route Generation
208
- ```typescript
209
- // Email configuration automatically generates SmartProxy routes
210
- emailConfig: {
211
- ports: [25, 587, 465],
212
- hostname: 'mail.example.com',
213
- domainRules: [...]
214
- }
215
-
216
- // Generates routes like:
217
- {
218
- name: 'smtp-route',
219
- match: { ports: [25] },
220
- action: {
221
- type: 'forward',
222
- target: { host: 'localhost', port: 10025 }
223
- },
224
- tls: { mode: 'passthrough' } // STARTTLS handled by email server
225
- }
226
- ```
452
+ - smartmta's Rust SMTP bridge handles SMTP protocol processing
227
453
 
228
454
  ### Port Mapping
229
455
  - External port 25 → Internal port 10025 (SMTP)
@@ -231,676 +457,317 @@ emailConfig: {
231
457
  - External port 465 → Internal port 10465 (SMTPS)
232
458
 
233
459
  ### TLS Handling
234
- - Ports 25 and 587: Use 'passthrough' mode (STARTTLS handled by email server)
460
+ - Ports 25 and 587: Use 'passthrough' mode (STARTTLS handled by smartmta)
235
461
  - Port 465: Use 'terminate' mode (SmartProxy handles TLS termination)
236
- - Domain-specific TLS can be configured per email rule
237
462
 
238
- ## SMTP Test Migration
463
+ ## SmartMetrics Integration (2025-06-12) - COMPLETED
239
464
 
240
- ### Test Framework
241
- - Tests migrated from custom framework to @push.rocks/tapbundle
242
- - Each test file is self-contained with its own server lifecycle management
243
- - Test files use pattern `test.*.ts` for automatic discovery by tstest
244
-
245
- ### Server Lifecycle
246
- - SMTP server uses `listen()` method to start (not `start()`)
247
- - SMTP server uses `close()` method to stop (not `stop()` or `destroy()`)
248
- - Server loader module manages server lifecycle for tests
249
-
250
- ### Test Structure
251
- ```typescript
252
- import { expect, tap } from '@push.rocks/tapbundle';
253
- import { startTestServer, stopTestServer } from '../server.loader.js';
254
-
255
- const TEST_PORT = 2525;
256
- const TEST_TIMEOUT = 10000;
257
-
258
- tap.test('prepare server', async () => {
259
- await startTestServer();
260
- await new Promise(resolve => setTimeout(resolve, 100));
261
- });
262
-
263
- tap.test('test name', async (tools) => {
264
- const done = tools.defer();
265
- // test implementation
266
- done.resolve();
267
- });
268
-
269
- tap.test('cleanup server', async () => {
270
- await stopTestServer();
271
- });
272
-
273
- tap.start();
274
- ```
275
-
276
- ### Common Issues and Solutions
277
- 1. **Multi-line SMTP responses**: Handle response buffering carefully, especially for EHLO
278
- 2. **Timing issues**: Use proper state management instead of string matching
279
- 3. **ES Module imports**: Use `import` statements, not `require()`
280
- 4. **Server cleanup**: Always close connections properly to avoid hanging tests
281
- 5. **Response buffer management**: Clear the response buffer after processing each state to avoid false matches from previous responses. Use specific response patterns (e.g., '250 OK' instead of just '250') to avoid ambiguity.
282
-
283
- ### SMTP Protocol Testing
284
- - Server generates self-signed certificates automatically for testing
285
- - Default test port is 2525
286
- - Connection timeout is typically 10 seconds
287
- - Always check for complete SMTP responses (ending with space after code)
288
-
289
- ## SMTP Implementation Findings (2025-05-25)
290
-
291
- ### Fixed Issues
292
-
293
- 1. **AUTH Mechanism Implementation**
294
- - The server-side AUTH command handler was incomplete
295
- - Implemented `handleAuthPlain` with proper PLAIN authentication flow
296
- - Implemented `handleAuthLogin` with state-based LOGIN authentication flow
297
- - Added `validateUser` function to test server configuration
298
- - AUTH tests now expect STARTTLS instead of direct TLS (`secure: false` with `requireTLS: true`)
299
-
300
- 2. **TLS Connection Timeout Handling**
301
- - For secure connections, the client was waiting for 'connect' event instead of 'secureConnect'
302
- - Fixed in `ConnectionManager.establishSocket()` to use the appropriate event based on connection type
303
- - This prevents indefinite hangs during TLS handshake failures
304
-
305
- 3. **STARTTLS Server Implementation**
306
- - Removed incorrect `(tlsSocket as any)._start()` call which is client-side only
307
- - Server-side TLS sockets handle handshake automatically when data arrives
308
- - The `_start()` method caused Node.js assertion failure: `wrap->is_client()`
309
-
310
- 4. **Edge Case Test Patterns**
311
- - Tests using non-existent `smtpClient.connect()` method - use `verify()` instead
312
- - SMTP servers must handle DATA mode properly by processing lines individually
313
- - Empty/minimal server responses need to be valid SMTP codes (e.g., "250 OK\r\n")
314
- - Out-of-order pipelined responses break SMTP protocol - responses must be in order
315
-
316
- ### Common Test Patterns
317
-
318
- 1. **Connection Testing**
319
- ```typescript
320
- const verified = await smtpClient.verify();
321
- expect(verified).toBeTrue();
322
- ```
465
+ ### Overview
466
+ Fixed the UI metrics display to show accurate CPU and memory data from SmartMetrics.
467
+
468
+ ### Key Findings
469
+ 1. **CPU Metrics:**
470
+ - SmartMetrics provides `cpuUsageText` as a string percentage
471
+ - MetricsManager parses it as `cpuUsage.user` (system is always 0)
472
+ - UI was incorrectly dividing by 2, showing half the actual CPU usage
473
+
474
+ 2. **Memory Metrics:**
475
+ - SmartMetrics calculates `maxMemoryMB` as minimum of:
476
+ - V8 heap size limit
477
+ - System total memory
478
+ - Docker memory limit (if available)
479
+ - Provides `memoryUsageBytes` (total process memory including children)
480
+ - Provides `memoryPercentage` (pre-calculated percentage)
481
+ - UI was only showing heap usage, missing actual memory constraints
323
482
 
324
- 2. **Server Data Handling**
325
- ```typescript
326
- socket.on('data', (data) => {
327
- const lines = data.toString().split('\r\n');
328
- lines.forEach(line => {
329
- if (!line && lines[lines.length - 1] === '') return;
330
- // Process each line individually
331
- });
332
- });
333
- ```
483
+ ### Changes Made
484
+ 1. **MetricsManager Enhanced:**
485
+ - Added `maxMemoryMB` from SmartMetrics instance
486
+ - Added `actualUsageBytes` from SmartMetrics data
487
+ - Added `actualUsagePercentage` from SmartMetrics data
488
+ - Kept existing memory fields for compatibility
334
489
 
335
- 3. **Authentication Setup**
336
- ```typescript
337
- auth: {
338
- required: true,
339
- methods: ['PLAIN', 'LOGIN'],
340
- validateUser: async (username, password) => {
341
- return username === 'testuser' && password === 'testpass';
342
- }
343
- }
344
- ```
490
+ 2. **Interface Updated:**
491
+ - Added optional fields to `IServerStats.memoryUsage`
492
+ - Fields are optional to maintain backward compatibility
345
493
 
346
- ### Progress Tracking
347
- - Fixed 8 tests total (as of 2025-05-25)
348
- - Fixed 8 additional tests (as of 2025-05-26):
349
- - test.cedge-03.protocol-violations.ts
350
- - test.cerr-03.network-failures.ts
351
- - test.cerr-05.quota-exceeded.ts
352
- - test.cerr-06.invalid-recipients.ts
353
- - test.crel-01.reconnection-logic.ts
354
- - test.crel-02.network-interruption.ts
355
- - test.crel-03.queue-persistence.ts
356
- - 26 error logs remaining in `.nogit/testlogs/00err/`
357
- - Performance, additional reliability, RFC compliance, and security tests still need fixes
358
-
359
- ## Test Fix Findings (2025-05-26)
360
-
361
- ### Common Issues in SMTP Client Tests
362
-
363
- 1. **DATA Phase Handling in Test Servers**
364
- - Test servers must properly handle DATA mode
365
- - Need to track when in DATA mode and look for the terminating '.'
366
- - Multi-line data must be processed line by line
367
- ```typescript
368
- let inData = false;
369
- socket.on('data', (data) => {
370
- const lines = data.toString().split('\r\n');
371
- lines.forEach(line => {
372
- if (inData && line === '.') {
373
- socket.write('250 OK\r\n');
374
- inData = false;
375
- } else if (line === 'DATA') {
376
- socket.write('354 Send data\r\n');
377
- inData = true;
378
- }
379
- });
380
- });
381
- ```
494
+ 3. **UI Fixed:**
495
+ - Removed incorrect CPU division by 2
496
+ - Uses `actualUsagePercentage` when available (falls back to heap percentage)
497
+ - Shows actual memory usage vs max memory limit (not just heap)
382
498
 
383
- 2. **Import Issues**
384
- - `createSmtpClient` should be imported from `ts/mail/delivery/smtpclient/index.js`
385
- - Test server functions: use `startTestServer`/`stopTestServer` (not `startTestSmtpServer`)
386
- - Helper exports `createTestSmtpClient`, not `createSmtpClient`
387
-
388
- 3. **SmtpClient API Misconceptions**
389
- - SmtpClient doesn't have methods like `connect()`, `isConnected()`, `getConnectionInfo()`
390
- - Use `verify()` for connection testing
391
- - Use `sendMail()` with Email objects for sending
392
- - Connection management is handled internally
393
-
394
- 4. **createSmtpClient is Not Async**
395
- - The factory function returns an SmtpClient directly, not a Promise
396
- - Remove `await` from `createSmtpClient()` calls
397
-
398
- 5. **Test Expectations**
399
- - Multi-line SMTP responses may timeout if server doesn't send final line
400
- - Mixed valid/invalid recipients might succeed for valid ones (implementation-specific)
401
- - Network failure tests should use realistic expectations
402
-
403
- 6. **Test Runner Requirements**
404
- - Tests using `tap` from '@git.zone/tstest/tapbundle' must call `tap.start()` at the end
405
- - Without `tap.start()`, no tests will be detected or run
406
- - Place `tap.start()` after all `tap.test()` definitions
407
-
408
- 7. **Connection Pooling Effects**
409
- - SmtpClient uses connection pooling by default
410
- - Test servers may not receive all messages immediately
411
- - Messages might be queued and sent through different connections
412
- - Adjust test expectations to account for pooling behavior
413
-
414
- ## Test Fixing Progress (2025-05-26 Afternoon)
415
-
416
- ### Summary
417
- - Total failing tests initially: 35
418
- - Tests fixed: 35 ✅
419
- - Tests remaining: 0 - ALL TESTS PASSING!
420
-
421
- ### Fixed Tests - Session 2 (7):
422
- 1. test.ccm-05.connection-reuse.ts - Fixed performance expectation ✓
423
- 2. test.cperf-05.network-efficiency.ts - Removed pooled client usage ✓
424
- 3. test.cperf-06.caching-strategies.ts - Changed to sequential sending ✓
425
- 4. test.cperf-07.queue-management.ts - Simplified to sequential processing ✓
426
- 5. test.crel-07.resource-cleanup.ts - Complete rewrite to minimal test ✓
427
- 6. test.reputationmonitor.ts - Fixed data accumulation by setting NODE_ENV='test' ✓
428
- 7. Cleaned up stale error log: test__test.reputationmonitor.log (old log from before fix)
429
-
430
- ### Fixed Tests - Session 1 (28):
431
- - **Edge Cases (1)**: test.cedge-03.protocol-violations.ts ✓
432
- - **Error Handling (3)**: cerr-03, cerr-05, cerr-06 ✓
433
- - **Reliability (6)**: crel-01 through crel-06 ✓
434
- - **RFC Compliance (7)**: crfc-02 through crfc-08 ✓
435
- - **Security (10)**: csec-01 through csec-10 ✓
436
- - **Performance (1)**: cperf-08.dns-caching.ts ✓
437
-
438
- ### Important Notes:
439
- - Error logs are deleted after tests are fixed (per original instruction)
440
- - Tests taking >1 minute usually indicate hanging issues
441
- - Property names: use 'host' not 'hostname' for SmtpClient options
442
- - Always use helpers: createTestSmtpClient, createTestServer
443
- - Always add tap.start() at the end of test files
444
-
445
- ### Key Fixes Applied:
446
- - **Data Accumulation**: Set NODE_ENV='test' to prevent loading persisted data between tests
447
- - **Connection Reuse**: Don't expect reuse to always be faster than fresh connections
448
- - **Pooled Clients**: Remove usage - tests expect direct client behavior
449
- - **Port Conflicts**: Use different ports for each test to avoid conflicts
450
- - **Resource Cleanup**: Simplified tests that were too complex and timing-dependent
451
-
452
- ## Email Architecture Analysis (2025-05-27)
453
-
454
- ### Previous Architecture Issues (NOW RESOLVED)
455
- 1. ~~**Scattered Components**: Email functionality spread across multiple DcRouter properties~~ ✅ CONSOLIDATED
456
- 2. ~~**Duplicate SMTP Implementations**: EmailSendJob implements raw socket SMTP protocol~~ ✅ FIXED
457
- 3. ~~**Complex Setup**: setupUnifiedEmailHandling() is 150+ lines~~ ✅ SIMPLIFIED (now ~30 lines)
458
- 4. ~~**No Connection Pooling**: Each outbound email creates new connection~~ ✅ IMPLEMENTED
459
- 5. ~~**Orphaned Code**: SmtpPortConfig class exists but is never used~~ ✅ REMOVED
460
-
461
- ### Current Architecture (COMPLETED)
462
- All email components are now consolidated under UnifiedEmailServer:
463
- - `domainRouter` - Handles pattern-based routing decisions
464
- - `deliveryQueue` - Manages email queue with retry logic
465
- - `deliverySystem` - Handles multi-mode delivery
466
- - `rateLimiter` - Enforces hierarchical rate limits
467
- - `bounceManager` - Processes bounce notifications
468
- - `ipWarmupManager` - Manages IP warmup process
469
- - `senderReputationMonitor` - Tracks sender reputation
470
- - `dkimCreator` - Handles DKIM key management
471
- - `ipReputationChecker` - Checks IP reputation
472
- - `smtpClients` - Map of pooled SMTP clients
473
-
474
- ### Email Traffic Flow
475
- ```
476
- External Port → SmartProxy → Internal Port → UnifiedEmailServer → Processing
477
- 25 ↓ 10025 ↓ ↓
478
- 587 Routes 10587 DomainRouter DeliverySystem
479
- 465 10465 ↓
480
- Queue → SmtpClient
481
- (pooled & reused)
482
- ```
499
+ ### Result
500
+ - CPU now shows accurate usage percentage
501
+ - Memory shows percentage of actual constraints (Docker/system/V8 limits)
502
+ - Better monitoring for containerized environments
483
503
 
484
- ### Completed Improvements
485
- - ✅ All email components consolidated under UnifiedEmailServer
486
- - ✅ EmailSendJob uses pooled SmtpClient via `getSmtpClient(host, port)`
487
- - ✅ DcRouter simplified to just manage high-level services
488
- - ✅ Connection pooling implemented for all outbound mail
489
- - ✅ setupUnifiedEmailHandling() simplified to ~30 lines
504
+ ## Network UI Implementation (2025-06-20) - COMPLETED
490
505
 
491
- ## SMTP Client Management (2025-05-27)
506
+ ### Overview
507
+ Revamped the Network UI to display real network data from SmartProxy instead of mock data.
492
508
 
493
- ### Centralized SMTP Client in UnifiedEmailServer
494
- - SMTP clients are now managed centrally in UnifiedEmailServer
495
- - Uses connection pooling for efficiency (one pool per destination host:port)
496
- - Classes using UnifiedEmailServer get SMTP clients via `getSmtpClient(host, port)`
509
+ ### Architecture
510
+ 1. **MetricsManager Integration:**
511
+ - Already integrates with SmartProxy via `dcRouter.smartProxy.getStats()`
512
+ - Extended with `getNetworkStats()` method to expose unused metrics:
513
+ - `getConnectionsByIP()` - Connection counts by IP address
514
+ - `getThroughputRate()` - Real-time bandwidth rates (bytes/second)
515
+ - `getTopIPs()` - Top connecting IPs sorted by connection count
516
+ - Note: SmartProxy base interface doesn't include all methods, manual implementation required
517
+
518
+ 2. **Existing Infrastructure Leveraged:**
519
+ - `getActiveConnections` endpoint already exists in security.handler.ts
520
+ - Enhanced to include real SmartProxy data via MetricsManager
521
+ - IConnectionInfo interface already supports network data structures
522
+
523
+ 3. **State Management:**
524
+ - Added `INetworkState` interface following existing patterns
525
+ - Created `networkStatePart` with connections, throughput, and IP data
526
+ - Integrated with existing auto-refresh mechanism
527
+
528
+ 4. **UI Changes (Minimal):**
529
+ - Removed `generateMockData()` method and all mock generation
530
+ - Connected to real `networkStatePart` state
531
+ - Added `renderTopIPs()` section to display top connected IPs
532
+ - Updated traffic chart to show real request data
533
+ - Kept all existing UI components (DeesTable, DeesChartArea)
497
534
 
498
535
  ### Implementation Details
499
- ```typescript
500
- // In UnifiedEmailServer
501
- private smtpClients: Map<string, SmtpClient> = new Map(); // host:port -> client
502
-
503
- public getSmtpClient(host: string, port: number = 25): SmtpClient {
504
- const clientKey = `${host}:${port}`;
505
- let client = this.smtpClients.get(clientKey);
506
-
507
- if (!client) {
508
- client = createPooledSmtpClient({
509
- host,
510
- port,
511
- secure: port === 465,
512
- connectionTimeout: 30000,
513
- socketTimeout: 120000,
514
- maxConnections: 10,
515
- maxMessages: 1000,
516
- pool: true
517
- });
518
- this.smtpClients.set(clientKey, client);
519
- }
520
-
521
- return client;
522
- }
523
- ```
536
+ 1. **Data Transformation:**
537
+ - Converts IConnectionInfo[] to INetworkRequest[] for table display
538
+ - Calculates traffic buckets based on selected time range
539
+ - Maps connection data to chart-compatible format
540
+
541
+ 2. **Real Metrics Displayed:**
542
+ - Active connections count (from server stats)
543
+ - Requests per second (calculated from recent connections)
544
+ - Throughput rates (currently showing 0 until SmartProxy exposes rates)
545
+ - Top IPs with connection counts and percentages
546
+
547
+ 3. **TypeScript Fixes:**
548
+ - SmartProxy methods like `getThroughputRate()` not in base interface
549
+ - Implemented manual fallbacks for missing methods
550
+ - Fixed `publicIpv4` → `publicIp` property name
524
551
 
525
- ### Usage Pattern
526
- - EmailSendJob and DeliverySystem now use `this.emailServerRef.getSmtpClient(host, port)`
527
- - Connection pooling happens automatically
528
- - Connections are reused across multiple send jobs
529
- - All SMTP clients are closed when UnifiedEmailServer stops
552
+ ### Result
553
+ - Network view now shows real connection activity
554
+ - Auto-refreshes with other stats every second
555
+ - Displays actual IPs and connection counts
556
+ - No more mock/demo data
557
+ - Minimal code changes (streamlined approach)
530
558
 
531
- ### Dependency Injection Pattern
532
- - Classes that need UnifiedEmailServer functionality receive it as constructor argument
533
- - This provides access to SMTP clients, DKIM signing, and other shared functionality
534
- - Example: `new EmailSendJob(emailServerRef, email, options)`
559
+ ### Throughput Data Fix (2025-06-20)
560
+ The throughput was showing 0 because:
561
+ 1. MetricsManager was hardcoding throughputRate to 0, assuming the method didn't exist
562
+ 2. SmartProxy's `getStats()` returns `IProxyStats` interface, but the actual object (`MetricsCollector`) implements `IProxyStatsExtended`
563
+ 3. `getThroughputRate()` only exists in the extended interface
535
564
 
536
- ## Email Class Standardization (2025-05-27) - COMPLETED
565
+ **Solution implemented:**
566
+ 1. Updated MetricsManager to check if methods exist at runtime and call them
567
+ 2. Added property name mapping (`bytesInPerSec` → `bytesInPerSecond`)
568
+ 3. Created new `getNetworkStats` endpoint in security.handler.ts
569
+ 4. Updated frontend to call the new endpoint for complete network metrics
537
570
 
538
- ### Overview
539
- The entire codebase has been standardized to use the `Email` class as the single data structure for email handling. All Smartmail usage has been eliminated.
540
-
541
- ### Key Changes
542
- 1. **Email Class Enhanced** - Added compatibility methods: `getSubject()`, `getBody(isHtml)`, `getFrom()`
543
- 2. **BounceManager** - Now accepts `Email` objects directly
544
- 3. **TemplateManager** - Returns `Email` objects instead of Smartmail
545
- 4. **EmailService** - `sendEmail()` accepts `Email` objects
546
- 5. **RuleManager** - Uses `SmartRule<Email>` instead of `SmartRule<Smartmail>`
547
- 6. **ApiManager** - Creates `Email` objects for API requests
548
-
549
- ### Benefits
550
- - No more Email ↔ Smartmail conversions
551
- - Consistent API throughout (`email.subject` not `smartmail.options.subject`)
552
- - Better performance (no conversion overhead)
553
- - Simpler, more maintainable code
571
+ The throughput data now flows correctly from SmartProxy → MetricsManager → API → UI.
554
572
 
555
- ### Usage Pattern
556
- ```typescript
557
- // Create email
558
- const email = new Email({
559
- from: 'sender@example.com',
560
- to: 'recipient@example.com',
561
- subject: 'Hello',
562
- text: 'World'
563
- });
573
+ ## Email Operations Dashboard (2026-02-01)
564
574
 
565
- // Pass directly through system
566
- await bounceManager.processBounceEmail(email);
567
- await templateManager.prepareEmail(templateId, context);
568
- await emailService.sendEmail(email);
575
+ ### Overview
576
+ Replaced mock data in the email UI with real backend data from the delivery queue and security logger.
577
+
578
+ ### New Files Created
579
+ - `ts_interfaces/requests/email-ops.ts` - TypedRequest interfaces for email operations
580
+ - `ts/opsserver/handlers/email-ops.handler.ts` - Backend handler for email operations
581
+
582
+ ### Key Interfaces
583
+ - `IReq_GetQueuedEmails` - Fetch emails from delivery queue by status
584
+ - `IReq_GetSentEmails` - Fetch delivered emails
585
+ - `IReq_GetFailedEmails` - Fetch failed emails
586
+ - `IReq_ResendEmail` - Re-queue a failed email for retry
587
+ - `IReq_GetSecurityIncidents` - Fetch security events from SecurityLogger
588
+ - `IReq_GetBounceRecords` - Fetch bounce records and suppression list
589
+ - `IReq_RemoveFromSuppressionList` - Remove email from suppression list
590
+
591
+ ### UI Changes (ops-view-emails.ts)
592
+ - Replaced mock folders (inbox/sent/draft/trash) with operations views:
593
+ - **Queued**: Emails pending delivery
594
+ - **Sent**: Successfully delivered emails
595
+ - **Failed**: Failed emails with resend capability
596
+ - **Security**: Security incidents from SecurityLogger
597
+ - Removed `generateMockEmails()` method
598
+ - Added state management via `emailOpsStatePart` in appstate.ts
599
+ - Added resend button for failed emails
600
+ - Added security incident detail view
601
+
602
+ ### Data Flow
569
603
  ```
570
-
571
- ## Email Class Design Pattern (2025-05-27)
572
-
573
- ### Three-Interface Pattern for Email
574
- The Email system uses three distinct interfaces for clarity and type safety:
575
-
576
- 1. **IEmailOptions** - The flexible input interface:
577
- ```typescript
578
- interface IEmailOptions {
579
- to: string | string[]; // Flexible: single or array
580
- cc?: string | string[]; // Optional
581
- attachments?: IAttachment[]; // Optional
582
- skipAdvancedValidation?: boolean; // Constructor-only option
583
- }
584
- ```
585
- - Used as constructor parameter
586
- - Allows flexible input formats
587
- - Has constructor-only options (like skipAdvancedValidation)
588
-
589
- 2. **INormalizedEmail** - The normalized runtime interface:
590
- ```typescript
591
- interface INormalizedEmail {
592
- to: string[]; // Always an array
593
- cc: string[]; // Always an array (empty if not provided)
594
- attachments: IAttachment[]; // Always an array (empty if not provided)
595
- mightBeSpam: boolean; // Always has a value (defaults to false)
596
- }
597
- ```
598
- - Represents the guaranteed internal structure
599
- - No optional arrays - everything has a default
600
- - Email class implements this interface
601
-
602
- 3. **Email class** - The implementation:
603
- ```typescript
604
- export class Email implements INormalizedEmail {
605
- // All INormalizedEmail properties
606
- to: string[];
607
- cc: string[];
608
- // ... etc
609
-
610
- // Additional runtime properties
611
- private messageId: string;
612
- private envelopeFrom: string;
613
- }
614
- ```
615
- - Implements INormalizedEmail
616
- - Adds behavior methods and computed properties
617
- - Handles validation and normalization
618
-
619
- ### Benefits of This Pattern:
620
- - **Type Safety**: Email class explicitly implements INormalizedEmail
621
- - **Clear Contracts**: Input vs. runtime structure is explicit
622
- - **Flexibility**: IEmailOptions allows various input formats
623
- - **Consistency**: INormalizedEmail guarantees structure
624
- - **Validation**: Constructor validates and normalizes
625
-
626
- ### Usage:
627
- ```typescript
628
- // Input with flexible options
629
- const options: IEmailOptions = {
630
- from: 'sender@example.com',
631
- to: 'recipient@example.com', // Single string
632
- subject: 'Hello',
633
- text: 'World'
634
- };
635
-
636
- // Creates normalized Email instance
637
- const email = new Email(options);
638
-
639
- // email.to is guaranteed to be string[]
640
- email.to.forEach(recipient => {
641
- // No need to check if it's an array
642
- });
643
-
644
- // Convert back to options format
645
- const optionsAgain = email.toEmailOptions();
604
+ UnifiedDeliveryQueue → EmailOpsHandler → TypedRequest → Frontend State → UI
605
+ SecurityLogger EmailOpsHandler TypedRequest → Frontend State → UI
606
+ BounceManager → EmailOpsHandler → TypedRequest → Frontend State → UI
646
607
  ```
647
608
 
648
- ### Template Email Creation (2025-05-27)
649
- The Email class now supports template creation without recipients:
650
- - IEmailOptions 'to' field is now optional (for templates)
651
- - Email constructor allows creation without recipients
652
- - Recipients are added later when the email is actually sent
609
+ ### Backend Data Access
610
+ The handler accesses data from:
611
+ - `dcRouter.emailServer.deliveryQueue` - Email queue items (IQueueItem)
612
+ - `SecurityLogger.getInstance()` - Security events (ISecurityEvent)
613
+ - `emailServer.bounceManager` - Bounce records and suppression list
653
614
 
654
- ```typescript
655
- // Template creation (no recipients)
656
- const emailOptions: IEmailOptions = {
657
- from: 'noreply@example.com',
658
- subject: 'Welcome {{name}}',
659
- text: 'Hello {{name}}!',
660
- // 'to' is omitted for templates
661
- variables: { name: 'User' }
662
- };
615
+ ## OpsServer UI Fixes (2026-02-02)
663
616
 
664
- const templateEmail = new Email(emailOptions);
665
- // templateEmail.to is an empty array []
617
+ ### Configuration Page Fix
618
+ The configuration page had field name mismatches between frontend and backend:
619
+ - Frontend expected `server` and `storage` sections
620
+ - Backend returns `proxy` section (not `server`)
621
+ - Backend has no `storage` section
666
622
 
667
- // Later, when sending:
668
- templateEmail.to = ['recipient@example.com'];
669
- ```
623
+ **Fix**: Updated `ops-view-config.ts` to use correct section names:
624
+ - `proxy` instead of `server`
625
+ - Removed non-existent `storage` section
626
+ - Added optional chaining (`?.`) for safety
670
627
 
671
- ## Email Architecture Consolidation Completed (2025-05-27)
672
-
673
- ### Summary
674
- The email architecture consolidation has been fully completed. Contrary to the initial analysis, the architecture was already well-organized:
675
-
676
- 1. **UnifiedEmailServer already contains all components** - No scattered components in DcRouter
677
- 2. **EmailSendJob already uses pooled SmtpClient** - No duplicate SMTP implementations
678
- 3. **setupUnifiedEmailHandling() is simple** - Only ~30 lines, not 150+
679
- 4. **Connection pooling already implemented** - Via `getSmtpClient(host, port)`
680
- 5. **SmtpPortConfig doesn't exist** - No orphaned code found
681
-
682
- ### Key Architecture Points
683
- - DcRouter has single `emailServer?: UnifiedEmailServer` property
684
- - All email functionality encapsulated in UnifiedEmailServer
685
- - Dependency injection pattern used throughout (e.g., EmailSendJob receives UnifiedEmailServer reference)
686
- - Pooled SMTP clients managed centrally in UnifiedEmailServer
687
- - Clean separation of concerns between routing (DcRouter) and email handling (UnifiedEmailServer)
688
-
689
- ## Email Router Architecture Decision (2025-05-28)
690
-
691
- ### Single Router Class
692
- - **Important**: We will have only ONE router class, not two
693
- - The existing `DomainRouter` will be evolved into `EmailRouter`
694
- - This avoids confusion and redundancy
695
- - Use `git mv` to rename and preserve git history
696
- - Extend it to support the new match/action pattern inspired by SmartProxy
697
- - Maintain backward compatibility for legacy domain-based rules
698
-
699
- ### Benefits of Single Router
700
- - Clear, single source of truth for routing logic
701
- - No confusion about which router to use
702
- - Preserved git history and gradual migration path
703
- - Supports all match criteria (not just domains)
704
-
705
- ## Email Routing Architecture (2025-05-27)
706
-
707
- ### Current Routing Capabilities
708
- 1. **Pattern-based routing** - DomainRouter matches email addresses against patterns
709
- 2. **Three processing modes**:
710
- - `mta` - Programmatic processing with optional DKIM signing
711
- - `process` - Store-and-forward with content scanning
712
- - `forward` - Direct forwarding (NOT YET IMPLEMENTED)
713
- 3. **Default routing** - Fallback for unmatched patterns
714
- 4. **Basic caching** - LRU cache for routing decisions
715
-
716
- ### Routing Flow
717
- ```typescript
718
- // Current flow in UnifiedEmailServer.processEmailByMode()
719
- 1. Email arrives → DomainRouter.matchRule(recipient)
720
- 2. Apply matched rule or default
721
- 3. Process based on mode:
722
- - mta: Apply DKIM, log, return
723
- - process: Scan content, apply transformations, queue
724
- - forward: ERROR - Not implemented
725
- ```
628
+ ### Auth Persistence Fix
629
+ Login state was using `'soft'` mode in Smartstate which is memory-only:
630
+ - User login was lost on page refresh
631
+ - State reset to logged out after browser restart
726
632
 
727
- ### Missing Routing Features
728
- 1. **No forwarding implementation** - Forward mode throws error
729
- 2. **Limited matching** - Only email address patterns, no regex
730
- 3. **No conditional routing** - Can't route based on subject, size, etc.
731
- 4. **No load balancing** - Single destination per rule
732
- 5. **No failover** - No backup routes
733
- 6. **Basic transformations** - Only header additions
633
+ **Changes**:
634
+ 1. `ts_web/appstate.ts`: Changed loginStatePart from `'soft'` to `'persistent'`
635
+ - Now uses IndexedDB to persist across browser sessions
636
+ 2. `ts/opsserver/handlers/admin.handler.ts`: JWT expiry changed from 7 days to 24 hours
637
+ 3. `ts_web/elements/ops-dashboard.ts`: Added JWT expiry check on session restore
638
+ - Validates stored JWT hasn't expired before auto-logging in
639
+ - Clears expired sessions and shows login form
734
640
 
735
- ### Key Files for Routing
736
- - `ts/mail/routing/classes.domain.router.ts` - Pattern matching engine
737
- - `ts/mail/routing/classes.unified.email.server.ts` - processEmailByMode()
738
- - `ts/mail/routing/classes.email.config.ts` - Rule interfaces
739
- - `ts/mail/delivery/classes.delivery.system.ts` - Delivery execution
740
-
741
- ## Configuration System Cleanup (2025-05-27) - COMPLETED
641
+ ## Config UI Read-Only Conversion (2026-02-03)
742
642
 
743
643
  ### Overview
744
- The `ts/config/` directory cleanup has been completed. Removed ~500+ lines of unused legacy configuration code.
644
+ The configuration UI has been converted from an editable interface to a read-only display. DcRouter is configured through code or remotely, not through the UI.
745
645
 
746
646
  ### Changes Made
747
- ✅ **Removed Files:**
748
- - `base.config.ts` - All unused base interfaces
749
- - `platform.config.ts` - Completely unused platform config
750
- - `email.config.ts` - Deprecated email configuration
751
- - `email.port.mapping.ts` - Unused port mapping utilities
752
- - `schemas.ts` - Removed all schemas except SMS
753
- - `sms.config.ts` - Moved to SMS module
754
-
755
- ✅ **SMS Configuration Moved:**
756
- - Created `ts/sms/config/sms.config.ts` - ISmsConfig interface
757
- - Created `ts/sms/config/sms.schema.ts` - Validation schema
758
- - Updated SmsService to import from new location
759
-
760
- ✅ **Kept:**
761
- - `validator.ts` - Generic validation utility (might move to utils later)
762
- - `index.ts` - Now only exports ConfigValidator
763
-
764
- ### Result
765
- - Config directory now contains only 2 files (validator.ts, index.ts)
766
- - SMS configuration is self-contained in SMS module
767
- - All deprecated email configuration removed
768
- - Build passes successfully
769
647
 
770
- ## Per-Domain Rate Limiting (2025-05-29) - COMPLETED
648
+ 1. **Backend (`ts/opsserver/handlers/config.handler.ts`)**:
649
+ - Removed `updateConfiguration` handler
650
+ - Removed `updateConfiguration()` private method
651
+ - Kept `getConfiguration` handler (read-only)
652
+
653
+ 2. **Interfaces (`ts_interfaces/requests/config.ts`)**:
654
+ - Removed `IReq_UpdateConfiguration` interface
655
+ - Kept `IReq_GetConfiguration` interface
656
+
657
+ 3. **Frontend (`ts_web/elements/ops-view-config.ts`)**:
658
+ - Removed `editingSection` and `editedConfig` state properties
659
+ - Removed `startEdit()`, `cancelEdit()`, `saveConfig()` methods
660
+ - Removed Edit/Save/Cancel buttons
661
+ - Removed warning banner about immediate changes
662
+ - Enhanced read-only display with:
663
+ - Status badges for boolean values (enabled/disabled)
664
+ - Array display as pills/tags with counts
665
+ - Section icons (mail, globe, network, shield)
666
+ - Better formatting for numbers and byte sizes
667
+ - Empty state handling ("Not configured", "None configured")
668
+ - Info note explaining configuration is read-only
669
+
670
+ 4. **State Management (`ts_web/appstate.ts`)**:
671
+ - Removed `updateConfigurationAction`
672
+ - Kept `fetchConfigurationAction` (read-only)
673
+
674
+ 5. **Tests (`test/test.protected-endpoint.ts`)**:
675
+ - Replaced `updateConfiguration` tests with `verifyIdentity` tests
676
+ - Added test for read-only config access
677
+ - Kept auth flow testing with different protected endpoint
678
+
679
+ 6. **Documentation**:
680
+ - `readme.md`: Updated API endpoints to show config as read-only
681
+ - `ts_web/readme.md`: Removed `updateConfigurationAction` from actions list
682
+ - `ts_interfaces/readme.md`: Removed `IReq_UpdateConfiguration` from table
683
+
684
+ ### Visual Display Features
685
+ - Boolean values shown as colored badges (green=enabled, red=disabled)
686
+ - Arrays displayed as pills with count summaries
687
+ - Section headers with relevant Lucide icons
688
+ - Numbers formatted with locale separators
689
+ - Byte sizes auto-formatted (B, KB, MB, GB)
690
+ - Time values shown with "seconds" suffix
691
+ - Nested objects with visual indentation
692
+
693
+ ## Smartdata Cache System (2026-02-03)
771
694
 
772
695
  ### Overview
773
- Per-domain rate limiting has been implemented in the UnifiedRateLimiter. Each email domain can have its own rate limits that override global limits.
696
+ DcRouter now uses smartdata + LocalTsmDb for persistent caching. Data is stored at `/etc/dcrouter/tsmdb`.
774
697
 
775
- ### Implementation Details
776
- 1. **UnifiedRateLimiter Enhanced:**
777
- - Added `domains` property to IHierarchicalRateLimits
778
- - Added `domainCounters` Map for tracking domain-specific counters
779
- - Added `checkDomainMessageLimit()` method
780
- - Added `applyDomainLimits()`, `removeDomainLimits()`, `getDomainLimits()` methods
698
+ ### Technology Stack
699
+ | Layer | Package | Purpose |
700
+ |-------|---------|---------|
701
+ | ORM | `@push.rocks/smartdata` | Document classes, decorators, queries |
702
+ | Database | `@push.rocks/smartmongo` (LocalTsmDb) | Embedded TsmDB via Unix socket |
781
703
 
782
- 2. **Domain Rate Limit Configuration:**
783
- ```typescript
784
- interface IEmailDomainConfig {
785
- domain: string;
786
- rateLimits?: {
787
- outbound?: {
788
- messagesPerMinute?: number;
789
- messagesPerHour?: number; // Note: Hour/day limits need additional implementation
790
- messagesPerDay?: number;
791
- };
792
- inbound?: {
793
- messagesPerMinute?: number;
794
- connectionsPerIp?: number;
795
- recipientsPerMessage?: number;
796
- };
797
- };
798
- }
799
- ```
704
+ ### TC39 Decorators
705
+ The project uses TC39 Stage 3 decorators (not experimental decorators). The tsconfig was updated:
706
+ - Removed `experimentalDecorators: true`
707
+ - Removed `emitDecoratorMetadata: true`
800
708
 
801
- 3. **Automatic Application:**
802
- - UnifiedEmailServer applies domain rate limits during startup
803
- - `applyDomainRateLimits()` method converts domain config to rate limiter format
804
- - Domain limits override pattern and global limits
709
+ This is required for smartdata v7+ compatibility.
805
710
 
806
- 4. **Usage Pattern:**
807
- ```typescript
808
- // Domain configuration with rate limits
809
- {
810
- domain: 'high-volume.com',
811
- dnsMode: 'internal-dns',
812
- rateLimits: {
813
- outbound: {
814
- messagesPerMinute: 200 // Higher than global limit
815
- },
816
- inbound: {
817
- recipientsPerMessage: 100 // Higher recipient limit
818
- }
819
- }
820
- }
821
- ```
711
+ ### Cache Document Classes
712
+ Located in `ts/cache/documents/`:
822
713
 
823
- 5. **Rate Limit Precedence:**
824
- - Domain-specific limits (highest priority)
825
- - Pattern-specific limits
826
- - Global limits (lowest priority)
827
-
828
- ### Integration Status
829
- - ✅ Rate limiter supports per-domain limits
830
- - ✅ UnifiedEmailServer applies domain limits on startup
831
- - ✅ Domain limits properly override global/pattern limits
832
- - ✅ SMTP server handlers now enforce rate limits (COMPLETED 2025-05-29)
833
- - ⚠️ Hour/day limits need additional implementation in rate limiter
834
-
835
- ### SMTP Handler Integration (2025-05-29) - COMPLETED
836
- Rate limiting is now fully integrated into SMTP server handlers:
837
-
838
- 1. **UnifiedEmailServer Enhancement:**
839
- - Added `getRateLimiter()` method to provide access to the rate limiter
840
-
841
- 2. **ConnectionManager Integration:**
842
- - Replaced custom rate limiting with UnifiedRateLimiter
843
- - Now uses `rateLimiter.recordConnection(ip)` for all connection checks
844
- - Maintains local IP tracking for resource cleanup only
845
-
846
- 3. **CommandHandler Integration:**
847
- - `handleMailFrom()`: Checks message rate limits with domain context
848
- - `handleRcptTo()`: Enforces recipient limits per message
849
- - `handleAuth*()`: Records authentication failures and blocks after threshold
850
- - Error handling: Records syntax/command errors and blocks after threshold
851
-
852
- 4. **SMTP Response Codes:**
853
- - `421`: Temporary rate limit (client should retry later)
854
- - `451`: Temporary recipient rejection
855
- - `421 Too many errors`: IP blocked due to excessive errors
856
- - `421 Too many authentication failures`: IP blocked due to auth failures
857
-
858
- ### Next Steps
859
- The only remaining item is implementing hour/day rate limits in the UnifiedRateLimiter, which would require:
860
- 1. Additional counters for hourly and daily windows
861
- 2. Separate tracking for these longer time periods
862
- 3. Cleanup logic for expired hourly/daily counters
863
-
864
- ## DNS Architecture Refactoring (2025-05-30) - COMPLETED
714
+ | Class | Purpose | Default TTL |
715
+ |-------|---------|-------------|
716
+ | `CachedEmail` | Email queue items | 30 days |
717
+ | `CachedIPReputation` | IP reputation lookups | 24 hours |
865
718
 
866
- ### Overview
867
- The DNS functionality has been refactored from UnifiedEmailServer to a dedicated DnsManager class for better discoverability and separation of concerns.
719
+ Note: CachedBounce, CachedSuppression, and CachedDKIMKey were removed in the smartmta migration (smartmta handles its own persistence for those).
868
720
 
869
- ### Key Changes
870
- 1. **Renamed DnsValidator to DnsManager:**
871
- - Extended functionality to handle both validation and creation of DNS records
872
- - Added `ensureDnsRecords()` as the main entry point
873
- - Moved DNS record creation logic from UnifiedEmailServer
721
+ ### Usage Pattern
722
+ ```typescript
723
+ // Document classes use smartdata decorators
724
+ @plugins.smartdata.Collection(() => getDb())
725
+ export class CachedEmail extends CachedDocument<CachedEmail> {
726
+ @plugins.smartdata.svDb()
727
+ public createdAt: Date = new Date();
728
+
729
+ @plugins.smartdata.svDb()
730
+ public expiresAt: Date = new Date(Date.now() + TTL.DAYS_30);
731
+
732
+ @plugins.smartdata.unI()
733
+ @plugins.smartdata.svDb()
734
+ public id: string;
735
+ // ...
736
+ }
874
737
 
875
- 2. **DnsManager Responsibilities:**
876
- - Validate DNS configuration for all modes (forward, internal-dns, external-dns)
877
- - Create DNS records for internal-dns domains
878
- - Create DKIM records for all domains (when DKIMCreator is provided)
879
- - Store DNS records in StorageManager for persistence
738
+ // Query examples
739
+ const email = await CachedEmail.getInstance({ id: 'abc123' });
740
+ const pending = await CachedEmail.getInstances({ status: 'pending' });
741
+ await email.save();
742
+ await email.delete();
743
+ ```
880
744
 
881
- 3. **DNS Record Creation Flow:**
882
- ```typescript
883
- // In UnifiedEmailServer
884
- const dnsManager = new DnsManager(this.dcRouter);
885
- await dnsManager.ensureDnsRecords(domainConfigs, this.dkimCreator);
886
- ```
745
+ ### Configuration
746
+ ```typescript
747
+ const dcRouter = new DcRouter({
748
+ cacheConfig: {
749
+ enabled: true,
750
+ storagePath: '/etc/dcrouter/tsmdb',
751
+ dbName: 'dcrouter',
752
+ cleanupIntervalHours: 1,
753
+ ttlConfig: {
754
+ emails: 30, // days
755
+ ipReputation: 1, // days
756
+ bounces: 30, // days
757
+ dkimKeys: 90, // days
758
+ suppression: 30 // days
759
+ }
760
+ }
761
+ });
762
+ ```
887
763
 
888
- 4. **Testing Pattern for DNS:**
889
- - Mock the DNS server in tests by providing a mock `registerHandler` function
890
- - Store handlers in a Map with key format: `${domain}:${types.join(',')}`
891
- - Retrieve handlers with key format: `${domain}:${type}`
892
- - Example mock implementation:
893
- ```typescript
894
- this.dnsServer = {
895
- registerHandler: (name: string, types: string[], handler: () => any) => {
896
- const key = `${name}:${types.join(',')}`;
897
- this.dnsHandlers.set(key, handler);
898
- }
899
- };
900
- ```
764
+ ### Cache Cleaner
765
+ - Runs hourly by default (configurable via `cleanupIntervalHours`)
766
+ - Finds and deletes documents where `expiresAt < now()`
767
+ - Uses smartdata's `getInstances()` + `delete()` pattern
901
768
 
902
- ### Benefits
903
- - DNS functionality is now easily discoverable in DnsManager
904
- - Clear separation between DNS management and email server logic
905
- - UnifiedEmailServer is simpler and more focused
906
- - All DNS-related tests pass successfully
769
+ ### Key Files
770
+ - `ts/cache/classes.cachedb.ts` - CacheDb singleton wrapper
771
+ - `ts/cache/classes.cached.document.ts` - Base class with TTL support
772
+ - `ts/cache/classes.cache.cleaner.ts` - Periodic cleanup service
773
+ - `ts/cache/documents/*.ts` - Document class definitions