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