@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.md CHANGED
@@ -1,8 +1,14 @@
1
- # dcrouter
1
+ # @serve.zone/dcrouter
2
2
 
3
- **dcrouter: a traffic router intended to be gating your datacenter.**
3
+ ![](https://code.foss.global/serve.zone/docs/raw/branch/main/dcrouter.png)
4
4
 
5
- A comprehensive traffic routing solution that provides unified gateway capabilities for HTTP/HTTPS, TCP/SNI, email (SMTP), and DNS protocols. Designed for enterprises requiring robust traffic management, automatic certificate provisioning, and enterprise-grade email infrastructure.
5
+ **dcrouter: The all-in-one gateway for your datacenter.** 🚀
6
+
7
+ A comprehensive traffic routing solution that provides unified gateway capabilities for HTTP/HTTPS, TCP/SNI, email (SMTP), DNS, and RADIUS protocols. Designed for enterprises requiring robust traffic management, automatic TLS certificate provisioning, and enterprise-grade email infrastructure — all from a single process.
8
+
9
+ ## Issue Reporting and Security
10
+
11
+ For reporting bugs, issues, or security vulnerabilities, please visit [community.foss.global/](https://community.foss.global/). This is the central community hub for all issue reporting. Developers who sign and comply with our contribution agreement and go through identification can also get a [code.foss.global/](https://code.foss.global/) account to submit Pull Requests directly.
6
12
 
7
13
  ## Table of Contents
8
14
 
@@ -10,57 +16,79 @@ A comprehensive traffic routing solution that provides unified gateway capabilit
10
16
  - [Installation](#installation)
11
17
  - [Quick Start](#quick-start)
12
18
  - [Architecture](#architecture)
13
- - [Configuration](#configuration)
19
+ - [Configuration Reference](#configuration-reference)
20
+ - [HTTP/HTTPS & TCP/SNI Routing](#httphttps--tcpsni-routing)
14
21
  - [Email System](#email-system)
15
- - [SmartProxy Routing](#smartproxy-routing)
22
+ - [DNS Server](#dns-server)
23
+ - [RADIUS Server](#radius-server)
24
+ - [Storage & Caching](#storage--caching)
16
25
  - [Security Features](#security-features)
26
+ - [OpsServer Dashboard](#opsserver-dashboard)
17
27
  - [API Reference](#api-reference)
18
- - [Examples](#examples)
19
- - [Troubleshooting](#troubleshooting)
28
+ - [Sub-Modules](#sub-modules)
29
+ - [Testing](#testing)
30
+ - [License and Legal Information](#license-and-legal-information)
20
31
 
21
32
  ## Features
22
33
 
23
- ### 🌐 **Universal Traffic Router**
24
- - **HTTP/HTTPS routing** with pattern matching and virtual hosts
25
- - **TCP/SNI proxy** for any protocol with TLS termination/passthrough
26
- - **DNS server** with authoritative and dynamic record management
27
- - **Multi-protocol support** on the same infrastructure
34
+ ### 🌐 Universal Traffic Router
35
+ - **HTTP/HTTPS routing** with domain matching, path-based forwarding, and automatic TLS
36
+ - **TCP/SNI proxy** for any protocol with TLS termination or passthrough
37
+ - **DNS server** (Rust-powered via [SmartDNS](https://code.foss.global/push.rocks/smartdns)) with authoritative zones, dynamic record management, and DNS-over-HTTPS
38
+ - **Multi-protocol support** on the same infrastructure via [SmartProxy](https://code.foss.global/push.rocks/smartproxy)
28
39
 
29
- ### 🔒 **Enterprise Security**
30
- - **Automatic TLS certificates** via ACME with DNS-01 challenges
31
- - **IP reputation checking** and real-time threat detection
32
- - **Content scanning** for spam, viruses, and malicious content
33
- - **Comprehensive security logging** with correlation tracking
34
-
35
- ### 📧 **Complete Email Infrastructure**
40
+ ### 📧 Complete Email Infrastructure (powered by [smartmta](https://code.foss.global/push.rocks/smartmta))
36
41
  - **Multi-domain SMTP server** on standard ports (25, 587, 465)
37
- - **Pattern-based email routing** with three processing modes
38
- - **DKIM, SPF, DMARC** authentication and verification
39
- - **Enterprise deliverability** with IP warmup and reputation management
40
-
41
- ### **High Performance**
42
- - **Connection pooling** and efficient resource management
43
- - **Load balancing** with automatic failover
44
- - **Rate limiting** at multiple levels
45
- - **Real-time metrics** and monitoring
46
-
47
- ### 💾 **Flexible Storage System**
48
- - **Multiple storage backends**: filesystem, custom functions, or memory
49
- - **Unified storage interface** for all components
50
- - **Automatic data migration** between backends
51
- - **Persistent configuration** for domains, routes, and security data
42
+ - **Pattern-based email routing** with four action types: forward, process, deliver, reject
43
+ - **DKIM signing & verification**, SPF, DMARC authentication stack
44
+ - **Enterprise deliverability** with IP warmup schedules and sender reputation tracking
45
+ - **Bounce handling** with automatic suppression lists
46
+ - **Hierarchical rate limiting** — global, per-domain, per-sender
47
+
48
+ ### 🔒 Enterprise Security
49
+ - **Automatic TLS certificates** via ACME with Cloudflare DNS-01 challenges
50
+ - **IP reputation checking** with caching and configurable thresholds
51
+ - **Content scanning** for spam, viruses, and malicious attachments
52
+ - **Security event logging** with structured audit trails
53
+
54
+ ### 📡 RADIUS Server
55
+ - **MAC Authentication Bypass (MAB)** for network device authentication
56
+ - **VLAN assignment** based on exact MAC, OUI prefix, or wildcard patterns
57
+ - **RADIUS accounting** for session tracking, traffic metering, and billing
58
+ - **Real-time management** via OpsServer API
59
+
60
+ ### ⚡ High Performance
61
+ - **Rust-powered proxy engine** via SmartProxy for maximum throughput
62
+ - **Rust-powered MTA engine** via smartmta (TypeScript + Rust hybrid) for reliable email delivery
63
+ - **Rust-powered DNS engine** via SmartDNS for high-performance UDP and DNS-over-HTTPS
64
+ - **Connection pooling** for outbound SMTP and backend services
65
+ - **Socket-handler mode** — direct socket passing eliminates internal port hops
66
+ - **Real-time metrics** via SmartMetrics (CPU, memory, connections, throughput)
67
+
68
+ ### 💾 Persistent Storage & Caching
69
+ - **Multiple storage backends**: filesystem, custom functions, or in-memory
70
+ - **Embedded cache database** via smartdata + LocalTsmDb (MongoDB-compatible)
71
+ - **Automatic TTL-based cleanup** for cached emails and IP reputation data
72
+
73
+ ### 🖥️ OpsServer Dashboard
74
+ - **Web-based management interface** with real-time monitoring
75
+ - **JWT authentication** with session persistence
76
+ - **Live views** for connections, email queues, DNS queries, RADIUS sessions, and security events
77
+ - **Read-only configuration display** — DcRouter is configured through code
52
78
 
53
79
  ## Installation
54
80
 
55
81
  ```bash
56
- npm install @serve.zone/dcrouter --save
82
+ pnpm add @serve.zone/dcrouter
83
+ # or
84
+ npm install @serve.zone/dcrouter
57
85
  ```
58
86
 
59
87
  ### Prerequisites
60
88
 
61
- - Node.js 18+ with ES modules support
62
- - Valid domain with DNS control (for ACME certificates)
63
- - Cloudflare API token (for DNS challenges)
89
+ - **Node.js 20+** with ES module support
90
+ - Valid domain with DNS control (for ACME certificate automation)
91
+ - Cloudflare API token (for DNS-01 challenges) — optional
64
92
 
65
93
  ## Quick Start
66
94
 
@@ -73,11 +101,11 @@ const router = new DcRouter({
73
101
  smartProxyConfig: {
74
102
  routes: [
75
103
  {
76
- name: 'web-service',
77
- match: { domains: ['example.com'], ports: [443] },
104
+ name: 'web-app',
105
+ match: { domains: ['example.com', 'www.example.com'], ports: [443] },
78
106
  action: {
79
107
  type: 'forward',
80
- target: { host: '192.168.1.10', port: 8080 },
108
+ targets: [{ host: '192.168.1.10', port: 8080 }],
81
109
  tls: { mode: 'terminate', certificate: 'auto' }
82
110
  }
83
111
  }
@@ -91,10 +119,9 @@ const router = new DcRouter({
91
119
  });
92
120
 
93
121
  await router.start();
94
- console.log('DcRouter started successfully');
95
122
  ```
96
123
 
97
- ### Basic Email Router
124
+ ### Basic Email Server
98
125
 
99
126
  ```typescript
100
127
  import { DcRouter } from '@serve.zone/dcrouter';
@@ -103,30 +130,106 @@ const router = new DcRouter({
103
130
  emailConfig: {
104
131
  ports: [25, 587, 465],
105
132
  hostname: 'mail.example.com',
133
+ domains: [
134
+ {
135
+ domain: 'example.com',
136
+ dnsMode: 'external-dns'
137
+ }
138
+ ],
106
139
  routes: [
107
140
  {
108
- name: 'local-mail',
141
+ name: 'process-all',
109
142
  match: { recipients: '*@example.com' },
110
143
  action: {
111
144
  type: 'process',
112
- process: {
113
- scan: true,
114
- dkim: true,
115
- queue: 'normal'
116
- }
145
+ process: { scan: true, dkim: true, queue: 'normal' }
117
146
  }
118
147
  }
119
- ],
120
- tls: {
121
- keyPath: './certs/key.pem',
122
- certPath: './certs/cert.pem'
123
- }
148
+ ]
124
149
  }
125
150
  });
126
151
 
127
152
  await router.start();
128
153
  ```
129
154
 
155
+ ### Full Stack with Dashboard
156
+
157
+ ```typescript
158
+ import { DcRouter } from '@serve.zone/dcrouter';
159
+
160
+ const router = new DcRouter({
161
+ // HTTP/HTTPS routing
162
+ smartProxyConfig: {
163
+ routes: [
164
+ {
165
+ name: 'website',
166
+ match: { domains: ['example.com'], ports: [443] },
167
+ action: {
168
+ type: 'forward',
169
+ targets: [{ host: '192.168.1.10', port: 80 }],
170
+ tls: { mode: 'terminate', certificate: 'auto' }
171
+ }
172
+ }
173
+ ],
174
+ acme: { email: 'ssl@example.com', enabled: true, useProduction: true }
175
+ },
176
+
177
+ // Email system (powered by smartmta)
178
+ emailConfig: {
179
+ ports: [25, 587, 465],
180
+ hostname: 'mail.example.com',
181
+ domains: [{ domain: 'example.com', dnsMode: 'external-dns' }],
182
+ routes: [
183
+ {
184
+ name: 'inbound-mail',
185
+ match: { recipients: '*@example.com' },
186
+ action: { type: 'process', process: { scan: true, dkim: true, queue: 'normal' } }
187
+ }
188
+ ]
189
+ },
190
+
191
+ // Authoritative DNS
192
+ dnsNsDomains: ['ns1.example.com', 'ns2.example.com'],
193
+ dnsScopes: ['example.com'],
194
+ publicIp: '203.0.113.1',
195
+ dnsRecords: [
196
+ { name: 'example.com', type: 'A', value: '203.0.113.1' },
197
+ { name: 'www.example.com', type: 'CNAME', value: 'example.com' }
198
+ ],
199
+
200
+ // RADIUS authentication
201
+ radiusConfig: {
202
+ authPort: 1812,
203
+ acctPort: 1813,
204
+ clients: [
205
+ { name: 'switch-1', ipRange: '192.168.1.0/24', secret: 'radius-secret', enabled: true }
206
+ ],
207
+ vlanAssignment: {
208
+ defaultVlan: 100,
209
+ allowUnknownMacs: true,
210
+ mappings: [
211
+ { mac: 'aa:bb:cc:dd:ee:ff', vlan: 10, enabled: true },
212
+ { mac: 'aa:bb:cc', vlan: 20, enabled: true } // OUI prefix
213
+ ]
214
+ },
215
+ accounting: { enabled: true, retentionDays: 30 }
216
+ },
217
+
218
+ // Persistent storage
219
+ storage: { fsPath: '/var/lib/dcrouter/data' },
220
+
221
+ // Cache database
222
+ cacheConfig: { enabled: true, storagePath: '/etc/dcrouter/tsmdb' },
223
+
224
+ // TLS & ACME
225
+ tls: { contactEmail: 'admin@example.com' },
226
+ dnsChallenge: { cloudflareApiKey: process.env.CLOUDFLARE_API_KEY }
227
+ });
228
+
229
+ await router.start();
230
+ // OpsServer dashboard available at http://localhost:3000
231
+ ```
232
+
130
233
  ## Architecture
131
234
 
132
235
  ### System Overview
@@ -138,292 +241,272 @@ graph TB
138
241
  SMTP[SMTP Clients]
139
242
  TCP[TCP Clients]
140
243
  DNS[DNS Queries]
244
+ RAD[RADIUS Clients]
141
245
  end
142
-
246
+
143
247
  subgraph "DcRouter Core"
144
- DcRouter[DcRouter Orchestrator]
145
- SmartProxy[SmartProxy Engine]
146
- EmailServer[Unified Email Server]
147
- DnsServer[DNS Server]
148
- CertManager[Certificate Manager]
248
+ DC[DcRouter Orchestrator]
249
+ SP[SmartProxy Engine<br/><i>Rust-powered</i>]
250
+ ES[smartmta Email Server<br/><i>TypeScript + Rust</i>]
251
+ DS[SmartDNS Server<br/><i>Rust-powered</i>]
252
+ RS[SmartRadius Server]
253
+ CM[Certificate Manager]
254
+ OS[OpsServer Dashboard]
255
+ MM[Metrics Manager]
256
+ SM[Storage Manager]
257
+ CD[Cache Database]
149
258
  end
150
-
259
+
151
260
  subgraph "Backend Services"
152
- WebServices[Web Services]
153
- MailServers[Mail Servers]
154
- Databases[Databases]
155
- APIs[Internal APIs]
261
+ WEB[Web Services]
262
+ MAIL[Mail Servers]
263
+ DB[Databases]
264
+ API[Internal APIs]
156
265
  end
157
-
158
- HTTP --> SmartProxy
159
- TCP --> SmartProxy
160
- SMTP --> EmailServer
161
- DNS --> DnsServer
162
-
163
- DcRouter --> SmartProxy
164
- DcRouter --> EmailServer
165
- DcRouter --> DnsServer
166
- DcRouter --> CertManager
167
-
168
- SmartProxy --> WebServices
169
- SmartProxy --> APIs
170
- EmailServer --> MailServers
171
- EmailServer --> Databases
172
-
173
- CertManager -.-> SmartProxy
174
- CertManager -.-> EmailServer
266
+
267
+ HTTP --> SP
268
+ TCP --> SP
269
+ SMTP --> ES
270
+ DNS --> DS
271
+ RAD --> RS
272
+
273
+ DC --> SP
274
+ DC --> ES
275
+ DC --> DS
276
+ DC --> RS
277
+ DC --> CM
278
+ DC --> OS
279
+ DC --> MM
280
+ DC --> SM
281
+ DC --> CD
282
+
283
+ SP --> WEB
284
+ SP --> API
285
+ ES --> MAIL
286
+ ES --> DB
287
+
288
+ CM -.-> SP
289
+ CM -.-> ES
175
290
  ```
176
291
 
177
292
  ### Core Components
178
293
 
179
- #### **DcRouter Orchestrator**
180
- Central coordination engine that manages all services and provides unified configuration.
294
+ | Component | Package | Description |
295
+ |-----------|---------|-------------|
296
+ | **DcRouter** | `@serve.zone/dcrouter` | Central orchestrator — starts, stops, and coordinates all services |
297
+ | **SmartProxy** | `@push.rocks/smartproxy` | High-performance HTTP/HTTPS and TCP/SNI proxy with route-based config (Rust engine) |
298
+ | **UnifiedEmailServer** | `@push.rocks/smartmta` | Full SMTP server with pattern-based routing, DKIM, queue management (TypeScript + Rust) |
299
+ | **DNS Server** | `@push.rocks/smartdns` | Authoritative DNS with dynamic records and DKIM TXT auto-generation (Rust engine) |
300
+ | **RADIUS Server** | `@push.rocks/smartradius` | Network authentication with MAB, VLAN assignment, and accounting |
301
+ | **OpsServer** | `@api.global/typedserver` | Web dashboard + TypedRequest API for monitoring and management |
302
+ | **MetricsManager** | `@push.rocks/smartmetrics` | Real-time metrics collection (CPU, memory, email, DNS, security) |
303
+ | **StorageManager** | built-in | Pluggable key-value storage (filesystem, custom, or in-memory) |
304
+ | **CacheDb** | `@push.rocks/smartdata` | Embedded MongoDB-compatible database (LocalTsmDb) for persistent caching |
305
+
306
+ ### How It Works
181
307
 
182
- #### **SmartProxy Engine**
183
- High-performance HTTP/HTTPS and TCP/SNI proxy with:
184
- - Pattern-based routing
185
- - TLS termination/passthrough
186
- - Load balancing
187
- - Connection pooling
308
+ DcRouter acts purely as an **orchestrator** — it doesn't implement protocols itself. Instead, it wires together best-in-class packages for each protocol:
188
309
 
189
- #### **Unified Email Server**
190
- Enterprise-grade SMTP server with:
191
- - Multi-domain support
192
- - Pattern-based routing
193
- - Three processing modes
194
- - Complete authentication stack
310
+ 1. **On `start()`**: DcRouter initializes OpsServer (port 3000), then spins up SmartProxy, smartmta, SmartDNS, and SmartRadius based on which configs are provided.
311
+ 2. **During operation**: Each service handles its own protocol independently. SmartProxy uses a Rust-powered engine for maximum throughput. smartmta uses a hybrid TypeScript + Rust architecture for reliable email delivery.
312
+ 3. **On `stop()`**: All services are gracefully shut down in reverse order.
195
313
 
196
- #### **Certificate Manager**
197
- Automatic TLS certificate provisioning via ACME with DNS-01 challenges.
314
+ ### Rust-Powered Architecture
198
315
 
199
- ## Configuration
316
+ DcRouter itself is a pure TypeScript orchestrator, but three of its core sub-components ship with **compiled Rust binaries** for performance-critical paths. At runtime each package detects the platform, unpacks the correct binary, and communicates with TypeScript over IPC/FFI — so you get the ergonomics of TypeScript with the throughput of native code.
200
317
 
201
- ### Complete Configuration Interface
318
+ | Component | Rust Binary | What It Handles |
319
+ |-----------|-------------|-----------------|
320
+ | **SmartProxy** | `smartproxy-bin` | All TCP/TLS/HTTP proxy networking, NFTables integration, connection metrics |
321
+ | **smartmta** | `mailer-bin` | SMTP server + client, DKIM/SPF/DMARC, content scanning, IP reputation |
322
+ | **SmartDNS** | `smartdns-bin` | DNS server (UDP + DNS-over-HTTPS), DNSSEC, DNS client resolution |
323
+ | **SmartRadius** | — | Pure TypeScript (no Rust component) |
324
+
325
+ ## Configuration Reference
326
+
327
+ ### `IDcRouterOptions`
202
328
 
203
329
  ```typescript
204
330
  interface IDcRouterOptions {
205
- // SmartProxy configuration for HTTP/HTTPS/TCP routing
206
- smartProxyConfig?: {
207
- routes: IRouteConfig[];
208
- acme?: IAcmeConfig;
209
- allowSessionTicket?: boolean;
331
+ // ── Traffic Routing ────────────────────────────────────────────
332
+ /** SmartProxy config for HTTP/HTTPS and TCP/SNI routing */
333
+ smartProxyConfig?: ISmartProxyOptions;
334
+
335
+ // ── Email ──────────────────────────────────────────────────────
336
+ /** Unified email server configuration (smartmta) */
337
+ emailConfig?: IUnifiedEmailServerOptions;
338
+
339
+ /** Custom email port mapping overrides */
340
+ emailPortConfig?: {
341
+ portMapping?: Record<number, number>;
342
+ portSettings?: Record<number, any>;
343
+ receivedEmailsPath?: string;
210
344
  };
211
-
212
- // Email system configuration
213
- emailConfig?: {
214
- ports: number[];
215
- hostname: string;
216
- domains?: IEmailDomainConfig[]; // Domain infrastructure setup
217
- routes: IEmailRoute[]; // Route-based email handling
218
- auth?: IAuthConfig;
219
- tls?: ITlsConfig;
220
- maxMessageSize?: number;
221
- rateLimits?: IRateLimitConfig;
222
- useSocketHandler?: boolean; // Enable socket-handler mode (no port binding)
223
- defaults?: { // Global defaults for all domains
224
- dnsMode?: 'forward' | 'internal-dns' | 'external-dns';
225
- dkim?: IDkimConfig;
226
- rateLimits?: IRateLimitConfig;
227
- };
228
- };
229
-
230
- // DNS server configuration
231
- dnsServerConfig?: {
232
- port?: number;
233
- authoritative?: boolean;
234
- records?: IDnsRecord[];
345
+
346
+ // ── DNS ────────────────────────────────────────────────────────
347
+ /** Nameserver domains — get A records automatically */
348
+ dnsNsDomains?: string[];
349
+ /** Domains this server is authoritative for */
350
+ dnsScopes?: string[];
351
+ /** Public IP for NS A records */
352
+ publicIp?: string;
353
+ /** Ingress proxy IPs (hides real server IP) */
354
+ proxyIps?: string[];
355
+ /** Custom DNS records */
356
+ dnsRecords?: Array<{
357
+ name: string;
358
+ type: 'A' | 'AAAA' | 'CNAME' | 'MX' | 'TXT' | 'NS' | 'SOA';
359
+ value: string;
360
+ ttl?: number;
361
+ useIngressProxy?: boolean;
362
+ }>;
363
+
364
+ // ── RADIUS ─────────────────────────────────────────────────────
365
+ /** RADIUS server for network authentication */
366
+ radiusConfig?: {
367
+ authPort?: number; // default: 1812
368
+ acctPort?: number; // default: 1813
369
+ clients: IRadiusClient[];
370
+ vlanAssignment?: IVlanManagerConfig;
371
+ accounting?: { enabled: boolean; retentionDays?: number };
235
372
  };
236
-
237
- // DNS domain for automatic DNS-over-HTTPS setup
238
- dnsDomain?: string; // e.g., 'dns.example.com'
239
-
240
- // TLS and certificate configuration
373
+
374
+ // ── TLS & Certificates ────────────────────────────────────────
241
375
  tls?: {
242
376
  contactEmail: string;
243
- domain: string;
244
- };
245
-
246
- // DNS challenge configuration
247
- dnsChallenge?: {
248
- cloudflareApiKey: string;
249
- };
250
-
251
- // Storage configuration
252
- storage?: {
253
- fsPath?: string; // Filesystem storage path
254
- readFunction?: (key: string) => Promise<string>; // Custom read function
255
- writeFunction?: (key: string, value: string) => Promise<void>; // Custom write function
377
+ domain?: string;
378
+ certPath?: string;
379
+ keyPath?: string;
256
380
  };
257
- }
258
- ```
381
+ dnsChallenge?: { cloudflareApiKey?: string };
259
382
 
260
- ### Route Configuration
261
-
262
- ```typescript
263
- interface IRouteConfig {
264
- name: string;
265
- priority?: number;
266
- match: {
267
- domains?: string[];
268
- ports?: number | number[] | { from: number; to: number }[];
383
+ // ── Storage & Caching ─────────────────────────────────────────
384
+ storage?: {
385
+ fsPath?: string;
386
+ readFunction?: (key: string) => Promise<string>;
387
+ writeFunction?: (key: string, value: string) => Promise<void>;
269
388
  };
270
- action: {
271
- type: 'forward' | 'redirect' | 'serve';
272
- target?: {
273
- host: string;
274
- port: number | 'preserve' | ((context: any) => number);
275
- };
276
- tls?: {
277
- mode: 'terminate' | 'passthrough';
278
- certificate?: 'auto' | string;
279
- };
280
- security?: {
281
- ipAllowList?: string[];
282
- ipBlockList?: string[];
389
+ cacheConfig?: {
390
+ enabled?: boolean; // default: true
391
+ storagePath?: string; // default: '/etc/dcrouter/tsmdb'
392
+ dbName?: string; // default: 'dcrouter'
393
+ cleanupIntervalHours?: number; // default: 1
394
+ ttlConfig?: {
395
+ emails?: number; // default: 30 days
396
+ ipReputation?: number; // default: 1 day
397
+ bounces?: number; // default: 30 days
398
+ dkimKeys?: number; // default: 90 days
399
+ suppression?: number; // default: 30 days
283
400
  };
284
401
  };
285
402
  }
286
403
  ```
287
404
 
288
- ## Socket-Handler Mode
405
+ ## HTTP/HTTPS & TCP/SNI Routing
289
406
 
290
- DcRouter supports an advanced socket-handler mode that eliminates internal port binding for both DNS and email services. Instead of services listening on internal ports, SmartProxy passes sockets directly to the services.
407
+ DcRouter uses [SmartProxy](https://code.foss.global/push.rocks/smartproxy) for all HTTP/HTTPS and TCP/SNI routing. Routes are pattern-matched by domain, port, or both.
291
408
 
292
- ### DNS Socket-Handler
293
-
294
- When `dnsDomain` is configured, DcRouter automatically:
295
- - Sets up DNS server for UDP on port 53
296
- - Creates SmartProxy routes for DNS-over-HTTPS (DoH) on the specified domain
297
- - Uses socket-handler for HTTPS/DoH traffic (no HTTPS port binding)
409
+ ### HTTPS with Auto-TLS
298
410
 
299
411
  ```typescript
300
- const router = new DcRouter({
301
- dnsDomain: 'dns.example.com', // Enables DNS with DoH
302
- smartProxyConfig: {
303
- // DNS routes are automatically created
412
+ {
413
+ name: 'api-gateway',
414
+ match: { domains: ['api.example.com'], ports: [443] },
415
+ action: {
416
+ type: 'forward',
417
+ targets: [{ host: '192.168.1.20', port: 8080 }],
418
+ tls: { mode: 'terminate', certificate: 'auto' }
304
419
  }
305
- });
420
+ }
306
421
  ```
307
422
 
308
- This creates:
309
- - UDP DNS service on port 53 (standard DNS queries)
310
- - HTTPS routes for `dns.example.com/dns-query` and `dns.example.com/resolve`
311
- - Automatic TLS certificates via Let's Encrypt
312
-
313
- ### Email Socket-Handler
314
-
315
- When `useSocketHandler` is enabled in email config:
316
- - Email server doesn't bind to any ports
317
- - SmartProxy passes sockets directly to email handlers
318
- - Reduces latency and resource usage
423
+ ### TLS Passthrough (SNI Routing)
319
424
 
320
425
  ```typescript
321
- const router = new DcRouter({
322
- emailConfig: {
323
- ports: [25, 587, 465],
324
- hostname: 'mail.example.com',
325
- useSocketHandler: true, // Enable socket-handler mode
326
- routes: [/* email routes */]
426
+ {
427
+ name: 'secure-backend',
428
+ match: { domains: ['secure.example.com'], ports: [8443] },
429
+ action: {
430
+ type: 'forward',
431
+ targets: [{ host: '192.168.1.40', port: 8443 }],
432
+ tls: { mode: 'passthrough' }
327
433
  }
328
- });
434
+ }
329
435
  ```
330
436
 
331
- ### Benefits of Socket-Handler Mode
332
-
333
- 1. **Performance**: Eliminates internal port forwarding overhead
334
- 2. **Security**: No exposed internal ports
335
- 3. **Resource Efficiency**: Fewer open ports and listeners
336
- 4. **Simplified Networking**: Direct socket passing
337
- 5. **Automatic Configuration**: Routes created automatically
437
+ ### TCP Port Range Forwarding
338
438
 
339
- ### Traditional vs Socket-Handler Mode
340
-
341
- **Traditional Mode (default):**
342
- ```
343
- External Port → SmartProxy → Internal Port → Service
344
- 25 → 10025 → Email
439
+ ```typescript
440
+ {
441
+ name: 'database-cluster',
442
+ match: { ports: [{ from: 5432, to: 5439 }] },
443
+ action: {
444
+ type: 'forward',
445
+ targets: [{ host: '192.168.1.30', port: 'preserve' }],
446
+ security: { ipAllowList: ['192.168.1.0/24'] }
447
+ }
448
+ }
345
449
  ```
346
450
 
347
- **Socket-Handler Mode:**
348
- ```
349
- External Port → SmartProxy → Socket Handler → Service
350
- 25 → (direct socket) → Email
451
+ ### HTTP Redirect
452
+
453
+ ```typescript
454
+ {
455
+ name: 'http-to-https',
456
+ match: { ports: [80] },
457
+ action: { type: 'redirect', redirect: { to: 'https://{domain}{path}' } }
458
+ }
351
459
  ```
352
460
 
353
461
  ## Email System
354
462
 
355
- ### Email Domain Configuration
463
+ The email system is powered by [`@push.rocks/smartmta`](https://code.foss.global/push.rocks/smartmta), a TypeScript + Rust hybrid MTA. DcRouter configures and orchestrates smartmta's **UnifiedEmailServer**, which handles SMTP sessions, route matching, delivery queuing, DKIM signing, and all email processing.
356
464
 
357
- DcRouter separates email infrastructure (which domains to handle) from routing logic (how to handle emails):
465
+ ### Email Domain Configuration
358
466
 
359
- #### **DNS Modes**
467
+ Domains define _infrastructure_ — how DNS and DKIM are handled for each domain:
360
468
 
361
- **Forward Mode** - Simple mail forwarding without local DNS:
469
+ #### Forward Mode
470
+ Simple forwarding without local DNS management:
362
471
  ```typescript
363
472
  {
364
473
  domain: 'forwarded.com',
365
474
  dnsMode: 'forward',
366
- dns: {
367
- forward: {
368
- skipDnsValidation: true,
369
- targetDomain: 'mail.target.com'
370
- }
371
- }
475
+ dns: { forward: { skipDnsValidation: true, targetDomain: 'mail.target.com' } }
372
476
  }
373
477
  ```
374
478
 
375
- **Internal DNS Mode** - Use built-in DNS server (requires `dnsDomain` in DcRouter config):
479
+ #### Internal DNS Mode
480
+ Uses DcRouter's built-in DNS server (requires `dnsNsDomains` + `dnsScopes`):
376
481
  ```typescript
377
482
  {
378
483
  domain: 'mail.example.com',
379
484
  dnsMode: 'internal-dns',
380
- dns: {
381
- internal: {
382
- mxPriority: 10,
383
- ttl: 3600
384
- }
385
- },
386
- dkim: {
387
- selector: 'mail2024',
388
- keySize: 2048,
389
- rotateKeys: true,
390
- rotationInterval: 90
391
- }
485
+ dns: { internal: { mxPriority: 10, ttl: 3600 } },
486
+ dkim: { selector: 'mail2024', keySize: 2048, rotateKeys: true, rotationInterval: 90 }
392
487
  }
393
488
  ```
394
489
 
395
- **External DNS Mode** - Use existing DNS infrastructure:
490
+ #### External DNS Mode
491
+ Uses existing DNS infrastructure with validation:
396
492
  ```typescript
397
493
  {
398
494
  domain: 'mail.external.com',
399
495
  dnsMode: 'external-dns',
400
- dns: {
401
- external: {
402
- requiredRecords: ['MX', 'SPF', 'DKIM', 'DMARC']
403
- }
404
- },
496
+ dns: { external: { requiredRecords: ['MX', 'SPF', 'DKIM', 'DMARC'] } },
405
497
  rateLimits: {
406
- inbound: {
407
- messagesPerMinute: 100,
408
- connectionsPerIp: 10
409
- }
498
+ inbound: { messagesPerMinute: 100, connectionsPerIp: 10 },
499
+ outbound: { messagesPerMinute: 200 }
410
500
  }
411
501
  }
412
502
  ```
413
503
 
414
- #### **DKIM Management**
415
-
416
- DKIM is always enabled for all domains. Keys are automatically:
417
- - Generated on first use
418
- - Stored persistently via StorageManager
419
- - Rotated based on configuration
420
- - Cleaned up after grace period
421
-
422
504
  ### Email Route Actions
423
505
 
424
- #### **Forward Action**
425
- Routes emails to external SMTP servers.
506
+ Routes define _behavior_ — what happens when an email matches:
426
507
 
508
+ #### Forward 📤
509
+ Routes emails to an external SMTP server:
427
510
  ```typescript
428
511
  {
429
512
  name: 'forward-to-internal',
@@ -433,821 +516,460 @@ Routes emails to external SMTP servers.
433
516
  forward: {
434
517
  host: 'internal-mail.company.com',
435
518
  port: 25,
436
- auth: {
437
- username: 'relay-user',
438
- password: 'relay-pass'
439
- },
440
- addHeaders: {
441
- 'X-Forwarded-By': 'dcrouter'
442
- }
519
+ auth: { user: 'relay-user', pass: 'relay-pass' },
520
+ addHeaders: { 'X-Forwarded-By': 'dcrouter' }
443
521
  }
444
522
  }
445
523
  }
446
524
  ```
447
525
 
448
- #### **Process Action**
449
- Full Mail Transfer Agent functionality with scanning and delivery queues.
450
-
526
+ #### Process ⚙️
527
+ Full MTA processing with content scanning and delivery queues:
451
528
  ```typescript
452
529
  {
453
530
  name: 'process-notifications',
454
531
  match: { recipients: '*@notifications.company.com' },
455
532
  action: {
456
533
  type: 'process',
457
- process: {
458
- scan: true,
459
- dkim: true,
460
- queue: 'priority'
461
- }
534
+ process: { scan: true, dkim: true, queue: 'priority' }
462
535
  }
463
536
  }
464
537
  ```
465
538
 
466
- #### **Deliver Action**
467
- Local delivery for mailbox storage.
468
-
539
+ #### Deliver 📥
540
+ Local mailbox delivery:
469
541
  ```typescript
470
542
  {
471
543
  name: 'deliver-local',
472
- match: { recipients: '*@marketing.company.com' },
473
- action: {
474
- type: 'deliver'
475
- }
544
+ match: { recipients: '*@local.company.com' },
545
+ action: { type: 'deliver' }
476
546
  }
477
547
  ```
478
548
 
479
- #### **Reject Action**
480
- Reject emails with custom SMTP responses.
481
-
549
+ #### Reject 🚫
550
+ Reject with custom SMTP response code:
482
551
  ```typescript
483
552
  {
484
- name: 'reject-spam',
485
- match: {
486
- senders: '*@spam-domain.com',
487
- sizeRange: { min: 1000000 } // > 1MB
488
- },
553
+ name: 'reject-spam-domain',
554
+ match: { senders: '*@spam-domain.com', sizeRange: { min: 1000000 } },
489
555
  action: {
490
556
  type: 'reject',
491
- reject: {
492
- code: 550,
493
- message: 'Message rejected due to policy'
494
- }
557
+ reject: { code: 550, message: 'Message rejected due to policy' }
495
558
  }
496
559
  }
497
560
  ```
498
561
 
499
- ### Common Email Routing Patterns
562
+ ### Route Matching
500
563
 
501
- #### **IP-Based Relay**
502
- Allow internal networks to relay through the server:
503
- ```typescript
504
- {
505
- name: 'office-relay',
506
- priority: 100,
507
- match: { clientIp: ['192.168.0.0/16', '10.0.0.0/8'] },
508
- action: {
509
- type: 'forward',
510
- forward: { host: 'internal-mail.company.com', port: 25 }
511
- }
512
- }
513
- ```
564
+ Routes support powerful matching criteria:
514
565
 
515
- #### **Domain-Based Routing**
516
- Route different domains to different servers:
517
566
  ```typescript
518
- {
519
- name: 'partner-domain',
520
- match: { recipients: '*@partner.com' },
521
- action: {
522
- type: 'forward',
523
- forward: { host: 'partner-mail.com', port: 587 }
524
- }
525
- }
526
- ```
567
+ // Recipient patterns
568
+ match: { recipients: '*@example.com' } // All addresses at domain
569
+ match: { recipients: 'admin@*' } // "admin" at any domain
570
+ match: { senders: ['*@trusted.com', '*@vip.com'] } // Multiple sender patterns
527
571
 
528
- #### **Authentication-Based Processing**
529
- Different handling for authenticated vs unauthenticated senders:
530
- ```typescript
531
- {
532
- name: 'authenticated-users',
533
- match: { authenticated: true },
534
- action: {
535
- type: 'process',
536
- process: { scan: false, dkim: true, queue: 'priority' }
537
- }
538
- },
539
- {
540
- name: 'unauthenticated-reject',
541
- match: { authenticated: false },
542
- action: {
543
- type: 'reject',
544
- reject: { code: 550, message: 'Authentication required' }
545
- }
546
- }
547
- ```
572
+ // IP-based matching (CIDR)
573
+ match: { clientIp: '192.168.0.0/16' }
574
+ match: { clientIp: ['10.0.0.0/8', '172.16.0.0/12'] }
548
575
 
549
- #### **Content-Based Filtering**
550
- Filter based on size, subject, or headers:
551
- ```typescript
552
- {
553
- name: 'large-email-reject',
554
- match: { sizeRange: { min: 25000000 } }, // > 25MB
555
- action: {
556
- type: 'reject',
557
- reject: { code: 552, message: 'Message too large' }
558
- }
559
- },
560
- {
561
- name: 'priority-emails',
562
- match: {
563
- headers: { 'X-Priority': 'high' },
564
- subject: /urgent|emergency/i
565
- },
566
- action: {
567
- type: 'process',
568
- process: { queue: 'priority' }
569
- }
570
- }
576
+ // Authentication state
577
+ match: { authenticated: true }
578
+
579
+ // Header matching
580
+ match: { headers: { 'X-Priority': 'high', 'Subject': /urgent|emergency/i } }
581
+
582
+ // Size and content
583
+ match: { sizeRange: { min: 1000, max: 5000000 }, hasAttachments: true }
584
+ match: { subject: /invoice|receipt/i }
571
585
  ```
572
586
 
573
- ### Email Security Features
587
+ ### Socket-Handler Mode 🔌
574
588
 
575
- #### **Route Matching Patterns**
589
+ When `useSocketHandler: true` is set, SmartProxy passes sockets directly to the email server — no internal port binding, lower latency, and fewer open ports:
576
590
 
577
- **Glob Pattern Matching**
578
- ```typescript
579
- // Email address patterns
580
- match: { recipients: '*@example.com' } // All addresses at domain
581
- match: { recipients: 'admin@*' } // Admin at any domain
582
- match: { senders: ['*@trusted.com', '*@partner.com'] } // Multiple patterns
591
+ ```
592
+ Traditional: External Port → SmartProxy → Internal Port → Email Server
593
+ Socket Mode: External Port → SmartProxy → (direct socket) → Email Server
594
+ ```
583
595
 
584
- // CIDR IP matching
585
- match: { clientIp: '192.168.0.0/16' } // Private subnet
586
- match: { clientIp: ['10.0.0.0/8', '172.16.0.0/12'] } // Multiple ranges
596
+ ### Email Security Stack
587
597
 
588
- // Header matching
589
- match: {
590
- headers: {
591
- 'X-Priority': 'high',
592
- 'Subject': /urgent|emergency/i
593
- }
594
- }
598
+ - **DKIM** — Automatic key generation, signing, and rotation for all domains
599
+ - **SPF** — Sender Policy Framework verification on inbound mail
600
+ - **DMARC** — Domain-based Message Authentication verification
601
+ - **IP Reputation** — Real-time IP reputation checking with caching
602
+ - **Content Scanning** — Spam, virus, and attachment scanning
603
+ - **Rate Limiting** — Hierarchical limits (global → domain → sender)
604
+ - **Bounce Management** — Automatic bounce detection and suppression lists
595
605
 
596
- // Size and content matching
597
- match: {
598
- sizeRange: { min: 1000, max: 5000000 }, // 1KB to 5MB
599
- hasAttachments: true,
600
- subject: /invoice|receipt/i
601
- }
602
- ```
606
+ ### Email Deliverability
603
607
 
604
- #### **Content Scanning**
605
- ```typescript
606
- const scanners = [
607
- {
608
- type: 'spam',
609
- threshold: 5.0,
610
- action: 'tag',
611
- headers: ['X-Spam-Score', 'X-Spam-Status']
612
- },
613
- {
614
- type: 'virus',
615
- action: 'reject',
616
- quarantine: true
617
- },
618
- {
619
- type: 'attachment',
620
- blockedExtensions: ['.exe', '.bat', '.scr'],
621
- maxSize: 25 * 1024 * 1024 // 25MB
622
- }
623
- ];
624
- ```
608
+ - **IP Warmup Manager** — Multi-stage warmup schedules for new IPs
609
+ - **Sender Reputation Monitor** — Per-domain reputation tracking and scoring
610
+ - **Connection Pooling** — Pooled outbound SMTP connections per destination
625
611
 
626
- ## SmartProxy Routing
612
+ ## DNS Server
627
613
 
628
- ### HTTP/HTTPS Routing
614
+ DcRouter includes an authoritative DNS server built on [smartdns](https://code.foss.global/push.rocks/smartdns). It handles standard UDP DNS on port 53 and DNS-over-HTTPS via SmartProxy socket handler.
629
615
 
630
- ```typescript
631
- const routes = [
632
- // API routing with path-based forwarding
633
- {
634
- name: 'api-gateway',
635
- match: {
636
- domains: ['api.example.com'],
637
- ports: [443]
638
- },
639
- action: {
640
- type: 'forward',
641
- target: {
642
- host: '192.168.1.20',
643
- port: (context) => {
644
- // Route based on path
645
- if (context.path.startsWith('/v1/')) return 8080;
646
- if (context.path.startsWith('/v2/')) return 8081;
647
- return 8080;
648
- }
649
- },
650
- tls: {
651
- mode: 'terminate',
652
- certificate: 'auto'
653
- }
654
- }
655
- },
656
-
657
- // Static file serving
658
- {
659
- name: 'static-assets',
660
- match: {
661
- domains: ['cdn.example.com'],
662
- ports: [443]
663
- },
664
- action: {
665
- type: 'serve',
666
- root: '/var/www/static',
667
- tls: {
668
- mode: 'terminate',
669
- certificate: 'auto'
670
- }
671
- }
672
- }
673
- ];
674
- ```
616
+ ### Enabling DNS
675
617
 
676
- ### TCP/SNI Routing
618
+ DNS is activated when both `dnsNsDomains` and `dnsScopes` are configured:
677
619
 
678
620
  ```typescript
679
- const tcpRoutes = [
680
- // Database connection routing
681
- {
682
- name: 'database-cluster',
683
- match: {
684
- ports: [{ from: 5432, to: 5439 }]
685
- },
686
- action: {
687
- type: 'forward',
688
- target: {
689
- host: '192.168.1.30',
690
- port: 'preserve'
691
- },
692
- security: {
693
- ipAllowList: ['192.168.1.0/24']
694
- }
695
- }
696
- },
697
-
698
- // SNI-based routing for TLS services
699
- {
700
- name: 'secure-service',
701
- match: {
702
- domains: ['secure.example.com'],
703
- ports: [8443]
704
- },
705
- action: {
706
- type: 'forward',
707
- target: {
708
- host: '192.168.1.40',
709
- port: 8443
710
- },
711
- tls: {
712
- mode: 'passthrough'
713
- }
714
- }
715
- }
716
- ];
621
+ const router = new DcRouter({
622
+ dnsNsDomains: ['ns1.example.com', 'ns2.example.com'],
623
+ dnsScopes: ['example.com'],
624
+ publicIp: '203.0.113.1',
625
+ dnsRecords: [
626
+ { name: 'example.com', type: 'A', value: '203.0.113.1' },
627
+ { name: 'www.example.com', type: 'CNAME', value: 'example.com' },
628
+ { name: 'example.com', type: 'MX', value: '10:mail.example.com' },
629
+ { name: 'example.com', type: 'TXT', value: 'v=spf1 a mx ~all' }
630
+ ]
631
+ });
717
632
  ```
718
633
 
719
- ## Storage System
634
+ ### Automatic DNS Records
720
635
 
721
- ### StorageManager
636
+ DcRouter auto-generates:
637
+ - **NS records** for all domains in `dnsScopes`
638
+ - **SOA records** for authoritative zones
639
+ - **A records** for nameserver domains (`dnsNsDomains`)
640
+ - **MX, SPF, DKIM, DMARC records** for email domains with `internal-dns` mode
641
+ - **ACME challenge records** for certificate provisioning
642
+
643
+ ### Ingress Proxy Support
722
644
 
723
- DcRouter includes a flexible storage system that supports multiple backends:
645
+ When `proxyIps` is configured, A records with `useIngressProxy: true` (default) will use the proxy IP instead of the real server IP — hiding your origin:
724
646
 
725
- #### **Filesystem Storage**
726
647
  ```typescript
727
- const router = new DcRouter({
728
- storage: {
729
- fsPath: '/var/lib/dcrouter/data'
730
- }
731
- });
648
+ {
649
+ proxyIps: ['198.51.100.1', '198.51.100.2'],
650
+ dnsRecords: [
651
+ { name: 'example.com', type: 'A', value: '203.0.113.1' }, // Will resolve to 198.51.100.1
652
+ { name: 'ns1.example.com', type: 'A', value: '203.0.113.1', useIngressProxy: false } // Stays real IP
653
+ ]
654
+ }
732
655
  ```
733
656
 
734
- #### **Custom Storage Backend**
657
+ ## RADIUS Server
658
+
659
+ DcRouter includes a RADIUS server for network access control, built on [smartradius](https://code.foss.global/push.rocks/smartradius).
660
+
661
+ ### Configuration
662
+
735
663
  ```typescript
736
664
  const router = new DcRouter({
737
- storage: {
738
- readFunction: async (key) => {
739
- // Read from Redis, S3, etc.
740
- return await myDatabase.get(key);
665
+ radiusConfig: {
666
+ authPort: 1812,
667
+ acctPort: 1813,
668
+ clients: [
669
+ {
670
+ name: 'core-switch',
671
+ ipRange: '192.168.1.0/24',
672
+ secret: 'shared-secret',
673
+ enabled: true
674
+ }
675
+ ],
676
+ vlanAssignment: {
677
+ defaultVlan: 100,
678
+ allowUnknownMacs: true,
679
+ mappings: [
680
+ { mac: 'aa:bb:cc:dd:ee:ff', vlan: 10, enabled: true }, // Exact MAC
681
+ { mac: 'aa:bb:cc', vlan: 20, enabled: true }, // OUI prefix
682
+ ]
741
683
  },
742
- writeFunction: async (key, value) => {
743
- // Write to Redis, S3, etc.
744
- await myDatabase.set(key, value);
684
+ accounting: {
685
+ enabled: true,
686
+ retentionDays: 30
745
687
  }
746
688
  }
747
689
  });
748
690
  ```
749
691
 
750
- #### **Memory Storage (Development)**
751
- ```typescript
752
- const router = new DcRouter({
753
- // No storage config = memory storage with warning
754
- });
755
- ```
756
-
757
- ### Storage Usage
692
+ ### Components
758
693
 
759
- The storage system is used for:
760
- - **DKIM Keys**: `/email/dkim/{domain}/private.key`, `/email/dkim/{domain}/public.key`
761
- - **Email Routes**: `/email/routes/{routeId}.json`
762
- - **Bounce Lists**: `/email/bounces/suppression.json`
763
- - **IP Reputation**: `/security/ip-reputation/{ip}.json`
764
- - **Domain Configs**: `/email/domains/{domain}.json`
694
+ | Component | Purpose |
695
+ |-----------|---------|
696
+ | **RadiusServer** | Main RADIUS server handling auth + accounting requests |
697
+ | **VlanManager** | MAC-to-VLAN mapping with exact, OUI, and wildcard patterns |
698
+ | **AccountingManager** | Session tracking, traffic metering, start/stop/interim updates |
765
699
 
766
- ### Data Migration
700
+ ### OpsServer API
767
701
 
768
- Migrate data between storage backends:
702
+ RADIUS is fully manageable at runtime via the OpsServer API:
703
+ - Client management (add/remove/list NAS devices)
704
+ - VLAN mapping CRUD operations
705
+ - Session monitoring and forced disconnects
706
+ - Accounting summaries and statistics
769
707
 
770
- ```typescript
771
- import { StorageManager } from '@serve.zone/dcrouter';
772
-
773
- // Export from filesystem
774
- const fsStorage = new StorageManager({ fsPath: './data' });
775
- const keys = await fsStorage.list('/');
776
- const data = {};
777
- for (const key of keys) {
778
- data[key] = await fsStorage.get(key);
779
- }
708
+ ## Storage & Caching
780
709
 
781
- // Import to cloud storage
782
- const cloudStorage = new StorageManager({
783
- readFunction: cloudRead,
784
- writeFunction: cloudWrite
785
- });
786
- for (const [key, value] of Object.entries(data)) {
787
- await cloudStorage.set(key, value);
788
- }
789
- ```
790
-
791
- ## Security Features
710
+ ### StorageManager
792
711
 
793
- ### IP Reputation Checking
712
+ Provides a unified key-value interface with three backends:
794
713
 
795
714
  ```typescript
796
- import { IpReputationChecker } from '@serve.zone/dcrouter';
715
+ // Filesystem backend
716
+ storage: { fsPath: '/var/lib/dcrouter/data' }
797
717
 
798
- const ipChecker = new IpReputationChecker({
799
- providers: ['spamhaus', 'barracuda', 'surbl'],
800
- cacheTimeout: 3600000, // 1 hour
801
- threshold: 0.7
802
- });
803
-
804
- // Check IP reputation
805
- const result = await ipChecker.checkIp('192.0.2.1');
806
- if (result.isBlocked) {
807
- console.log(`IP blocked: ${result.reason}`);
718
+ // Custom backend (Redis, S3, etc.)
719
+ storage: {
720
+ readFunction: async (key) => await redis.get(key),
721
+ writeFunction: async (key, value) => await redis.set(key, value)
808
722
  }
809
- ```
810
-
811
- ### Content Security Scanner
812
-
813
- ```typescript
814
- import { ContentScanner } from '@serve.zone/dcrouter';
815
-
816
- const scanner = new ContentScanner({
817
- spamThreshold: 5.0,
818
- virusScanning: true,
819
- attachmentFiltering: {
820
- maxSize: 25 * 1024 * 1024,
821
- blockedTypes: ['.exe', '.bat', '.scr']
822
- }
823
- });
824
723
 
825
- const scanResult = await scanner.scanEmail(email);
724
+ // In-memory (development only — data lost on restart)
725
+ // Simply omit the storage config
826
726
  ```
827
727
 
828
- ## API Reference
728
+ Used for: DKIM keys, email routes, bounce/suppression lists, IP reputation data, domain configs.
829
729
 
830
- ### DcRouter Class
730
+ ### Cache Database
731
+
732
+ An embedded MongoDB-compatible database (via smartdata + LocalTsmDb) for persistent caching with automatic TTL cleanup:
831
733
 
832
- #### Constructor
833
734
  ```typescript
834
- constructor(options: IDcRouterOptions)
735
+ cacheConfig: {
736
+ enabled: true,
737
+ storagePath: '/etc/dcrouter/tsmdb',
738
+ dbName: 'dcrouter',
739
+ cleanupIntervalHours: 1,
740
+ ttlConfig: {
741
+ emails: 30, // days
742
+ ipReputation: 1, // days
743
+ bounces: 30, // days
744
+ dkimKeys: 90, // days
745
+ suppression: 30 // days
746
+ }
747
+ }
835
748
  ```
836
749
 
837
- #### Methods
750
+ Cached document types: `CachedEmail`, `CachedIPReputation`.
838
751
 
839
- ##### `start(): Promise<void>`
840
- Starts all configured services (SmartProxy, email server, DNS server).
752
+ ## Security Features
841
753
 
842
- ##### `stop(): Promise<void>`
843
- Gracefully stops all services.
754
+ ### IP Reputation Checking
844
755
 
845
- ##### `updateRoutes(routes: IRouteConfig[]): Promise<void>`
846
- Updates SmartProxy routes dynamically.
756
+ Automatic IP reputation checks on inbound connections with configurable caching:
847
757
 
848
- ##### `updateDomainRules(rules: IDomainRule[]): Promise<void>`
849
- Updates email domain routing rules.
758
+ ```typescript
759
+ // IP reputation is checked automatically for inbound SMTP connections.
760
+ // Results are cached according to cacheConfig.ttlConfig.ipReputation.
761
+ ```
850
762
 
851
- ##### `getStats(): IStatsResponse`
852
- Returns real-time statistics for all services.
763
+ ### Rate Limiting
853
764
 
854
- ### Email Service API
765
+ Hierarchical rate limits with three levels of specificity:
855
766
 
856
- #### `sendEmail(options: IEmailOptions): Promise<string>`
857
767
  ```typescript
858
- const emailId = await router.emailService.sendEmail({
859
- from: 'sender@example.com',
860
- to: 'recipient@example.com',
861
- subject: 'Test Email',
862
- html: '<p>Hello World</p>',
863
- attachments: []
864
- });
865
- ```
768
+ // Global defaults (via emailConfig.defaults.rateLimits)
769
+ defaults: {
770
+ rateLimits: {
771
+ inbound: { messagesPerMinute: 50, connectionsPerIp: 5, recipientsPerMessage: 50 },
772
+ outbound: { messagesPerMinute: 100 }
773
+ }
774
+ }
866
775
 
867
- #### `getEmailStatus(emailId: string): IEmailStatus`
868
- ```typescript
869
- const status = router.emailService.getEmailStatus(emailId);
870
- console.log(status.status); // 'pending', 'sent', 'delivered', 'bounced'
776
+ // Per-domain overrides (in domain config)
777
+ {
778
+ domain: 'high-volume.com',
779
+ rateLimits: {
780
+ outbound: { messagesPerMinute: 500 } // Override for this domain
781
+ }
782
+ }
871
783
  ```
872
784
 
873
- #### `getDeliveryReport(emailId: string): IDeliveryReport`
874
- Detailed delivery information including bounce reasons and tracking data.
875
-
876
- ## Examples
785
+ **Precedence**: Domain-specific > Pattern-specific > Global
877
786
 
878
- ### Complete Enterprise Setup
787
+ ### Content Scanning
879
788
 
880
789
  ```typescript
881
- import { DcRouter } from '@serve.zone/dcrouter';
882
-
883
- const router = new DcRouter({
884
- // HTTP/HTTPS routing
885
- smartProxyConfig: {
886
- routes: [
887
- // Main website
888
- {
889
- name: 'website',
890
- priority: 100,
891
- match: { domains: ['example.com', 'www.example.com'], ports: [443] },
892
- action: {
893
- type: 'forward',
894
- target: { host: '192.168.1.10', port: 80 },
895
- tls: { mode: 'terminate', certificate: 'auto' }
896
- }
897
- },
898
-
899
- // API services
900
- {
901
- name: 'api',
902
- priority: 110,
903
- match: { domains: ['api.example.com'], ports: [443] },
904
- action: {
905
- type: 'forward',
906
- target: { host: '192.168.1.20', port: 8080 },
907
- tls: { mode: 'terminate', certificate: 'auto' }
908
- }
909
- },
910
-
911
- // Internal services
912
- {
913
- name: 'internal',
914
- match: { ports: [{ from: 8000, to: 8999 }] },
915
- action: {
916
- type: 'forward',
917
- target: { host: '192.168.1.30', port: 'preserve' },
918
- security: { ipAllowList: ['192.168.0.0/16'] }
919
- }
920
- }
921
- ],
922
-
923
- // ACME certificate automation
924
- acme: {
925
- email: 'ssl@example.com',
926
- enabled: true,
927
- useProduction: true,
928
- autoRenew: true
929
- }
930
- },
931
-
932
- // Enterprise email system
933
- emailConfig: {
934
- ports: [25, 587, 465],
935
- hostname: 'mail.example.com',
936
-
937
- // Domain configuration
938
- domains: [
939
- {
940
- domain: 'example.com',
941
- dnsMode: 'external-dns',
942
- dkim: {
943
- selector: 'mail',
944
- rotateKeys: true
945
- }
946
- },
947
- {
948
- domain: 'notifications.example.com',
949
- dnsMode: 'internal-dns',
950
- rateLimits: {
951
- outbound: { messagesPerHour: 10000 }
952
- }
953
- }
954
- ],
955
-
956
- // Authentication configuration
957
- auth: {
958
- required: true,
959
- methods: ['PLAIN', 'LOGIN']
960
- },
961
-
962
- // TLS configuration
963
- tls: {
964
- keyPath: './certs/mail-key.pem',
965
- certPath: './certs/mail-cert.pem'
966
- },
967
-
968
- // Email routing rules
969
- routes: [
970
- // Relay from office network
971
- {
972
- name: 'office-relay',
973
- priority: 100,
974
- match: { clientIp: '192.168.0.0/16' },
975
- action: {
976
- type: 'forward',
977
- forward: {
978
- host: 'internal-mail.example.com',
979
- port: 25
980
- }
981
- }
982
- },
983
-
984
- // Transactional emails via processing
985
- {
986
- name: 'notifications',
987
- priority: 50,
988
- match: { recipients: '*@notifications.example.com' },
989
- action: {
990
- type: 'process',
991
- process: {
992
- scan: true,
993
- dkim: true,
994
- queue: 'priority'
995
- }
996
- }
997
- },
998
-
999
- // Internal emails forwarded to Exchange
1000
- {
1001
- name: 'internal-mail',
1002
- priority: 25,
1003
- match: { recipients: '*@example.com' },
1004
- action: {
1005
- type: 'forward',
1006
- forward: {
1007
- host: 'exchange.internal.example.com',
1008
- port: 25
1009
- }
1010
- }
1011
- },
1012
-
1013
- // Default reject
1014
- {
1015
- name: 'default-reject',
1016
- match: { recipients: '*' },
1017
- action: {
1018
- type: 'reject',
1019
- reject: {
1020
- code: 550,
1021
- message: 'Relay denied'
1022
- }
1023
- }
1024
- }
790
+ action: {
791
+ type: 'process',
792
+ options: {
793
+ contentScanning: true,
794
+ scanners: [
795
+ { type: 'spam', threshold: 5.0, action: 'tag' },
796
+ { type: 'virus', action: 'reject' },
797
+ { type: 'attachment', blockedExtensions: ['.exe', '.bat', '.scr'], action: 'reject' }
1025
798
  ]
1026
- },
1027
-
1028
- // DNS server for ACME challenges
1029
- dnsServerConfig: {
1030
- port: 53,
1031
- authoritative: true
1032
- },
1033
-
1034
- // Cloudflare DNS challenges
1035
- dnsChallenge: {
1036
- cloudflareApiKey: process.env.CLOUDFLARE_API_KEY
1037
- },
1038
-
1039
- // Persistent storage
1040
- storage: {
1041
- fsPath: '/var/lib/dcrouter/data'
1042
799
  }
1043
- });
1044
-
1045
- // Start the router
1046
- await router.start();
1047
- console.log('Enterprise DcRouter started');
1048
-
1049
- // Monitor statistics
1050
- setInterval(() => {
1051
- const stats = router.getStats();
1052
- console.log('Active connections:', stats.activeConnections);
1053
- console.log('Emails processed:', stats.emailsProcessed);
1054
- }, 60000);
800
+ }
1055
801
  ```
1056
802
 
1057
- ### Email Template System
803
+ ## OpsServer Dashboard
1058
804
 
1059
- ```typescript
1060
- import { EmailService, TemplateManager } from '@serve.zone/dcrouter';
1061
-
1062
- // Setup email templates
1063
- const templateManager = new TemplateManager();
1064
- templateManager.addTemplate('welcome', {
1065
- subject: 'Welcome to {{company}}!',
1066
- html: `
1067
- <h1>Welcome {{name}}!</h1>
1068
- <p>Thank you for joining {{company}}.</p>
1069
- <p>Your account: {{email}}</p>
1070
- `,
1071
- text: 'Welcome {{name}}! Thank you for joining {{company}}.'
1072
- });
805
+ The OpsServer provides a web-based management interface served on port 3000. It's built with modern web components using [@design.estate/dees-catalog](https://code.foss.global/design.estate/dees-catalog).
1073
806
 
1074
- // Send templated email
1075
- const emailService = new EmailService(router);
1076
- await emailService.sendTemplatedEmail('welcome', {
1077
- to: 'user@example.com',
1078
- templateData: {
1079
- name: 'John Doe',
1080
- company: 'Example Corp',
1081
- email: 'user@example.com'
1082
- }
1083
- });
1084
- ```
807
+ ### Dashboard Views
1085
808
 
1086
- ## Troubleshooting
809
+ | View | Description |
810
+ |------|-------------|
811
+ | 📊 **Overview** | Real-time server stats, CPU/memory, connection counts, email throughput |
812
+ | 🌐 **Network** | Active connections, top IPs, throughput rates, SmartProxy metrics |
813
+ | 📧 **Email** | Queue monitoring (queued/sent/failed), bounce records, security incidents |
814
+ | 📜 **Logs** | Real-time log viewer with level filtering and search |
815
+ | ⚙️ **Configuration** | Read-only view of current system configuration |
816
+ | 🛡️ **Security** | IP reputation, rate limit status, blocked connections |
1087
817
 
1088
- ### Common Issues
818
+ ### API Endpoints
1089
819
 
1090
- #### Certificate Issues
1091
- ```bash
1092
- # Check certificate status
1093
- curl -I https://your-domain.com
820
+ All management is done via TypedRequest over HTTP POST to `/typedrequest`:
1094
821
 
1095
- # Verify ACME challenge accessibility
1096
- curl http://your-domain.com/.well-known/acme-challenge/test
1097
- ```
822
+ ```typescript
823
+ // Authentication
824
+ 'adminLoginWithUsernameAndPassword' // Login with credentials → returns JWT identity
825
+ 'verifyIdentity' // Verify JWT token validity
826
+ 'adminLogout' // End admin session
1098
827
 
1099
- #### Email Delivery Issues
1100
- ```bash
1101
- # Test SMTP connectivity
1102
- telnet your-server.com 25
828
+ // Statistics & Health
829
+ 'getServerStatistics' // Uptime, CPU, memory, connections
830
+ 'getHealthStatus' // System health check
831
+ 'getCombinedMetrics' // All metrics in one call
832
+
833
+ // Email Operations
834
+ 'getQueuedEmails' // Emails pending delivery
835
+ 'getSentEmails' // Successfully delivered emails
836
+ 'getFailedEmails' // Failed emails
837
+ 'resendEmail' // Re-queue a failed email
838
+ 'getBounceRecords' // Bounce records
839
+ 'removeFromSuppressionList' // Unsuppress an address
840
+
841
+ // Configuration (read-only)
842
+ 'getConfiguration' // Current system config
1103
843
 
1104
- # Check DKIM record
1105
- dig TXT mail._domainkey.your-domain.com
844
+ // Logs
845
+ 'getLogs' // Retrieve system logs
1106
846
 
1107
- # Verify SPF record
1108
- dig TXT your-domain.com
847
+ // RADIUS
848
+ 'getRadiusSessions' // Active RADIUS sessions
849
+ 'getRadiusClients' // List NAS clients
850
+ 'getRadiusStatistics' // RADIUS stats
851
+ 'setRadiusClient' // Add/update NAS client
852
+ 'removeRadiusClient' // Remove NAS client
853
+ 'getVlanMappings' // List VLAN mappings
854
+ 'setVlanMapping' // Add/update VLAN mapping
855
+ 'removeVlanMapping' // Remove VLAN mapping
856
+ 'testVlanAssignment' // Test what VLAN a MAC gets
1109
857
  ```
1110
858
 
1111
- #### Email Routing Issues
859
+ ## API Reference
1112
860
 
1113
- **Route Not Matching**
1114
- - Check route priority order (higher priority = evaluated first)
1115
- - Verify glob patterns: `*@example.com` matches domain, `admin@*` matches user
1116
- - Test CIDR notation: `192.168.0.0/16` includes all 192.168.x.x addresses
1117
- - Confirm authentication state matches your expectations
861
+ ### DcRouter Class
1118
862
 
1119
- **Common Route Patterns**
1120
863
  ```typescript
1121
- // Debug route to log all traffic
1122
- {
1123
- name: 'debug-all',
1124
- priority: 1000,
1125
- match: { recipients: '*' },
1126
- action: { type: 'process', process: { scan: false } }
1127
- }
864
+ import { DcRouter } from '@serve.zone/dcrouter';
1128
865
 
1129
- // Catch-all reject (should be lowest priority)
1130
- {
1131
- name: 'default-reject',
1132
- priority: 0,
1133
- match: { recipients: '*' },
1134
- action: { type: 'reject', reject: { code: 550, message: 'No route' } }
1135
- }
866
+ const router = new DcRouter(options: IDcRouterOptions);
1136
867
  ```
1137
868
 
1138
- #### DNS Issues
1139
- ```bash
1140
- # Test DNS server
1141
- dig @your-server.com your-domain.com
1142
-
1143
- # Check DNS propagation
1144
- dig your-domain.com @8.8.8.8
1145
- ```
869
+ #### Methods
1146
870
 
1147
- ### Logging and Monitoring
871
+ | Method | Description |
872
+ |--------|-------------|
873
+ | `start(): Promise<void>` | Start all configured services |
874
+ | `stop(): Promise<void>` | Gracefully stop all services |
875
+ | `updateSmartProxyConfig(config): Promise<void>` | Hot-update SmartProxy routes |
876
+ | `updateEmailConfig(config): Promise<void>` | Hot-update email configuration |
877
+ | `updateEmailRoutes(routes): Promise<void>` | Update email routing rules at runtime |
878
+ | `updateRadiusConfig(config): Promise<void>` | Hot-update RADIUS configuration |
879
+ | `getStats(): any` | Get real-time statistics from all services |
1148
880
 
1149
- ```typescript
1150
- import { SmartLog } from '@push.rocks/smartlog';
881
+ #### Properties
1151
882
 
1152
- // Configure logging
1153
- const logger = new SmartLog({
1154
- level: 'info',
1155
- transport: 'console'
1156
- });
883
+ | Property | Type | Description |
884
+ |----------|------|-------------|
885
+ | `options` | `IDcRouterOptions` | Current configuration |
886
+ | `smartProxy` | `SmartProxy` | SmartProxy instance |
887
+ | `emailServer` | `UnifiedEmailServer` | Email server instance (from smartmta) |
888
+ | `dnsServer` | `DnsServer` | DNS server instance |
889
+ | `radiusServer` | `RadiusServer` | RADIUS server instance |
890
+ | `storageManager` | `StorageManager` | Storage backend |
891
+ | `opsServer` | `OpsServer` | OpsServer/dashboard instance |
892
+ | `metricsManager` | `MetricsManager` | Metrics collector |
893
+ | `cacheDb` | `CacheDb` | Cache database instance |
1157
894
 
1158
- // Monitor email events
1159
- router.emailServer.on('emailReceived', (email) => {
1160
- logger.log('info', `Email received: ${email.from} -> ${email.to}`);
1161
- });
895
+ ### Re-exported Types
1162
896
 
1163
- router.emailServer.on('emailSent', (result) => {
1164
- logger.log('info', `Email sent: ${result.messageId} (${result.status})`);
1165
- });
897
+ DcRouter re-exports key types from smartmta for convenience:
1166
898
 
1167
- // Monitor proxy events
1168
- router.smartProxy.on('connectionEstablished', (connection) => {
1169
- logger.log('info', `Connection: ${connection.clientIp} -> ${connection.target}`);
1170
- });
899
+ ```typescript
900
+ import {
901
+ DcRouter,
902
+ IDcRouterOptions,
903
+ UnifiedEmailServer,
904
+ type IUnifiedEmailServerOptions,
905
+ type IEmailRoute,
906
+ type IEmailDomainConfig,
907
+ } from '@serve.zone/dcrouter';
1171
908
  ```
1172
909
 
1173
- ### Performance Tuning
910
+ ## Sub-Modules
911
+
912
+ DcRouter is published as a monorepo with separately-installable interface and web packages:
913
+
914
+ | Package | Description | Install |
915
+ |---------|-------------|---------|
916
+ | [`@serve.zone/dcrouter`](https://www.npmjs.com/package/@serve.zone/dcrouter) | Main package — the full router | `pnpm add @serve.zone/dcrouter` |
917
+ | [`@serve.zone/dcrouter-interfaces`](https://www.npmjs.com/package/@serve.zone/dcrouter-interfaces) | TypedRequest interfaces for the OpsServer API | `pnpm add @serve.zone/dcrouter-interfaces` |
918
+ | [`@serve.zone/dcrouter-web`](https://www.npmjs.com/package/@serve.zone/dcrouter-web) | Web dashboard components | `pnpm add @serve.zone/dcrouter-web` |
919
+
920
+ You can also import interfaces directly from the main package:
1174
921
 
1175
922
  ```typescript
1176
- const performanceConfig = {
1177
- // Connection limits
1178
- maxConnections: 1000,
1179
- connectionTimeout: 30000,
1180
-
1181
- // Email queue settings
1182
- emailQueue: {
1183
- concurrency: 10,
1184
- maxRetries: 3,
1185
- retryDelay: 300000
1186
- },
1187
-
1188
- // Cache settings
1189
- cache: {
1190
- ipReputation: { ttl: 3600000 }, // 1 hour
1191
- dns: { ttl: 300000 }, // 5 minutes
1192
- certificates: { ttl: 86400000 } // 24 hours
1193
- }
1194
- };
923
+ import { data, requests } from '@serve.zone/dcrouter/interfaces';
1195
924
  ```
1196
925
 
1197
- ## License
926
+ ## Testing
1198
927
 
1199
- MIT License - see LICENSE file for details.
928
+ DcRouter includes a comprehensive test suite covering all system components:
1200
929
 
1201
- ## Testing
930
+ ```bash
931
+ # Run all tests (10 files, 73 tests)
932
+ pnpm test
1202
933
 
1203
- ### Comprehensive Test Suite
934
+ # Run a specific test file
935
+ tstest test/test.jwt-auth.ts --verbose
1204
936
 
1205
- DcRouter includes a comprehensive test suite covering all aspects of the system:
937
+ # Run with extended timeout
938
+ tstest test/test.opsserver-api.ts --verbose --timeout 60
939
+ ```
1206
940
 
1207
- #### SMTP Protocol Tests
1208
- - **Commands**: EHLO, HELO, MAIL FROM, RCPT TO, DATA, RSET, NOOP, QUIT, VRFY, EXPN, HELP
1209
- - **Extensions**: SIZE, PIPELINING, STARTTLS
1210
- - **Connection Management**: TLS/plain connections, timeouts, limits, rejection handling
1211
- - **Error Handling**: Syntax errors, invalid sequences, temporary/permanent failures
1212
- - **Email Processing**: Basic sending, multiple recipients, large emails, invalid addresses
1213
- - **Security**: Authentication, rate limiting
1214
- - **Performance**: Throughput testing
1215
- - **Edge Cases**: Very large emails, special characters
941
+ ### Test Coverage
1216
942
 
1217
- #### Storage and Configuration Tests
1218
- - **Storage Manager**: All backend types (filesystem, custom, memory)
1219
- - **Integration**: Component storage usage and persistence
1220
- - **DNS Validation**: All DNS modes (forward, internal, external)
1221
- - **DNS Mode Switching**: Dynamic configuration changes
1222
- - **Data Migration**: Moving data between storage backends
943
+ | Test File | Area | Tests |
944
+ |-----------|------|-------|
945
+ | `test.contentscanner.ts` | Content scanning (spam, phishing, malware, attachments) | 13 |
946
+ | `test.dcrouter.email.ts` | Email config, domain and route setup | 4 |
947
+ | `test.dns-server-config.ts` | DNS record parsing, grouping, extraction | 5 |
948
+ | `test.dns-socket-handler.ts` | DNS socket handler and route generation | 6 |
949
+ | `test.errors.ts` | Error classes, handler, retry utilities | 5 |
950
+ | `test.ipreputationchecker.ts` | IP reputation, DNSBL, caching, risk classification | 10 |
951
+ | `test.jwt-auth.ts` | JWT login, verification, logout, invalid credentials | 8 |
952
+ | `test.opsserver-api.ts` | Health, statistics, configuration, log APIs | 6 |
953
+ | `test.protected-endpoint.ts` | Admin auth, identity verification, public endpoints | 8 |
954
+ | `test.storagemanager.ts` | Memory, filesystem, custom backends, concurrency | 8 |
1223
955
 
1224
- #### Running Tests
956
+ ## License and Legal Information
1225
957
 
1226
- ```bash
1227
- # Run all tests
1228
- pnpm test
958
+ This repository contains open-source code licensed under the MIT License. A copy of the license can be found in the [LICENSE](./LICENSE) file.
1229
959
 
1230
- # Run specific test categories
1231
- tsx test/suite/commands/test.ehlo-command.ts
1232
- tsx test/suite/connection/test.tls-connection.ts
1233
- tsx test/suite/email-processing/test.basic-email.ts
960
+ **Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
1234
961
 
1235
- # Run with verbose output
1236
- tstest test/suite/security/test.authentication.ts --verbose
1237
- ```
962
+ ### Trademarks
963
+
964
+ This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH or third parties, and are not included within the scope of the MIT license granted herein.
1238
965
 
1239
- ### Test Infrastructure
966
+ Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines or the guidelines of the respective third-party owners, and any usage must be approved in writing. Third-party trademarks used herein are the property of their respective owners and used only in a descriptive manner, e.g. for an implementation of an API or similar.
1240
967
 
1241
- The test suite uses a self-contained pattern where each test:
1242
- 1. Starts its own SMTP server instance
1243
- 2. Runs comprehensive test scenarios
1244
- 3. Cleans up all resources
1245
- 4. Provides detailed logging for debugging
968
+ ### Company Information
1246
969
 
1247
- This ensures tests are isolated, reliable, and can run in parallel.
970
+ Task Venture Capital GmbH
971
+ Registered at District Court Bremen HRB 35230 HB, Germany
1248
972
 
1249
- ## Support
973
+ For any legal inquiries or further information, please contact us via email at hello@task.vc.
1250
974
 
1251
- - Documentation: [https://docs.serve.zone/dcrouter](https://docs.serve.zone/dcrouter)
1252
- - Issues: [https://github.com/serve-zone/dcrouter/issues](https://github.com/serve-zone/dcrouter/issues)
1253
- - Community: [https://community.serve.zone](https://community.serve.zone)
975
+ By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.