@serve.zone/dcrouter 2.12.4
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/.dockerignore +1 -0
- package/.gitea/workflows/docker_nottags.yaml +71 -0
- package/.gitea/workflows/docker_tags.yaml +106 -0
- package/.vscode/launch.json +11 -0
- package/.vscode/settings.json +26 -0
- package/Dockerfile +46 -0
- package/changelog.md +247 -0
- package/cli.child.js +4 -0
- package/cli.child.ts +4 -0
- package/cli.js +4 -0
- package/cli.ts.js +5 -0
- package/dist_ts/00_commitinfo_data.d.ts +8 -0
- package/dist_ts/00_commitinfo_data.js +9 -0
- package/dist_ts/classes.dcrouter.d.ts +238 -0
- package/dist_ts/classes.dcrouter.js +1008 -0
- package/dist_ts/config/index.d.ts +1 -0
- package/dist_ts/config/index.js +3 -0
- package/dist_ts/config/validator.d.ts +104 -0
- package/dist_ts/config/validator.js +152 -0
- package/dist_ts/deliverability/classes.ipwarmupmanager.d.ts +253 -0
- package/dist_ts/deliverability/classes.ipwarmupmanager.js +639 -0
- package/dist_ts/deliverability/classes.senderreputationmonitor.d.ts +300 -0
- package/dist_ts/deliverability/classes.senderreputationmonitor.js +961 -0
- package/dist_ts/deliverability/index.d.ts +2 -0
- package/dist_ts/deliverability/index.js +3 -0
- package/dist_ts/errors/base.errors.d.ts +224 -0
- package/dist_ts/errors/base.errors.js +310 -0
- package/dist_ts/errors/email.errors.d.ts +175 -0
- package/dist_ts/errors/email.errors.js +265 -0
- package/dist_ts/errors/error-handler.d.ts +98 -0
- package/dist_ts/errors/error-handler.js +282 -0
- package/dist_ts/errors/error.codes.d.ts +115 -0
- package/dist_ts/errors/error.codes.js +136 -0
- package/dist_ts/errors/index.d.ts +56 -0
- package/dist_ts/errors/index.js +138 -0
- package/dist_ts/errors/mta.errors.d.ts +259 -0
- package/dist_ts/errors/mta.errors.js +472 -0
- package/dist_ts/errors/reputation.errors.d.ts +183 -0
- package/dist_ts/errors/reputation.errors.js +292 -0
- package/dist_ts/index.d.ts +4 -0
- package/dist_ts/index.js +6 -0
- package/dist_ts/logger.d.ts +17 -0
- package/dist_ts/logger.js +77 -0
- package/dist_ts/mail/core/classes.bouncemanager.d.ts +200 -0
- package/dist_ts/mail/core/classes.bouncemanager.js +778 -0
- package/dist_ts/mail/core/classes.email.d.ts +291 -0
- package/dist_ts/mail/core/classes.email.js +780 -0
- package/dist_ts/mail/core/classes.emailvalidator.d.ts +61 -0
- package/dist_ts/mail/core/classes.emailvalidator.js +182 -0
- package/dist_ts/mail/core/classes.templatemanager.d.ts +95 -0
- package/dist_ts/mail/core/classes.templatemanager.js +239 -0
- package/dist_ts/mail/core/index.d.ts +4 -0
- package/dist_ts/mail/core/index.js +6 -0
- package/dist_ts/mail/delivery/classes.delivery.queue.d.ts +163 -0
- package/dist_ts/mail/delivery/classes.delivery.queue.js +485 -0
- package/dist_ts/mail/delivery/classes.delivery.system.d.ts +186 -0
- package/dist_ts/mail/delivery/classes.delivery.system.js +846 -0
- package/dist_ts/mail/delivery/classes.emailsendjob.d.ts +84 -0
- package/dist_ts/mail/delivery/classes.emailsendjob.js +362 -0
- package/dist_ts/mail/delivery/classes.emailsignjob.d.ts +18 -0
- package/dist_ts/mail/delivery/classes.emailsignjob.js +44 -0
- package/dist_ts/mail/delivery/classes.mta.config.d.ts +22 -0
- package/dist_ts/mail/delivery/classes.mta.config.js +51 -0
- package/dist_ts/mail/delivery/classes.ratelimiter.d.ts +98 -0
- package/dist_ts/mail/delivery/classes.ratelimiter.js +205 -0
- package/dist_ts/mail/delivery/classes.smtp.client.legacy.d.ts +275 -0
- package/dist_ts/mail/delivery/classes.smtp.client.legacy.js +973 -0
- package/dist_ts/mail/delivery/classes.unified.rate.limiter.d.ts +200 -0
- package/dist_ts/mail/delivery/classes.unified.rate.limiter.js +817 -0
- package/dist_ts/mail/delivery/index.d.ts +12 -0
- package/dist_ts/mail/delivery/index.js +18 -0
- package/dist_ts/mail/delivery/interfaces.d.ts +243 -0
- package/dist_ts/mail/delivery/interfaces.js +17 -0
- package/dist_ts/mail/delivery/smtpclient/auth-handler.d.ts +43 -0
- package/dist_ts/mail/delivery/smtpclient/auth-handler.js +188 -0
- package/dist_ts/mail/delivery/smtpclient/command-handler.d.ts +67 -0
- package/dist_ts/mail/delivery/smtpclient/command-handler.js +276 -0
- package/dist_ts/mail/delivery/smtpclient/connection-manager.d.ts +48 -0
- package/dist_ts/mail/delivery/smtpclient/connection-manager.js +238 -0
- package/dist_ts/mail/delivery/smtpclient/constants.d.ts +129 -0
- package/dist_ts/mail/delivery/smtpclient/constants.js +135 -0
- package/dist_ts/mail/delivery/smtpclient/create-client.d.ts +22 -0
- package/dist_ts/mail/delivery/smtpclient/create-client.js +86 -0
- package/dist_ts/mail/delivery/smtpclient/error-handler.d.ts +28 -0
- package/dist_ts/mail/delivery/smtpclient/error-handler.js +110 -0
- package/dist_ts/mail/delivery/smtpclient/index.d.ts +16 -0
- package/dist_ts/mail/delivery/smtpclient/index.js +21 -0
- package/dist_ts/mail/delivery/smtpclient/interfaces.d.ts +183 -0
- package/dist_ts/mail/delivery/smtpclient/interfaces.js +19 -0
- package/dist_ts/mail/delivery/smtpclient/smtp-client.d.ts +58 -0
- package/dist_ts/mail/delivery/smtpclient/smtp-client.js +279 -0
- package/dist_ts/mail/delivery/smtpclient/tls-handler.d.ts +33 -0
- package/dist_ts/mail/delivery/smtpclient/tls-handler.js +202 -0
- package/dist_ts/mail/delivery/smtpclient/utils/helpers.d.ts +77 -0
- package/dist_ts/mail/delivery/smtpclient/utils/helpers.js +196 -0
- package/dist_ts/mail/delivery/smtpclient/utils/logging.d.ts +46 -0
- package/dist_ts/mail/delivery/smtpclient/utils/logging.js +153 -0
- package/dist_ts/mail/delivery/smtpclient/utils/validation.d.ts +38 -0
- package/dist_ts/mail/delivery/smtpclient/utils/validation.js +139 -0
- package/dist_ts/mail/delivery/smtpserver/certificate-utils.d.ts +45 -0
- package/dist_ts/mail/delivery/smtpserver/certificate-utils.js +345 -0
- package/dist_ts/mail/delivery/smtpserver/command-handler.d.ts +156 -0
- package/dist_ts/mail/delivery/smtpserver/command-handler.js +1159 -0
- package/dist_ts/mail/delivery/smtpserver/connection-manager.d.ts +159 -0
- package/dist_ts/mail/delivery/smtpserver/connection-manager.js +894 -0
- package/dist_ts/mail/delivery/smtpserver/constants.d.ts +130 -0
- package/dist_ts/mail/delivery/smtpserver/constants.js +162 -0
- package/dist_ts/mail/delivery/smtpserver/create-server.d.ts +14 -0
- package/dist_ts/mail/delivery/smtpserver/create-server.js +28 -0
- package/dist_ts/mail/delivery/smtpserver/data-handler.d.ts +123 -0
- package/dist_ts/mail/delivery/smtpserver/data-handler.js +1148 -0
- package/dist_ts/mail/delivery/smtpserver/index.d.ts +20 -0
- package/dist_ts/mail/delivery/smtpserver/index.js +27 -0
- package/dist_ts/mail/delivery/smtpserver/interfaces.d.ts +530 -0
- package/dist_ts/mail/delivery/smtpserver/interfaces.js +10 -0
- package/dist_ts/mail/delivery/smtpserver/secure-server.d.ts +15 -0
- package/dist_ts/mail/delivery/smtpserver/secure-server.js +79 -0
- package/dist_ts/mail/delivery/smtpserver/security-handler.d.ts +86 -0
- package/dist_ts/mail/delivery/smtpserver/security-handler.js +234 -0
- package/dist_ts/mail/delivery/smtpserver/session-manager.d.ts +140 -0
- package/dist_ts/mail/delivery/smtpserver/session-manager.js +469 -0
- package/dist_ts/mail/delivery/smtpserver/smtp-server.d.ts +137 -0
- package/dist_ts/mail/delivery/smtpserver/smtp-server.js +666 -0
- package/dist_ts/mail/delivery/smtpserver/starttls-handler.d.ts +21 -0
- package/dist_ts/mail/delivery/smtpserver/starttls-handler.js +207 -0
- package/dist_ts/mail/delivery/smtpserver/tls-handler.d.ts +66 -0
- package/dist_ts/mail/delivery/smtpserver/tls-handler.js +261 -0
- package/dist_ts/mail/delivery/smtpserver/utils/adaptive-logging.d.ts +117 -0
- package/dist_ts/mail/delivery/smtpserver/utils/adaptive-logging.js +411 -0
- package/dist_ts/mail/delivery/smtpserver/utils/helpers.d.ts +78 -0
- package/dist_ts/mail/delivery/smtpserver/utils/helpers.js +208 -0
- package/dist_ts/mail/delivery/smtpserver/utils/logging.d.ts +106 -0
- package/dist_ts/mail/delivery/smtpserver/utils/logging.js +181 -0
- package/dist_ts/mail/delivery/smtpserver/utils/validation.d.ts +69 -0
- package/dist_ts/mail/delivery/smtpserver/utils/validation.js +360 -0
- package/dist_ts/mail/index.d.ts +8 -0
- package/dist_ts/mail/index.js +13 -0
- package/dist_ts/mail/routing/classes.dns.manager.d.ts +65 -0
- package/dist_ts/mail/routing/classes.dns.manager.js +413 -0
- package/dist_ts/mail/routing/classes.dnsmanager.d.ts +165 -0
- package/dist_ts/mail/routing/classes.dnsmanager.js +430 -0
- package/dist_ts/mail/routing/classes.domain.registry.d.ts +54 -0
- package/dist_ts/mail/routing/classes.domain.registry.js +118 -0
- package/dist_ts/mail/routing/classes.email.config.d.ts +64 -0
- package/dist_ts/mail/routing/classes.email.config.js +2 -0
- package/dist_ts/mail/routing/classes.email.router.d.ts +171 -0
- package/dist_ts/mail/routing/classes.email.router.js +491 -0
- package/dist_ts/mail/routing/classes.unified.email.server.d.ts +426 -0
- package/dist_ts/mail/routing/classes.unified.email.server.js +1454 -0
- package/dist_ts/mail/routing/index.d.ts +5 -0
- package/dist_ts/mail/routing/index.js +7 -0
- package/dist_ts/mail/routing/interfaces.d.ts +187 -0
- package/dist_ts/mail/routing/interfaces.js +2 -0
- package/dist_ts/mail/security/classes.dkimcreator.d.ts +68 -0
- package/dist_ts/mail/security/classes.dkimcreator.js +346 -0
- package/dist_ts/mail/security/classes.dkimverifier.d.ts +46 -0
- package/dist_ts/mail/security/classes.dkimverifier.js +317 -0
- package/dist_ts/mail/security/classes.dmarcverifier.d.ts +123 -0
- package/dist_ts/mail/security/classes.dmarcverifier.js +365 -0
- package/dist_ts/mail/security/classes.spfverifier.d.ts +103 -0
- package/dist_ts/mail/security/classes.spfverifier.js +492 -0
- package/dist_ts/mail/security/index.d.ts +4 -0
- package/dist_ts/mail/security/index.js +6 -0
- package/dist_ts/opsserver/classes.opsserver.d.ts +14 -0
- package/dist_ts/opsserver/classes.opsserver.js +37 -0
- package/dist_ts/opsserver/index.d.ts +1 -0
- package/dist_ts/opsserver/index.js +2 -0
- package/dist_ts/paths.d.ts +14 -0
- package/dist_ts/paths.js +39 -0
- package/dist_ts/plugins.d.ts +43 -0
- package/dist_ts/plugins.js +50 -0
- package/dist_ts/security/classes.contentscanner.d.ts +160 -0
- package/dist_ts/security/classes.contentscanner.js +634 -0
- package/dist_ts/security/classes.ipreputationchecker.d.ts +150 -0
- package/dist_ts/security/classes.ipreputationchecker.js +508 -0
- package/dist_ts/security/classes.securitylogger.d.ts +140 -0
- package/dist_ts/security/classes.securitylogger.js +232 -0
- package/dist_ts/security/index.d.ts +3 -0
- package/dist_ts/security/index.js +4 -0
- package/dist_ts/sms/classes.smsservice.d.ts +15 -0
- package/dist_ts/sms/classes.smsservice.js +72 -0
- package/dist_ts/sms/config/sms.config.d.ts +93 -0
- package/dist_ts/sms/config/sms.config.js +2 -0
- package/dist_ts/sms/config/sms.schema.d.ts +5 -0
- package/dist_ts/sms/config/sms.schema.js +121 -0
- package/dist_ts/sms/index.d.ts +1 -0
- package/dist_ts/sms/index.js +2 -0
- package/dist_ts/storage/classes.storagemanager.d.ts +82 -0
- package/dist_ts/storage/classes.storagemanager.js +341 -0
- package/dist_ts/storage/index.d.ts +1 -0
- package/dist_ts/storage/index.js +3 -0
- package/dist_ts/ts/00_commitinfo_data.d.ts +8 -0
- package/dist_ts/ts/00_commitinfo_data.js +9 -0
- package/dist_ts/ts/classes.dcrouter.d.ts +238 -0
- package/dist_ts/ts/classes.dcrouter.js +1008 -0
- package/dist_ts/ts/config/index.d.ts +1 -0
- package/dist_ts/ts/config/index.js +3 -0
- package/dist_ts/ts/config/validator.d.ts +104 -0
- package/dist_ts/ts/config/validator.js +152 -0
- package/dist_ts/ts/deliverability/classes.ipwarmupmanager.d.ts +253 -0
- package/dist_ts/ts/deliverability/classes.ipwarmupmanager.js +639 -0
- package/dist_ts/ts/deliverability/classes.senderreputationmonitor.d.ts +300 -0
- package/dist_ts/ts/deliverability/classes.senderreputationmonitor.js +961 -0
- package/dist_ts/ts/deliverability/index.d.ts +2 -0
- package/dist_ts/ts/deliverability/index.js +3 -0
- package/dist_ts/ts/errors/base.errors.d.ts +224 -0
- package/dist_ts/ts/errors/base.errors.js +310 -0
- package/dist_ts/ts/errors/email.errors.d.ts +175 -0
- package/dist_ts/ts/errors/email.errors.js +265 -0
- package/dist_ts/ts/errors/error-handler.d.ts +98 -0
- package/dist_ts/ts/errors/error-handler.js +282 -0
- package/dist_ts/ts/errors/error.codes.d.ts +115 -0
- package/dist_ts/ts/errors/error.codes.js +136 -0
- package/dist_ts/ts/errors/index.d.ts +56 -0
- package/dist_ts/ts/errors/index.js +138 -0
- package/dist_ts/ts/errors/mta.errors.d.ts +259 -0
- package/dist_ts/ts/errors/mta.errors.js +472 -0
- package/dist_ts/ts/errors/reputation.errors.d.ts +183 -0
- package/dist_ts/ts/errors/reputation.errors.js +292 -0
- package/dist_ts/ts/index.d.ts +4 -0
- package/dist_ts/ts/index.js +6 -0
- package/dist_ts/ts/logger.d.ts +17 -0
- package/dist_ts/ts/logger.js +77 -0
- package/dist_ts/ts/mail/core/classes.bouncemanager.d.ts +200 -0
- package/dist_ts/ts/mail/core/classes.bouncemanager.js +778 -0
- package/dist_ts/ts/mail/core/classes.email.d.ts +291 -0
- package/dist_ts/ts/mail/core/classes.email.js +780 -0
- package/dist_ts/ts/mail/core/classes.emailvalidator.d.ts +61 -0
- package/dist_ts/ts/mail/core/classes.emailvalidator.js +182 -0
- package/dist_ts/ts/mail/core/classes.templatemanager.d.ts +95 -0
- package/dist_ts/ts/mail/core/classes.templatemanager.js +239 -0
- package/dist_ts/ts/mail/core/index.d.ts +4 -0
- package/dist_ts/ts/mail/core/index.js +6 -0
- package/dist_ts/ts/mail/delivery/classes.delivery.queue.d.ts +163 -0
- package/dist_ts/ts/mail/delivery/classes.delivery.queue.js +485 -0
- package/dist_ts/ts/mail/delivery/classes.delivery.system.d.ts +186 -0
- package/dist_ts/ts/mail/delivery/classes.delivery.system.js +846 -0
- package/dist_ts/ts/mail/delivery/classes.emailsendjob.d.ts +84 -0
- package/dist_ts/ts/mail/delivery/classes.emailsendjob.js +362 -0
- package/dist_ts/ts/mail/delivery/classes.emailsignjob.d.ts +18 -0
- package/dist_ts/ts/mail/delivery/classes.emailsignjob.js +44 -0
- package/dist_ts/ts/mail/delivery/classes.mta.config.d.ts +22 -0
- package/dist_ts/ts/mail/delivery/classes.mta.config.js +51 -0
- package/dist_ts/ts/mail/delivery/classes.ratelimiter.d.ts +98 -0
- package/dist_ts/ts/mail/delivery/classes.ratelimiter.js +205 -0
- package/dist_ts/ts/mail/delivery/classes.smtp.client.legacy.d.ts +275 -0
- package/dist_ts/ts/mail/delivery/classes.smtp.client.legacy.js +973 -0
- package/dist_ts/ts/mail/delivery/classes.unified.rate.limiter.d.ts +200 -0
- package/dist_ts/ts/mail/delivery/classes.unified.rate.limiter.js +817 -0
- package/dist_ts/ts/mail/delivery/index.d.ts +12 -0
- package/dist_ts/ts/mail/delivery/index.js +18 -0
- package/dist_ts/ts/mail/delivery/interfaces.d.ts +243 -0
- package/dist_ts/ts/mail/delivery/interfaces.js +17 -0
- package/dist_ts/ts/mail/delivery/smtpclient/auth-handler.d.ts +43 -0
- package/dist_ts/ts/mail/delivery/smtpclient/auth-handler.js +188 -0
- package/dist_ts/ts/mail/delivery/smtpclient/command-handler.d.ts +67 -0
- package/dist_ts/ts/mail/delivery/smtpclient/command-handler.js +276 -0
- package/dist_ts/ts/mail/delivery/smtpclient/connection-manager.d.ts +48 -0
- package/dist_ts/ts/mail/delivery/smtpclient/connection-manager.js +238 -0
- package/dist_ts/ts/mail/delivery/smtpclient/constants.d.ts +129 -0
- package/dist_ts/ts/mail/delivery/smtpclient/constants.js +135 -0
- package/dist_ts/ts/mail/delivery/smtpclient/create-client.d.ts +22 -0
- package/dist_ts/ts/mail/delivery/smtpclient/create-client.js +86 -0
- package/dist_ts/ts/mail/delivery/smtpclient/error-handler.d.ts +28 -0
- package/dist_ts/ts/mail/delivery/smtpclient/error-handler.js +110 -0
- package/dist_ts/ts/mail/delivery/smtpclient/index.d.ts +16 -0
- package/dist_ts/ts/mail/delivery/smtpclient/index.js +21 -0
- package/dist_ts/ts/mail/delivery/smtpclient/interfaces.d.ts +183 -0
- package/dist_ts/ts/mail/delivery/smtpclient/interfaces.js +19 -0
- package/dist_ts/ts/mail/delivery/smtpclient/smtp-client.d.ts +58 -0
- package/dist_ts/ts/mail/delivery/smtpclient/smtp-client.js +279 -0
- package/dist_ts/ts/mail/delivery/smtpclient/tls-handler.d.ts +33 -0
- package/dist_ts/ts/mail/delivery/smtpclient/tls-handler.js +202 -0
- package/dist_ts/ts/mail/delivery/smtpclient/utils/helpers.d.ts +77 -0
- package/dist_ts/ts/mail/delivery/smtpclient/utils/helpers.js +196 -0
- package/dist_ts/ts/mail/delivery/smtpclient/utils/logging.d.ts +46 -0
- package/dist_ts/ts/mail/delivery/smtpclient/utils/logging.js +153 -0
- package/dist_ts/ts/mail/delivery/smtpclient/utils/validation.d.ts +38 -0
- package/dist_ts/ts/mail/delivery/smtpclient/utils/validation.js +139 -0
- package/dist_ts/ts/mail/delivery/smtpserver/certificate-utils.d.ts +45 -0
- package/dist_ts/ts/mail/delivery/smtpserver/certificate-utils.js +345 -0
- package/dist_ts/ts/mail/delivery/smtpserver/command-handler.d.ts +156 -0
- package/dist_ts/ts/mail/delivery/smtpserver/command-handler.js +1159 -0
- package/dist_ts/ts/mail/delivery/smtpserver/connection-manager.d.ts +159 -0
- package/dist_ts/ts/mail/delivery/smtpserver/connection-manager.js +894 -0
- package/dist_ts/ts/mail/delivery/smtpserver/constants.d.ts +130 -0
- package/dist_ts/ts/mail/delivery/smtpserver/constants.js +162 -0
- package/dist_ts/ts/mail/delivery/smtpserver/create-server.d.ts +14 -0
- package/dist_ts/ts/mail/delivery/smtpserver/create-server.js +28 -0
- package/dist_ts/ts/mail/delivery/smtpserver/data-handler.d.ts +123 -0
- package/dist_ts/ts/mail/delivery/smtpserver/data-handler.js +1148 -0
- package/dist_ts/ts/mail/delivery/smtpserver/index.d.ts +20 -0
- package/dist_ts/ts/mail/delivery/smtpserver/index.js +27 -0
- package/dist_ts/ts/mail/delivery/smtpserver/interfaces.d.ts +530 -0
- package/dist_ts/ts/mail/delivery/smtpserver/interfaces.js +10 -0
- package/dist_ts/ts/mail/delivery/smtpserver/secure-server.d.ts +15 -0
- package/dist_ts/ts/mail/delivery/smtpserver/secure-server.js +79 -0
- package/dist_ts/ts/mail/delivery/smtpserver/security-handler.d.ts +86 -0
- package/dist_ts/ts/mail/delivery/smtpserver/security-handler.js +234 -0
- package/dist_ts/ts/mail/delivery/smtpserver/session-manager.d.ts +140 -0
- package/dist_ts/ts/mail/delivery/smtpserver/session-manager.js +469 -0
- package/dist_ts/ts/mail/delivery/smtpserver/smtp-server.d.ts +137 -0
- package/dist_ts/ts/mail/delivery/smtpserver/smtp-server.js +666 -0
- package/dist_ts/ts/mail/delivery/smtpserver/starttls-handler.d.ts +21 -0
- package/dist_ts/ts/mail/delivery/smtpserver/starttls-handler.js +207 -0
- package/dist_ts/ts/mail/delivery/smtpserver/tls-handler.d.ts +66 -0
- package/dist_ts/ts/mail/delivery/smtpserver/tls-handler.js +261 -0
- package/dist_ts/ts/mail/delivery/smtpserver/utils/adaptive-logging.d.ts +117 -0
- package/dist_ts/ts/mail/delivery/smtpserver/utils/adaptive-logging.js +411 -0
- package/dist_ts/ts/mail/delivery/smtpserver/utils/helpers.d.ts +78 -0
- package/dist_ts/ts/mail/delivery/smtpserver/utils/helpers.js +208 -0
- package/dist_ts/ts/mail/delivery/smtpserver/utils/logging.d.ts +106 -0
- package/dist_ts/ts/mail/delivery/smtpserver/utils/logging.js +181 -0
- package/dist_ts/ts/mail/delivery/smtpserver/utils/validation.d.ts +69 -0
- package/dist_ts/ts/mail/delivery/smtpserver/utils/validation.js +360 -0
- package/dist_ts/ts/mail/index.d.ts +8 -0
- package/dist_ts/ts/mail/index.js +13 -0
- package/dist_ts/ts/mail/routing/classes.dns.manager.d.ts +65 -0
- package/dist_ts/ts/mail/routing/classes.dns.manager.js +413 -0
- package/dist_ts/ts/mail/routing/classes.dnsmanager.d.ts +165 -0
- package/dist_ts/ts/mail/routing/classes.dnsmanager.js +430 -0
- package/dist_ts/ts/mail/routing/classes.domain.registry.d.ts +54 -0
- package/dist_ts/ts/mail/routing/classes.domain.registry.js +118 -0
- package/dist_ts/ts/mail/routing/classes.email.config.d.ts +64 -0
- package/dist_ts/ts/mail/routing/classes.email.config.js +2 -0
- package/dist_ts/ts/mail/routing/classes.email.router.d.ts +171 -0
- package/dist_ts/ts/mail/routing/classes.email.router.js +491 -0
- package/dist_ts/ts/mail/routing/classes.unified.email.server.d.ts +426 -0
- package/dist_ts/ts/mail/routing/classes.unified.email.server.js +1454 -0
- package/dist_ts/ts/mail/routing/index.d.ts +5 -0
- package/dist_ts/ts/mail/routing/index.js +7 -0
- package/dist_ts/ts/mail/routing/interfaces.d.ts +187 -0
- package/dist_ts/ts/mail/routing/interfaces.js +2 -0
- package/dist_ts/ts/mail/security/classes.dkimcreator.d.ts +68 -0
- package/dist_ts/ts/mail/security/classes.dkimcreator.js +346 -0
- package/dist_ts/ts/mail/security/classes.dkimverifier.d.ts +46 -0
- package/dist_ts/ts/mail/security/classes.dkimverifier.js +317 -0
- package/dist_ts/ts/mail/security/classes.dmarcverifier.d.ts +123 -0
- package/dist_ts/ts/mail/security/classes.dmarcverifier.js +365 -0
- package/dist_ts/ts/mail/security/classes.spfverifier.d.ts +103 -0
- package/dist_ts/ts/mail/security/classes.spfverifier.js +492 -0
- package/dist_ts/ts/mail/security/index.d.ts +4 -0
- package/dist_ts/ts/mail/security/index.js +6 -0
- package/dist_ts/ts/opsserver/classes.opsserver.d.ts +20 -0
- package/dist_ts/ts/opsserver/classes.opsserver.js +44 -0
- package/dist_ts/ts/opsserver/handlers/admin.handler.d.ts +31 -0
- package/dist_ts/ts/opsserver/handlers/admin.handler.js +177 -0
- package/dist_ts/ts/opsserver/handlers/config.handler.d.ts +10 -0
- package/dist_ts/ts/opsserver/handlers/config.handler.js +100 -0
- package/dist_ts/ts/opsserver/handlers/index.d.ts +5 -0
- package/dist_ts/ts/opsserver/handlers/index.js +6 -0
- package/dist_ts/ts/opsserver/handlers/logs.handler.d.ts +10 -0
- package/dist_ts/ts/opsserver/handlers/logs.handler.js +121 -0
- package/dist_ts/ts/opsserver/handlers/security.handler.d.ts +11 -0
- package/dist_ts/ts/opsserver/handlers/security.handler.js +118 -0
- package/dist_ts/ts/opsserver/handlers/stats.handler.d.ts +13 -0
- package/dist_ts/ts/opsserver/handlers/stats.handler.js +233 -0
- package/dist_ts/ts/opsserver/helpers/guards.d.ts +25 -0
- package/dist_ts/ts/opsserver/helpers/guards.js +41 -0
- package/dist_ts/ts/opsserver/index.d.ts +1 -0
- package/dist_ts/ts/opsserver/index.js +2 -0
- package/dist_ts/ts/paths.d.ts +14 -0
- package/dist_ts/ts/paths.js +39 -0
- package/dist_ts/ts/plugins.d.ts +46 -0
- package/dist_ts/ts/plugins.js +53 -0
- package/dist_ts/ts/security/classes.contentscanner.d.ts +160 -0
- package/dist_ts/ts/security/classes.contentscanner.js +634 -0
- package/dist_ts/ts/security/classes.ipreputationchecker.d.ts +150 -0
- package/dist_ts/ts/security/classes.ipreputationchecker.js +508 -0
- package/dist_ts/ts/security/classes.securitylogger.d.ts +140 -0
- package/dist_ts/ts/security/classes.securitylogger.js +232 -0
- package/dist_ts/ts/security/index.d.ts +3 -0
- package/dist_ts/ts/security/index.js +4 -0
- package/dist_ts/ts/sms/classes.smsservice.d.ts +15 -0
- package/dist_ts/ts/sms/classes.smsservice.js +72 -0
- package/dist_ts/ts/sms/config/sms.config.d.ts +93 -0
- package/dist_ts/ts/sms/config/sms.config.js +2 -0
- package/dist_ts/ts/sms/config/sms.schema.d.ts +5 -0
- package/dist_ts/ts/sms/config/sms.schema.js +121 -0
- package/dist_ts/ts/sms/index.d.ts +1 -0
- package/dist_ts/ts/sms/index.js +2 -0
- package/dist_ts/ts/storage/classes.storagemanager.d.ts +82 -0
- package/dist_ts/ts/storage/classes.storagemanager.js +341 -0
- package/dist_ts/ts/storage/index.d.ts +1 -0
- package/dist_ts/ts/storage/index.js +3 -0
- package/dist_ts/ts_interfaces/data/auth.d.ts +8 -0
- package/dist_ts/ts_interfaces/data/auth.js +2 -0
- package/dist_ts/ts_interfaces/data/index.d.ts +2 -0
- package/dist_ts/ts_interfaces/data/index.js +3 -0
- package/dist_ts/ts_interfaces/data/stats.d.ts +93 -0
- package/dist_ts/ts_interfaces/data/stats.js +2 -0
- package/dist_ts/ts_interfaces/index.d.ts +5 -0
- package/dist_ts/ts_interfaces/index.js +8 -0
- package/dist_ts/ts_interfaces/plugins.d.ts +2 -0
- package/dist_ts/ts_interfaces/plugins.js +4 -0
- package/dist_ts/ts_interfaces/requests/admin.d.ts +31 -0
- package/dist_ts/ts_interfaces/requests/admin.js +3 -0
- package/dist_ts/ts_interfaces/requests/config.d.ts +25 -0
- package/dist_ts/ts_interfaces/requests/config.js +3 -0
- package/dist_ts/ts_interfaces/requests/index.d.ts +4 -0
- package/dist_ts/ts_interfaces/requests/index.js +5 -0
- package/dist_ts/ts_interfaces/requests/logs.d.ts +34 -0
- package/dist_ts/ts_interfaces/requests/logs.js +4 -0
- package/dist_ts/ts_interfaces/requests/stats.d.ts +131 -0
- package/dist_ts/ts_interfaces/requests/stats.js +4 -0
- package/html/index.html +121 -0
- package/npmextra.json +45 -0
- package/package.json +83 -0
- package/readme.hints.md +906 -0
- package/readme.md +1253 -0
- package/readme.opsserver.md +351 -0
- package/test/helpers/server.loader.ts +347 -0
- package/test/helpers/smtp.client.ts +209 -0
- package/test/helpers/utils.ts +311 -0
- package/test/readme.md +443 -0
- package/test/suite/smtpclient_commands/test.ccmd-01.ehlo-helo-sending.ts +168 -0
- package/test/suite/smtpclient_commands/test.ccmd-02.mail-from-parameters.ts +277 -0
- package/test/suite/smtpclient_commands/test.ccmd-03.rcpt-to-multiple.ts +283 -0
- package/test/suite/smtpclient_commands/test.ccmd-04.data-transmission.ts +274 -0
- package/test/suite/smtpclient_commands/test.ccmd-05.auth-mechanisms.ts +306 -0
- package/test/suite/smtpclient_commands/test.ccmd-06.command-pipelining.ts +233 -0
- package/test/suite/smtpclient_commands/test.ccmd-07.response-parsing.ts +243 -0
- package/test/suite/smtpclient_commands/test.ccmd-08.rset-command.ts +333 -0
- package/test/suite/smtpclient_commands/test.ccmd-09.noop-command.ts +339 -0
- package/test/suite/smtpclient_commands/test.ccmd-10.vrfy-expn.ts +457 -0
- package/test/suite/smtpclient_commands/test.ccmd-11.help-command.ts +409 -0
- package/test/suite/smtpclient_connection/test.ccm-01.basic-tcp-connection.ts +150 -0
- package/test/suite/smtpclient_connection/test.ccm-02.tls-connection.ts +140 -0
- package/test/suite/smtpclient_connection/test.ccm-03.starttls-upgrade.ts +208 -0
- package/test/suite/smtpclient_connection/test.ccm-04.connection-pooling.ts +250 -0
- package/test/suite/smtpclient_connection/test.ccm-05.connection-reuse.ts +288 -0
- package/test/suite/smtpclient_connection/test.ccm-06.connection-timeout.ts +267 -0
- package/test/suite/smtpclient_connection/test.ccm-07.automatic-reconnection.ts +324 -0
- package/test/suite/smtpclient_connection/test.ccm-08.dns-resolution.ts +139 -0
- package/test/suite/smtpclient_connection/test.ccm-09.ipv6-dual-stack.ts +167 -0
- package/test/suite/smtpclient_connection/test.ccm-10.proxy-support.ts +305 -0
- package/test/suite/smtpclient_connection/test.ccm-11.keepalive.ts +299 -0
- package/test/suite/smtpclient_edge-cases/test.cedge-01.unusual-server-responses.ts +529 -0
- package/test/suite/smtpclient_edge-cases/test.cedge-02.malformed-commands.ts +438 -0
- package/test/suite/smtpclient_edge-cases/test.cedge-03.protocol-violations.ts +446 -0
- package/test/suite/smtpclient_edge-cases/test.cedge-04.resource-constraints.ts +530 -0
- package/test/suite/smtpclient_edge-cases/test.cedge-05.encoding-issues.ts +145 -0
- package/test/suite/smtpclient_edge-cases/test.cedge-06.large-headers.ts +180 -0
- package/test/suite/smtpclient_edge-cases/test.cedge-07.concurrent-operations.ts +204 -0
- package/test/suite/smtpclient_email-composition/test.cep-01.basic-headers.ts +245 -0
- package/test/suite/smtpclient_email-composition/test.cep-02.mime-multipart.ts +321 -0
- package/test/suite/smtpclient_email-composition/test.cep-03.attachment-encoding.ts +334 -0
- package/test/suite/smtpclient_email-composition/test.cep-04.bcc-handling.ts +187 -0
- package/test/suite/smtpclient_email-composition/test.cep-05.reply-to-return-path.ts +277 -0
- package/test/suite/smtpclient_email-composition/test.cep-06.utf8-international.ts +235 -0
- package/test/suite/smtpclient_email-composition/test.cep-07.html-inline-images.ts +489 -0
- package/test/suite/smtpclient_email-composition/test.cep-08.custom-headers.ts +293 -0
- package/test/suite/smtpclient_email-composition/test.cep-09.priority-importance.ts +314 -0
- package/test/suite/smtpclient_email-composition/test.cep-10.receipts-dsn.ts +411 -0
- package/test/suite/smtpclient_error-handling/test.cerr-01.4xx-errors.ts +232 -0
- package/test/suite/smtpclient_error-handling/test.cerr-02.5xx-errors.ts +309 -0
- package/test/suite/smtpclient_error-handling/test.cerr-03.network-failures.ts +299 -0
- package/test/suite/smtpclient_error-handling/test.cerr-04.greylisting-handling.ts +255 -0
- package/test/suite/smtpclient_error-handling/test.cerr-05.quota-exceeded.ts +273 -0
- package/test/suite/smtpclient_error-handling/test.cerr-06.invalid-recipients.ts +320 -0
- package/test/suite/smtpclient_error-handling/test.cerr-07.message-size-limits.ts +320 -0
- package/test/suite/smtpclient_error-handling/test.cerr-08.rate-limiting.ts +261 -0
- package/test/suite/smtpclient_error-handling/test.cerr-09.connection-pool-errors.ts +299 -0
- package/test/suite/smtpclient_error-handling/test.cerr-10.partial-failure.ts +373 -0
- package/test/suite/smtpclient_performance/test.cperf-01.bulk-sending.ts +332 -0
- package/test/suite/smtpclient_performance/test.cperf-02.message-throughput.ts +304 -0
- package/test/suite/smtpclient_performance/test.cperf-03.memory-usage.ts +332 -0
- package/test/suite/smtpclient_performance/test.cperf-04.cpu-utilization.ts +373 -0
- package/test/suite/smtpclient_performance/test.cperf-05.network-efficiency.ts +181 -0
- package/test/suite/smtpclient_performance/test.cperf-06.caching-strategies.ts +190 -0
- package/test/suite/smtpclient_performance/test.cperf-07.queue-management.ts +171 -0
- package/test/suite/smtpclient_performance/test.cperf-08.dns-caching.ts +50 -0
- package/test/suite/smtpclient_reliability/test.crel-01.reconnection-logic.ts +305 -0
- package/test/suite/smtpclient_reliability/test.crel-02.network-interruption.ts +207 -0
- package/test/suite/smtpclient_reliability/test.crel-03.queue-persistence.ts +469 -0
- package/test/suite/smtpclient_reliability/test.crel-04.crash-recovery.ts +520 -0
- package/test/suite/smtpclient_reliability/test.crel-05.memory-leaks.ts +503 -0
- package/test/suite/smtpclient_reliability/test.crel-06.concurrency-safety.ts +558 -0
- package/test/suite/smtpclient_reliability/test.crel-07.resource-cleanup.ts +52 -0
- package/test/suite/smtpclient_rfc-compliance/test.crfc-01.rfc5321-client.ts +283 -0
- package/test/suite/smtpclient_rfc-compliance/test.crfc-02.esmtp-compliance.ts +77 -0
- package/test/suite/smtpclient_rfc-compliance/test.crfc-03.command-syntax.ts +67 -0
- package/test/suite/smtpclient_rfc-compliance/test.crfc-04.response-codes.ts +54 -0
- package/test/suite/smtpclient_rfc-compliance/test.crfc-05.state-machine.ts +703 -0
- package/test/suite/smtpclient_rfc-compliance/test.crfc-06.protocol-negotiation.ts +688 -0
- package/test/suite/smtpclient_rfc-compliance/test.crfc-07.interoperability.ts +728 -0
- package/test/suite/smtpclient_rfc-compliance/test.crfc-08.smtp-extensions.ts +656 -0
- package/test/suite/smtpclient_security/test.csec-01.tls-verification.ts +88 -0
- package/test/suite/smtpclient_security/test.csec-02.oauth2-authentication.ts +132 -0
- package/test/suite/smtpclient_security/test.csec-03.dkim-signing.ts +138 -0
- package/test/suite/smtpclient_security/test.csec-04.spf-compliance.ts +163 -0
- package/test/suite/smtpclient_security/test.csec-05.dmarc-policy.ts +200 -0
- package/test/suite/smtpclient_security/test.csec-06.certificate-validation.ts +145 -0
- package/test/suite/smtpclient_security/test.csec-07.cipher-suites.ts +153 -0
- package/test/suite/smtpclient_security/test.csec-08.authentication-fallback.ts +154 -0
- package/test/suite/smtpclient_security/test.csec-09.relay-restrictions.ts +166 -0
- package/test/suite/smtpclient_security/test.csec-10.anti-spam-measures.ts +196 -0
- package/test/suite/smtpserver_commands/test.cmd-01.ehlo-command.ts +193 -0
- package/test/suite/smtpserver_commands/test.cmd-02.mail-from.ts +330 -0
- package/test/suite/smtpserver_commands/test.cmd-03.rcpt-to.ts +296 -0
- package/test/suite/smtpserver_commands/test.cmd-04.data-command.ts +395 -0
- package/test/suite/smtpserver_commands/test.cmd-05.noop-command.ts +320 -0
- package/test/suite/smtpserver_commands/test.cmd-06.rset-command.ts +399 -0
- package/test/suite/smtpserver_commands/test.cmd-07.vrfy-command.ts +391 -0
- package/test/suite/smtpserver_commands/test.cmd-08.expn-command.ts +450 -0
- package/test/suite/smtpserver_commands/test.cmd-09.size-extension.ts +465 -0
- package/test/suite/smtpserver_commands/test.cmd-10.help-command.ts +454 -0
- package/test/suite/smtpserver_commands/test.cmd-11.command-pipelining.ts +334 -0
- package/test/suite/smtpserver_commands/test.cmd-12.helo-command.ts +420 -0
- package/test/suite/smtpserver_commands/test.cmd-13.quit-command.ts +384 -0
- package/test/suite/smtpserver_connection/test.cm-01.tls-connection.ts +61 -0
- package/test/suite/smtpserver_connection/test.cm-02.multiple-connections.ts +112 -0
- package/test/suite/smtpserver_connection/test.cm-03.connection-timeout.ts +134 -0
- package/test/suite/smtpserver_connection/test.cm-04.connection-limits.ts +374 -0
- package/test/suite/smtpserver_connection/test.cm-05.connection-rejection.ts +296 -0
- package/test/suite/smtpserver_connection/test.cm-06.starttls-upgrade.ts +468 -0
- package/test/suite/smtpserver_connection/test.cm-07.abrupt-disconnection.ts +321 -0
- package/test/suite/smtpserver_connection/test.cm-08.tls-versions.ts +361 -0
- package/test/suite/smtpserver_connection/test.cm-09.tls-ciphers.ts +556 -0
- package/test/suite/smtpserver_connection/test.cm-10.plain-connection.ts +293 -0
- package/test/suite/smtpserver_connection/test.cm-11.keepalive.ts +382 -0
- package/test/suite/smtpserver_edge-cases/test.edge-01.very-large-email.ts +239 -0
- package/test/suite/smtpserver_edge-cases/test.edge-02.very-small-email.ts +389 -0
- package/test/suite/smtpserver_edge-cases/test.edge-03.invalid-character-handling.ts +479 -0
- package/test/suite/smtpserver_edge-cases/test.edge-04.empty-commands.ts +430 -0
- package/test/suite/smtpserver_edge-cases/test.edge-05.extremely-long-lines.ts +425 -0
- package/test/suite/smtpserver_edge-cases/test.edge-06.extremely-long-headers.ts +404 -0
- package/test/suite/smtpserver_edge-cases/test.edge-07.unusual-mime-types.ts +333 -0
- package/test/suite/smtpserver_edge-cases/test.edge-08.nested-mime-structures.ts +379 -0
- package/test/suite/smtpserver_email-processing/test.ep-01.basic-email-sending.ts +338 -0
- package/test/suite/smtpserver_email-processing/test.ep-02.invalid-email-addresses.ts +315 -0
- package/test/suite/smtpserver_email-processing/test.ep-03.multiple-recipients.ts +493 -0
- package/test/suite/smtpserver_email-processing/test.ep-04.large-email.ts +528 -0
- package/test/suite/smtpserver_email-processing/test.ep-05.mime-handling.ts +515 -0
- package/test/suite/smtpserver_email-processing/test.ep-06.attachment-handling.ts +629 -0
- package/test/suite/smtpserver_email-processing/test.ep-07.special-character-handling.ts +462 -0
- package/test/suite/smtpserver_email-processing/test.ep-08.email-routing.ts +527 -0
- package/test/suite/smtpserver_email-processing/test.ep-09.delivery-status-notifications.ts +486 -0
- package/test/suite/smtpserver_error-handling/test.err-01.syntax-errors.ts +475 -0
- package/test/suite/smtpserver_error-handling/test.err-02.invalid-sequence.ts +450 -0
- package/test/suite/smtpserver_error-handling/test.err-03.temporary-failures.ts +453 -0
- package/test/suite/smtpserver_error-handling/test.err-04.permanent-failures.ts +325 -0
- package/test/suite/smtpserver_error-handling/test.err-05.resource-exhaustion.ts +302 -0
- package/test/suite/smtpserver_error-handling/test.err-06.malformed-mime.ts +374 -0
- package/test/suite/smtpserver_error-handling/test.err-07.exception-handling.ts +333 -0
- package/test/suite/smtpserver_error-handling/test.err-08.error-logging.ts +324 -0
- package/test/suite/smtpserver_performance/test.perf-01.throughput.ts +183 -0
- package/test/suite/smtpserver_performance/test.perf-02.concurrency.ts +388 -0
- package/test/suite/smtpserver_performance/test.perf-03.cpu-utilization.ts +245 -0
- package/test/suite/smtpserver_performance/test.perf-04.memory-usage.ts +238 -0
- package/test/suite/smtpserver_performance/test.perf-05.connection-processing-time.ts +363 -0
- package/test/suite/smtpserver_performance/test.perf-06.message-processing-time.ts +252 -0
- package/test/suite/smtpserver_performance/test.perf-07.resource-cleanup.ts +317 -0
- package/test/suite/smtpserver_reliability/test.rel-01.long-running-operation.ts +344 -0
- package/test/suite/smtpserver_reliability/test.rel-02.restart-recovery.ts +328 -0
- package/test/suite/smtpserver_reliability/test.rel-03.resource-leak-detection.ts +394 -0
- package/test/suite/smtpserver_reliability/test.rel-04.error-recovery.ts +401 -0
- package/test/suite/smtpserver_reliability/test.rel-05.dns-resolution-failure.ts +335 -0
- package/test/suite/smtpserver_reliability/test.rel-06.network-interruption.ts +410 -0
- package/test/suite/smtpserver_rfc-compliance/test.rfc-01.rfc5321-compliance.ts +382 -0
- package/test/suite/smtpserver_rfc-compliance/test.rfc-02.rfc5322-compliance.ts +428 -0
- package/test/suite/smtpserver_rfc-compliance/test.rfc-03.rfc7208-spf-compliance.ts +330 -0
- package/test/suite/smtpserver_rfc-compliance/test.rfc-04.rfc6376-dkim-compliance.ts +450 -0
- package/test/suite/smtpserver_rfc-compliance/test.rfc-05.rfc7489-dmarc-compliance.ts +408 -0
- package/test/suite/smtpserver_rfc-compliance/test.rfc-06.rfc8314-tls-compliance.ts +366 -0
- package/test/suite/smtpserver_rfc-compliance/test.rfc-07.rfc3461-dsn-compliance.ts +399 -0
- package/test/suite/smtpserver_security/test.sec-01.authentication.ts +218 -0
- package/test/suite/smtpserver_security/test.sec-02.authorization.ts +286 -0
- package/test/suite/smtpserver_security/test.sec-03.dkim-processing.ts +414 -0
- package/test/suite/smtpserver_security/test.sec-04.spf-checking.ts +280 -0
- package/test/suite/smtpserver_security/test.sec-05.dmarc-policy.ts +374 -0
- package/test/suite/smtpserver_security/test.sec-06.ip-reputation.ts +303 -0
- package/test/suite/smtpserver_security/test.sec-07.content-scanning.ts +409 -0
- package/test/suite/smtpserver_security/test.sec-08.rate-limiting.ts +324 -0
- package/test/suite/smtpserver_security/test.sec-09.tls-certificate-validation.ts +312 -0
- package/test/suite/smtpserver_security/test.sec-10.header-injection-prevention.ts +332 -0
- package/test/suite/smtpserver_security/test.sec-11.bounce-management.ts +363 -0
- package/test/test.base.ts +65 -0
- package/test/test.bouncemanager.ts +196 -0
- package/test/test.config.md +175 -0
- package/test/test.contentscanner.ts +265 -0
- package/test/test.dcrouter.email.ts +201 -0
- package/test/test.deliverability.ts +55 -0
- package/test/test.dns-manager-creation.ts +141 -0
- package/test/test.dns-mode-switching.ts +257 -0
- package/test/test.dns-server-config.ts +140 -0
- package/test/test.dns-socket-handler.ts +169 -0
- package/test/test.dns-validation.ts +283 -0
- package/test/test.email-socket-handler.ts +228 -0
- package/test/test.email.integration.ts +377 -0
- package/test/test.email.router.ts +283 -0
- package/test/test.emailauth.ts +195 -0
- package/test/test.errors.ts +408 -0
- package/test/test.integration.storage.ts +313 -0
- package/test/test.integration.ts +75 -0
- package/test/test.ipreputationchecker.ts +179 -0
- package/test/test.ipwarmupmanager.ts +323 -0
- package/test/test.jwt-auth.ts +130 -0
- package/test/test.minimal.ts +66 -0
- package/test/test.opsserver-api.ts +83 -0
- package/test/test.protected-endpoint.ts +115 -0
- package/test/test.rate-limiting-integration.ts +236 -0
- package/test/test.ratelimiter.ts +141 -0
- package/test/test.reputationmonitor.ts +262 -0
- package/test/test.smartmail.ts +248 -0
- package/test/test.smtp.client.compatibility.ts +154 -0
- package/test/test.smtp.client.ts +191 -0
- package/test/test.smtp.server.ts +180 -0
- package/test/test.socket-handler-integration.ts +240 -0
- package/test/test.socket-handler-unit.ts +198 -0
- package/test/test.storagemanager.ts +289 -0
- package/ts/00_commitinfo_data.ts +8 -0
- package/ts/classes.dcrouter.ts +1310 -0
- package/ts/config/index.ts +2 -0
- package/ts/config/validator.ts +266 -0
- package/ts/deliverability/classes.ipwarmupmanager.ts +896 -0
- package/ts/deliverability/classes.senderreputationmonitor.ts +1244 -0
- package/ts/deliverability/index.ts +13 -0
- package/ts/errors/base.errors.ts +525 -0
- package/ts/errors/email.errors.ts +383 -0
- package/ts/errors/error-handler.ts +412 -0
- package/ts/errors/error.codes.ts +165 -0
- package/ts/errors/index.ts +195 -0
- package/ts/errors/mta.errors.ts +681 -0
- package/ts/errors/reputation.errors.ts +422 -0
- package/ts/index.ts +7 -0
- package/ts/logger.ts +91 -0
- package/ts/mail/core/classes.bouncemanager.ts +965 -0
- package/ts/mail/core/classes.email.ts +941 -0
- package/ts/mail/core/classes.emailvalidator.ts +239 -0
- package/ts/mail/core/classes.templatemanager.ts +320 -0
- package/ts/mail/core/index.ts +5 -0
- package/ts/mail/delivery/classes.delivery.queue.ts +645 -0
- package/ts/mail/delivery/classes.delivery.system.ts +1089 -0
- package/ts/mail/delivery/classes.emailsendjob.ts +447 -0
- package/ts/mail/delivery/classes.emailsendjob.ts.backup +691 -0
- package/ts/mail/delivery/classes.emailsignjob.ts +67 -0
- package/ts/mail/delivery/classes.mta.config.ts +73 -0
- package/ts/mail/delivery/classes.ratelimiter.ts +281 -0
- package/ts/mail/delivery/classes.smtp.client.legacy.ts +1422 -0
- package/ts/mail/delivery/classes.unified.rate.limiter.ts +1053 -0
- package/ts/mail/delivery/index.ts +24 -0
- package/ts/mail/delivery/interfaces.ts +291 -0
- package/ts/mail/delivery/smtpclient/auth-handler.ts +232 -0
- package/ts/mail/delivery/smtpclient/command-handler.ts +343 -0
- package/ts/mail/delivery/smtpclient/connection-manager.ts +289 -0
- package/ts/mail/delivery/smtpclient/constants.ts +145 -0
- package/ts/mail/delivery/smtpclient/create-client.ts +94 -0
- package/ts/mail/delivery/smtpclient/error-handler.ts +141 -0
- package/ts/mail/delivery/smtpclient/index.ts +24 -0
- package/ts/mail/delivery/smtpclient/interfaces.ts +242 -0
- package/ts/mail/delivery/smtpclient/smtp-client.ts +357 -0
- package/ts/mail/delivery/smtpclient/tls-handler.ts +254 -0
- package/ts/mail/delivery/smtpclient/utils/helpers.ts +224 -0
- package/ts/mail/delivery/smtpclient/utils/logging.ts +212 -0
- package/ts/mail/delivery/smtpclient/utils/validation.ts +170 -0
- package/ts/mail/delivery/smtpserver/certificate-utils.ts +398 -0
- package/ts/mail/delivery/smtpserver/command-handler.ts +1340 -0
- package/ts/mail/delivery/smtpserver/connection-manager.ts +1045 -0
- package/ts/mail/delivery/smtpserver/constants.ts +181 -0
- package/ts/mail/delivery/smtpserver/create-server.ts +31 -0
- package/ts/mail/delivery/smtpserver/data-handler.ts +1283 -0
- package/ts/mail/delivery/smtpserver/index.ts +32 -0
- package/ts/mail/delivery/smtpserver/interfaces.ts +655 -0
- package/ts/mail/delivery/smtpserver/secure-server.ts +97 -0
- package/ts/mail/delivery/smtpserver/security-handler.ts +345 -0
- package/ts/mail/delivery/smtpserver/session-manager.ts +557 -0
- package/ts/mail/delivery/smtpserver/smtp-server.ts +804 -0
- package/ts/mail/delivery/smtpserver/starttls-handler.ts +262 -0
- package/ts/mail/delivery/smtpserver/tls-handler.ts +346 -0
- package/ts/mail/delivery/smtpserver/utils/adaptive-logging.ts +514 -0
- package/ts/mail/delivery/smtpserver/utils/helpers.ts +246 -0
- package/ts/mail/delivery/smtpserver/utils/logging.ts +246 -0
- package/ts/mail/delivery/smtpserver/utils/validation.ts +436 -0
- package/ts/mail/index.ts +19 -0
- package/ts/mail/routing/classes.dns.manager.ts +563 -0
- package/ts/mail/routing/classes.dnsmanager.ts +559 -0
- package/ts/mail/routing/classes.domain.registry.ts +139 -0
- package/ts/mail/routing/classes.email.config.ts +82 -0
- package/ts/mail/routing/classes.email.router.ts +575 -0
- package/ts/mail/routing/classes.unified.email.server.ts +1873 -0
- package/ts/mail/routing/index.ts +6 -0
- package/ts/mail/routing/interfaces.ts +202 -0
- package/ts/mail/security/classes.dkimcreator.ts +431 -0
- package/ts/mail/security/classes.dkimverifier.ts +382 -0
- package/ts/mail/security/classes.dmarcverifier.ts +478 -0
- package/ts/mail/security/classes.spfverifier.ts +606 -0
- package/ts/mail/security/index.ts +5 -0
- package/ts/opsserver/classes.opsserver.ts +65 -0
- package/ts/opsserver/handlers/admin.handler.ts +240 -0
- package/ts/opsserver/handlers/config.handler.ts +150 -0
- package/ts/opsserver/handlers/index.ts +5 -0
- package/ts/opsserver/handlers/logs.handler.ts +195 -0
- package/ts/opsserver/handlers/security.handler.ts +208 -0
- package/ts/opsserver/handlers/stats.handler.ts +344 -0
- package/ts/opsserver/helpers/guards.ts +56 -0
- package/ts/opsserver/index.ts +1 -0
- package/ts/paths.ts +48 -0
- package/ts/plugins.ts +94 -0
- package/ts/security/classes.contentscanner.ts +739 -0
- package/ts/security/classes.ipreputationchecker.ts +592 -0
- package/ts/security/classes.securitylogger.ts +299 -0
- package/ts/security/index.ts +21 -0
- package/ts/sms/classes.smsservice.ts +98 -0
- package/ts/sms/config/sms.config.ts +109 -0
- package/ts/sms/config/sms.schema.ts +122 -0
- package/ts/sms/index.ts +1 -0
- package/ts/storage/classes.storagemanager.ts +400 -0
- package/ts/storage/index.ts +2 -0
- package/ts/tspublish.json +3 -0
- package/ts_interfaces/data/auth.ts +8 -0
- package/ts_interfaces/data/index.ts +2 -0
- package/ts_interfaces/data/stats.ts +101 -0
- package/ts_interfaces/index.ts +9 -0
- package/ts_interfaces/plugins.ts +6 -0
- package/ts_interfaces/requests/admin.ts +46 -0
- package/ts_interfaces/requests/config.ts +35 -0
- package/ts_interfaces/requests/index.ts +4 -0
- package/ts_interfaces/requests/logs.ts +44 -0
- package/ts_interfaces/requests/stats.ts +162 -0
- package/ts_interfaces/tspublish.json +3 -0
- package/ts_web/00_commitinfo_data.ts +8 -0
- package/ts_web/appstate.ts +361 -0
- package/ts_web/elements/index.ts +7 -0
- package/ts_web/elements/ops-dashboard.ts +165 -0
- package/ts_web/elements/ops-view-config.ts +268 -0
- package/ts_web/elements/ops-view-logs.ts +207 -0
- package/ts_web/elements/ops-view-overview.ts +222 -0
- package/ts_web/elements/ops-view-security.ts +471 -0
- package/ts_web/elements/ops-view-stats.ts +299 -0
- package/ts_web/elements/shared/css.ts +10 -0
- package/ts_web/elements/shared/index.ts +2 -0
- package/ts_web/elements/shared/ops-sectionheading.ts +42 -0
- package/ts_web/index.ts +9 -0
- package/ts_web/plugins.ts +11 -0
- package/ts_web/tspublish.json +3 -0
- package/tsconfig.json +15 -0
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
# DCRouter OpsServer Implementation Plan
|
|
2
|
+
|
|
3
|
+
**Command to reread CLAUDE.md: `cat /home/philkunz/.claude/CLAUDE.md`**
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
This document outlines the implementation plan for adding a TypedRequest-based API to the DCRouter OpsServer, following the patterns established in the cloudly project. The goal is to create a type-safe, reactive management dashboard with real-time statistics and monitoring capabilities.
|
|
8
|
+
|
|
9
|
+
## Architecture Overview
|
|
10
|
+
|
|
11
|
+
The implementation follows a clear separation of concerns:
|
|
12
|
+
- **Backend**: TypedRequest handlers in OpsServer
|
|
13
|
+
- **Frontend**: Reactive web components with Smartstate
|
|
14
|
+
- **Communication**: Type-safe requests via TypedRequest pattern
|
|
15
|
+
- **State Management**: Centralized state with reactive updates
|
|
16
|
+
|
|
17
|
+
## Implementation Phases
|
|
18
|
+
|
|
19
|
+
### Phase 1: Interface Definition ✓
|
|
20
|
+
|
|
21
|
+
Create TypeScript interfaces for all API operations:
|
|
22
|
+
|
|
23
|
+
#### Directory Structure ✓
|
|
24
|
+
```
|
|
25
|
+
ts_interfaces/
|
|
26
|
+
plugins.ts # TypedRequest interfaces import
|
|
27
|
+
data/ # Data type definitions
|
|
28
|
+
auth.ts # IIdentity interface
|
|
29
|
+
stats.ts # Server, Email, DNS, Security types
|
|
30
|
+
index.ts # Exports
|
|
31
|
+
requests/ # Request interfaces
|
|
32
|
+
admin.ts # Authentication requests
|
|
33
|
+
config.ts # Configuration management
|
|
34
|
+
logs.ts # Log retrieval with IVirtualStream
|
|
35
|
+
stats.ts # Statistics endpoints
|
|
36
|
+
index.ts # Exports
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
#### Key Interfaces Defined ✓
|
|
40
|
+
- **Server Statistics**
|
|
41
|
+
- [x] `IReq_GetServerStatistics` - Server metrics with history
|
|
42
|
+
|
|
43
|
+
- **Email Operations**
|
|
44
|
+
- [x] `IReq_GetEmailStatistics` - Email delivery stats
|
|
45
|
+
- [x] `IReq_GetQueueStatus` - Queue monitoring
|
|
46
|
+
|
|
47
|
+
- **DNS Management**
|
|
48
|
+
- [x] `IReq_GetDnsStatistics` - DNS query metrics
|
|
49
|
+
|
|
50
|
+
- **Rate Limiting**
|
|
51
|
+
- [x] `IReq_GetRateLimitStatus` - Rate limit info
|
|
52
|
+
|
|
53
|
+
- **Security Metrics**
|
|
54
|
+
- [x] `IReq_GetSecurityMetrics` - Security stats and trends
|
|
55
|
+
- [x] `IReq_GetActiveConnections` - Connection monitoring
|
|
56
|
+
|
|
57
|
+
- **Logging**
|
|
58
|
+
- [x] `IReq_GetRecentLogs` - Paginated log retrieval
|
|
59
|
+
- [x] `IReq_GetLogStream` - Real-time log streaming with IVirtualStream
|
|
60
|
+
|
|
61
|
+
- **Configuration**
|
|
62
|
+
- [x] `IReq_GetConfiguration` - Read config
|
|
63
|
+
- [x] `IReq_UpdateConfiguration` - Update config
|
|
64
|
+
|
|
65
|
+
- **Authentication**
|
|
66
|
+
- [x] `IReq_AdminLoginWithUsernameAndPassword` - Admin login
|
|
67
|
+
- [x] `IReq_AdminLogout` - Logout
|
|
68
|
+
- [x] `IReq_VerifyIdentity` - Token verification
|
|
69
|
+
|
|
70
|
+
- **Health Check**
|
|
71
|
+
- [x] `IReq_GetHealthStatus` - Service health monitoring
|
|
72
|
+
|
|
73
|
+
### Phase 2: Backend Implementation ✓
|
|
74
|
+
|
|
75
|
+
#### 2.1 Enhance OpsServer (`ts/opsserver/classes.opsserver.ts`) ✓
|
|
76
|
+
|
|
77
|
+
- [x] Add TypedRouter initialization
|
|
78
|
+
- [x] Use TypedServer's built-in typedrouter
|
|
79
|
+
- [x] CORS is already handled by TypedServer
|
|
80
|
+
- [x] Add handler registration method
|
|
81
|
+
|
|
82
|
+
```typescript
|
|
83
|
+
// Example structure following cloudly pattern
|
|
84
|
+
public typedrouter = new plugins.typedrequest.TypedRouter();
|
|
85
|
+
|
|
86
|
+
constructor(private dcRouterRef: DcRouter) {
|
|
87
|
+
// Add our typedrouter to the dcRouter's main typedrouter
|
|
88
|
+
this.dcRouterRef.typedrouter.addTypedRouter(this.typedrouter);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
public async start() {
|
|
92
|
+
// TypedServer already has a built-in typedrouter at /typedrequest
|
|
93
|
+
this.server = new plugins.typedserver.utilityservers.UtilityWebsiteServer({
|
|
94
|
+
domain: 'localhost',
|
|
95
|
+
feedMetadata: null,
|
|
96
|
+
serveDir: paths.distServe,
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
// The server's typedrouter is automatically available
|
|
100
|
+
// Add the main dcRouter typedrouter to the server's typedrouter
|
|
101
|
+
this.server.typedrouter.addTypedRouter(this.dcRouterRef.typedrouter);
|
|
102
|
+
|
|
103
|
+
this.setupHandlers();
|
|
104
|
+
await this.server.start(3000);
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**Note**: TypedServer automatically provides the `/typedrequest` endpoint with its built-in typedrouter. We just need to add our routers to it using the `addTypedRouter()` method.
|
|
109
|
+
|
|
110
|
+
#### Hierarchical TypedRouter Structure
|
|
111
|
+
|
|
112
|
+
Following cloudly's pattern, we'll use a hierarchical router structure:
|
|
113
|
+
|
|
114
|
+
```
|
|
115
|
+
TypedServer (built-in typedrouter at /typedrequest)
|
|
116
|
+
└── DcRouter.typedrouter (main router)
|
|
117
|
+
└── OpsServer.typedrouter (ops-specific handlers)
|
|
118
|
+
├── StatsHandler.typedrouter
|
|
119
|
+
├── ConfigHandler.typedrouter
|
|
120
|
+
└── SecurityHandler.typedrouter
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
This allows clean separation of concerns while keeping all handlers accessible through the single `/typedrequest` endpoint.
|
|
124
|
+
|
|
125
|
+
#### 2.2 Create Handler Classes ✓
|
|
126
|
+
|
|
127
|
+
Create modular handlers in `ts/opsserver/handlers/`:
|
|
128
|
+
|
|
129
|
+
- [x] `stats.handler.ts` - Server and performance statistics
|
|
130
|
+
- [x] `security.handler.ts` - Security and reputation metrics
|
|
131
|
+
- [x] `config.handler.ts` - Configuration management
|
|
132
|
+
- [x] `logs.handler.ts` - Log retrieval and streaming
|
|
133
|
+
- [x] `admin.handler.ts` - Authentication and session management
|
|
134
|
+
|
|
135
|
+
Each handler should:
|
|
136
|
+
- Have its own typedrouter that gets added to OpsServer's router
|
|
137
|
+
- Access the main DCRouter instance
|
|
138
|
+
- Register handlers using TypedHandler instances
|
|
139
|
+
- Format responses according to interfaces
|
|
140
|
+
- Handle errors gracefully
|
|
141
|
+
|
|
142
|
+
Example handler structure:
|
|
143
|
+
```typescript
|
|
144
|
+
export class StatsHandler {
|
|
145
|
+
public typedrouter = new plugins.typedrequest.TypedRouter();
|
|
146
|
+
|
|
147
|
+
constructor(private opsServerRef: OpsServer) {
|
|
148
|
+
// Add this handler's router to the parent
|
|
149
|
+
this.opsServerRef.typedrouter.addTypedRouter(this.typedrouter);
|
|
150
|
+
this.registerHandlers();
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
private registerHandlers() {
|
|
154
|
+
this.typedrouter.addTypedHandler(
|
|
155
|
+
new plugins.typedrequest.TypedHandler<IReq_GetServerStatistics>(
|
|
156
|
+
'getServerStatistics',
|
|
157
|
+
async (dataArg, toolsArg) => {
|
|
158
|
+
const stats = await this.collectServerStats();
|
|
159
|
+
return stats;
|
|
160
|
+
}
|
|
161
|
+
)
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### Phase 3: Frontend State Management ✓
|
|
168
|
+
|
|
169
|
+
#### 3.1 Set up Smartstate (`ts_web/appstate.ts`) ✓
|
|
170
|
+
|
|
171
|
+
- [x] Initialize Smartstate instance
|
|
172
|
+
- [x] Create state parts with appropriate persistence
|
|
173
|
+
- [x] Define initial state structures
|
|
174
|
+
|
|
175
|
+
```typescript
|
|
176
|
+
// State structure example
|
|
177
|
+
interface IStatsState {
|
|
178
|
+
serverStats: IRes_ServerStatistics | null;
|
|
179
|
+
emailStats: IRes_EmailStatistics | null;
|
|
180
|
+
dnsStats: IRes_DnsStatistics | null;
|
|
181
|
+
lastUpdated: number;
|
|
182
|
+
isLoading: boolean;
|
|
183
|
+
error: string | null;
|
|
184
|
+
}
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
#### 3.2 State Parts to Create ✓
|
|
188
|
+
|
|
189
|
+
- [x] `statsState` - Runtime statistics (soft persistence)
|
|
190
|
+
- [x] `configState` - Configuration data (soft persistence)
|
|
191
|
+
- [x] `uiState` - UI preferences (persistent)
|
|
192
|
+
- [x] `loginState` - Authentication state (persistent)
|
|
193
|
+
|
|
194
|
+
### Phase 4: Frontend Integration ✓
|
|
195
|
+
|
|
196
|
+
#### 4.1 API Client Setup ✓
|
|
197
|
+
|
|
198
|
+
- [x] TypedRequest instances created inline within actions
|
|
199
|
+
- [x] Base URL handled through relative paths
|
|
200
|
+
- [x] Error handling integrated in actions
|
|
201
|
+
- [x] Following cloudly pattern of creating requests within actions
|
|
202
|
+
|
|
203
|
+
#### 4.2 Create Actions (`ts_web/appstate.ts`) ✓
|
|
204
|
+
|
|
205
|
+
- [x] `loginAction` - Authentication with JWT
|
|
206
|
+
- [x] `logoutAction` - Clear authentication state
|
|
207
|
+
- [x] `fetchAllStatsAction` - Batch fetch all statistics
|
|
208
|
+
- [x] `fetchConfigurationAction` - Get configuration
|
|
209
|
+
- [x] `updateConfigurationAction` - Update configuration
|
|
210
|
+
- [x] `fetchRecentLogsAction` - Get recent logs
|
|
211
|
+
- [x] `toggleAutoRefreshAction` - Toggle auto-refresh
|
|
212
|
+
- [x] `setActiveViewAction` - Change active view
|
|
213
|
+
- [x] Error handling in all actions
|
|
214
|
+
|
|
215
|
+
#### 4.3 Update Dashboard Component (`ts_web/elements/ops-dashboard.ts`) ✓
|
|
216
|
+
|
|
217
|
+
- [x] Subscribe to state changes (login and UI state)
|
|
218
|
+
- [x] Implement reactive UI updates
|
|
219
|
+
- [x] Use dees-simple-login and dees-simple-appdash components
|
|
220
|
+
- [x] Create view components for different sections
|
|
221
|
+
- [x] Implement auto-refresh timer functionality
|
|
222
|
+
|
|
223
|
+
### Phase 5: Component Structure ✓
|
|
224
|
+
|
|
225
|
+
Created modular view components in `ts_web/elements/`:
|
|
226
|
+
|
|
227
|
+
- [x] `ops-view-overview.ts` - Overview with server, email, and DNS statistics
|
|
228
|
+
- [x] `ops-view-stats.ts` - Detailed statistics with tables and metrics
|
|
229
|
+
- [x] `ops-view-logs.ts` - Log viewer with filtering and search
|
|
230
|
+
- [x] `ops-view-config.ts` - Configuration editor with JSON editing
|
|
231
|
+
- [x] `ops-view-security.ts` - Security metrics and threat monitoring
|
|
232
|
+
- [x] `shared/ops-sectionheading.ts` - Reusable section heading component
|
|
233
|
+
- [x] `shared/css.ts` - Shared CSS styles
|
|
234
|
+
|
|
235
|
+
### Phase 6: Optional Enhancements
|
|
236
|
+
|
|
237
|
+
#### 6.1 Authentication ✓ (Implemented)
|
|
238
|
+
- [x] JWT-based authentication using `@push.rocks/smartjwt`
|
|
239
|
+
- [x] Guards for identity validation and admin access
|
|
240
|
+
- [x] Login/logout endpoints following cloudly pattern
|
|
241
|
+
- [ ] Login component (frontend)
|
|
242
|
+
- [ ] Protected route handling (frontend)
|
|
243
|
+
- [ ] Session persistence (frontend)
|
|
244
|
+
|
|
245
|
+
#### 6.2 Real-time Updates (future)
|
|
246
|
+
- [ ] WebSocket integration for live stats
|
|
247
|
+
- [ ] Push notifications for critical events
|
|
248
|
+
- [ ] Event streaming for logs
|
|
249
|
+
|
|
250
|
+
## Technical Stack
|
|
251
|
+
|
|
252
|
+
### Dependencies to Use
|
|
253
|
+
- `@api.global/typedserver` - Server with built-in typedrouter at `/typedrequest`
|
|
254
|
+
- `@api.global/typedrequest` - TypedRouter and TypedHandler classes
|
|
255
|
+
- `@design.estate/dees-domtools` - Frontend TypedRequest client
|
|
256
|
+
- `@push.rocks/smartstate` - State management
|
|
257
|
+
- `@design.estate/dees-element` - Web components
|
|
258
|
+
- `@design.estate/dees-catalog` - UI components
|
|
259
|
+
|
|
260
|
+
### Existing Dependencies to Leverage
|
|
261
|
+
- Current DCRouter instance and statistics
|
|
262
|
+
- Existing error handling patterns
|
|
263
|
+
- Logger infrastructure
|
|
264
|
+
- Security modules
|
|
265
|
+
|
|
266
|
+
## Development Workflow
|
|
267
|
+
|
|
268
|
+
1. **Start with interfaces** - Define all types first
|
|
269
|
+
2. **Implement one handler** - Start with server stats
|
|
270
|
+
3. **Create minimal frontend** - Test with one endpoint
|
|
271
|
+
4. **Iterate** - Add more handlers and UI components
|
|
272
|
+
5. **Polish** - Add error handling, loading states, etc.
|
|
273
|
+
|
|
274
|
+
## Testing Strategy
|
|
275
|
+
|
|
276
|
+
- [ ] Unit tests for handlers
|
|
277
|
+
- [ ] Integration tests for API endpoints
|
|
278
|
+
- [ ] Frontend component tests
|
|
279
|
+
- [ ] End-to-end testing with real DCRouter instance
|
|
280
|
+
|
|
281
|
+
## Success Criteria
|
|
282
|
+
|
|
283
|
+
- Type-safe communication between frontend and backend
|
|
284
|
+
- Real-time statistics display
|
|
285
|
+
- Responsive and reactive UI
|
|
286
|
+
- Clean, maintainable code structure
|
|
287
|
+
- Consistent with cloudly patterns
|
|
288
|
+
- Easy to extend with new features
|
|
289
|
+
|
|
290
|
+
## Notes
|
|
291
|
+
|
|
292
|
+
- Follow existing code conventions in the project
|
|
293
|
+
- Use pnpm for all package management
|
|
294
|
+
- Ensure all tests pass before marking complete
|
|
295
|
+
- Document any deviations from the plan
|
|
296
|
+
|
|
297
|
+
---
|
|
298
|
+
|
|
299
|
+
## Progress Status
|
|
300
|
+
|
|
301
|
+
### Completed ✓
|
|
302
|
+
- **Phase 1: Interface Definition** - All TypedRequest interfaces created following cloudly pattern
|
|
303
|
+
- Created proper TypedRequest interfaces with `method`, `request`, and `response` properties
|
|
304
|
+
- Used `IVirtualStream` for log streaming
|
|
305
|
+
- Added `@api.global/typedrequest-interfaces` dependency
|
|
306
|
+
- All interfaces compile successfully
|
|
307
|
+
|
|
308
|
+
- **Phase 2: Backend Implementation** - TypedRouter integration and handlers
|
|
309
|
+
- Enhanced OpsServer with hierarchical TypedRouter structure
|
|
310
|
+
- Created all handler classes with proper TypedHandler registration
|
|
311
|
+
- Implemented mock data responses for all endpoints
|
|
312
|
+
- Fixed all TypeScript compilation errors
|
|
313
|
+
- VirtualStream used for log streaming with Uint8Array encoding
|
|
314
|
+
- **JWT Authentication** - Following cloudly pattern:
|
|
315
|
+
- Added `@push.rocks/smartjwt` and `@push.rocks/smartguard` dependencies
|
|
316
|
+
- Updated IIdentity interface to match cloudly structure
|
|
317
|
+
- Implemented JWT-based authentication with RSA keypairs
|
|
318
|
+
- Created validIdentityGuard and adminIdentityGuard
|
|
319
|
+
- Added guard helpers for protecting endpoints
|
|
320
|
+
- Full test coverage for JWT authentication flows
|
|
321
|
+
|
|
322
|
+
- **Phase 3: Frontend State Management** - Smartstate implementation
|
|
323
|
+
- Initialized Smartstate with proper state parts
|
|
324
|
+
- Created state interfaces for all data types
|
|
325
|
+
- Implemented persistent vs soft state persistence
|
|
326
|
+
- Set up reactive subscriptions
|
|
327
|
+
|
|
328
|
+
- **Phase 4: Frontend Integration** - Complete dashboard implementation
|
|
329
|
+
- Created all state management actions with TypedRequest
|
|
330
|
+
- Implemented JWT authentication flow in frontend
|
|
331
|
+
- Built reactive dashboard with dees-simple-login and dees-simple-appdash
|
|
332
|
+
- Added auto-refresh functionality
|
|
333
|
+
- Fixed all interface import issues (using dist_ts_interfaces)
|
|
334
|
+
|
|
335
|
+
- **Phase 5: Component Structure** - View components
|
|
336
|
+
- Created all view components following cloudly patterns
|
|
337
|
+
- Implemented reactive data binding with state subscriptions
|
|
338
|
+
- Added interactive features (filtering, editing, refresh controls)
|
|
339
|
+
- Used @design.estate/dees-catalog components throughout
|
|
340
|
+
- Created shared components and styles
|
|
341
|
+
|
|
342
|
+
### Next Steps
|
|
343
|
+
- Write comprehensive tests for handlers and frontend components
|
|
344
|
+
- Implement real data sources (replace mock data)
|
|
345
|
+
- Add WebSocket support for real-time updates
|
|
346
|
+
- Enhance error handling and user feedback
|
|
347
|
+
- Add more detailed charts and visualizations
|
|
348
|
+
|
|
349
|
+
---
|
|
350
|
+
|
|
351
|
+
*This plan is a living document. Update it as implementation progresses.*
|
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
import * as plugins from '../../ts/plugins.js';
|
|
2
|
+
import { UnifiedEmailServer } from '../../ts/mail/routing/classes.unified.email.server.js';
|
|
3
|
+
import { createSmtpServer } from '../../ts/mail/delivery/smtpserver/index.js';
|
|
4
|
+
import type { ISmtpServerOptions } from '../../ts/mail/delivery/smtpserver/interfaces.js';
|
|
5
|
+
import type { net } from '../../ts/plugins.js';
|
|
6
|
+
|
|
7
|
+
export interface ITestServerConfig {
|
|
8
|
+
port: number;
|
|
9
|
+
hostname?: string;
|
|
10
|
+
tlsEnabled?: boolean;
|
|
11
|
+
authRequired?: boolean;
|
|
12
|
+
timeout?: number;
|
|
13
|
+
testCertPath?: string;
|
|
14
|
+
testKeyPath?: string;
|
|
15
|
+
maxConnections?: number;
|
|
16
|
+
size?: number;
|
|
17
|
+
maxRecipients?: number;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface ITestServer {
|
|
21
|
+
server: any;
|
|
22
|
+
smtpServer: any;
|
|
23
|
+
port: number;
|
|
24
|
+
hostname: string;
|
|
25
|
+
config: ITestServerConfig;
|
|
26
|
+
startTime: number;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Starts a test SMTP server with the given configuration
|
|
31
|
+
*/
|
|
32
|
+
export async function startTestServer(config: ITestServerConfig): Promise<ITestServer> {
|
|
33
|
+
const serverConfig = {
|
|
34
|
+
port: config.port || 2525,
|
|
35
|
+
hostname: config.hostname || 'localhost',
|
|
36
|
+
tlsEnabled: config.tlsEnabled || false,
|
|
37
|
+
authRequired: config.authRequired || false,
|
|
38
|
+
timeout: config.timeout || 30000,
|
|
39
|
+
maxConnections: config.maxConnections || 100,
|
|
40
|
+
size: config.size || 10 * 1024 * 1024, // 10MB default
|
|
41
|
+
maxRecipients: config.maxRecipients || 100
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
// Create a mock email server for testing
|
|
45
|
+
const mockEmailServer = {
|
|
46
|
+
processEmailByMode: async (emailData: any) => {
|
|
47
|
+
console.log(`📧 [Test Server] Processing email:`, emailData.subject || 'No subject');
|
|
48
|
+
return emailData;
|
|
49
|
+
},
|
|
50
|
+
getRateLimiter: () => {
|
|
51
|
+
// Return a mock rate limiter for testing
|
|
52
|
+
return {
|
|
53
|
+
recordConnection: (_ip: string) => ({ allowed: true, remaining: 100 }),
|
|
54
|
+
checkConnectionLimit: async (_ip: string) => ({ allowed: true, remaining: 100 }),
|
|
55
|
+
checkMessageLimit: (_senderAddress: string, _ip: string, _recipientCount?: number, _pattern?: string, _domain?: string) => ({ allowed: true, remaining: 1000 }),
|
|
56
|
+
checkRecipientLimit: async (_session: any) => ({ allowed: true, remaining: 50 }),
|
|
57
|
+
recordAuthenticationFailure: async (_ip: string) => {},
|
|
58
|
+
recordSyntaxError: async (_ip: string) => {},
|
|
59
|
+
recordCommandError: async (_ip: string) => {},
|
|
60
|
+
isBlocked: async (_ip: string) => false,
|
|
61
|
+
cleanup: async () => {}
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
} as any;
|
|
65
|
+
|
|
66
|
+
// Load test certificates
|
|
67
|
+
let key: string;
|
|
68
|
+
let cert: string;
|
|
69
|
+
|
|
70
|
+
if (serverConfig.tlsEnabled) {
|
|
71
|
+
try {
|
|
72
|
+
const certPath = config.testCertPath || './test/fixtures/test-cert.pem';
|
|
73
|
+
const keyPath = config.testKeyPath || './test/fixtures/test-key.pem';
|
|
74
|
+
|
|
75
|
+
cert = await plugins.fs.promises.readFile(certPath, 'utf8');
|
|
76
|
+
key = await plugins.fs.promises.readFile(keyPath, 'utf8');
|
|
77
|
+
} catch (error) {
|
|
78
|
+
console.warn('⚠️ Failed to load TLS certificates, falling back to self-signed');
|
|
79
|
+
// Generate self-signed certificate for testing
|
|
80
|
+
const forge = await import('node-forge');
|
|
81
|
+
const pki = forge.default.pki;
|
|
82
|
+
|
|
83
|
+
// Generate key pair
|
|
84
|
+
const keys = pki.rsa.generateKeyPair(2048);
|
|
85
|
+
|
|
86
|
+
// Create certificate
|
|
87
|
+
const certificate = pki.createCertificate();
|
|
88
|
+
certificate.publicKey = keys.publicKey;
|
|
89
|
+
certificate.serialNumber = '01';
|
|
90
|
+
certificate.validity.notBefore = new Date();
|
|
91
|
+
certificate.validity.notAfter = new Date();
|
|
92
|
+
certificate.validity.notAfter.setFullYear(certificate.validity.notBefore.getFullYear() + 1);
|
|
93
|
+
|
|
94
|
+
const attrs = [{
|
|
95
|
+
name: 'commonName',
|
|
96
|
+
value: serverConfig.hostname
|
|
97
|
+
}];
|
|
98
|
+
certificate.setSubject(attrs);
|
|
99
|
+
certificate.setIssuer(attrs);
|
|
100
|
+
certificate.sign(keys.privateKey);
|
|
101
|
+
|
|
102
|
+
// Convert to PEM
|
|
103
|
+
cert = pki.certificateToPem(certificate);
|
|
104
|
+
key = pki.privateKeyToPem(keys.privateKey);
|
|
105
|
+
}
|
|
106
|
+
} else {
|
|
107
|
+
// Always provide a self-signed certificate for non-TLS servers
|
|
108
|
+
// This is required by the interface
|
|
109
|
+
const forge = await import('node-forge');
|
|
110
|
+
const pki = forge.default.pki;
|
|
111
|
+
|
|
112
|
+
// Generate key pair
|
|
113
|
+
const keys = pki.rsa.generateKeyPair(2048);
|
|
114
|
+
|
|
115
|
+
// Create certificate
|
|
116
|
+
const certificate = pki.createCertificate();
|
|
117
|
+
certificate.publicKey = keys.publicKey;
|
|
118
|
+
certificate.serialNumber = '01';
|
|
119
|
+
certificate.validity.notBefore = new Date();
|
|
120
|
+
certificate.validity.notAfter = new Date();
|
|
121
|
+
certificate.validity.notAfter.setFullYear(certificate.validity.notBefore.getFullYear() + 1);
|
|
122
|
+
|
|
123
|
+
const attrs = [{
|
|
124
|
+
name: 'commonName',
|
|
125
|
+
value: serverConfig.hostname
|
|
126
|
+
}];
|
|
127
|
+
certificate.setSubject(attrs);
|
|
128
|
+
certificate.setIssuer(attrs);
|
|
129
|
+
certificate.sign(keys.privateKey);
|
|
130
|
+
|
|
131
|
+
// Convert to PEM
|
|
132
|
+
cert = pki.certificateToPem(certificate);
|
|
133
|
+
key = pki.privateKeyToPem(keys.privateKey);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// SMTP server options
|
|
137
|
+
const smtpOptions: ISmtpServerOptions = {
|
|
138
|
+
port: serverConfig.port,
|
|
139
|
+
hostname: serverConfig.hostname,
|
|
140
|
+
key: key,
|
|
141
|
+
cert: cert,
|
|
142
|
+
maxConnections: serverConfig.maxConnections,
|
|
143
|
+
size: serverConfig.size,
|
|
144
|
+
maxRecipients: serverConfig.maxRecipients,
|
|
145
|
+
socketTimeout: serverConfig.timeout,
|
|
146
|
+
connectionTimeout: serverConfig.timeout * 2,
|
|
147
|
+
cleanupInterval: 300000,
|
|
148
|
+
auth: serverConfig.authRequired ? ({
|
|
149
|
+
required: true,
|
|
150
|
+
methods: ['PLAIN', 'LOGIN'] as ('PLAIN' | 'LOGIN' | 'OAUTH2')[],
|
|
151
|
+
validateUser: async (username: string, password: string) => {
|
|
152
|
+
// Test server accepts these credentials
|
|
153
|
+
return username === 'testuser' && password === 'testpass';
|
|
154
|
+
}
|
|
155
|
+
} as any) : undefined
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
// Create SMTP server
|
|
159
|
+
const smtpServer = await createSmtpServer(mockEmailServer, smtpOptions);
|
|
160
|
+
|
|
161
|
+
// Start the server
|
|
162
|
+
await smtpServer.listen();
|
|
163
|
+
|
|
164
|
+
// Wait for server to be ready
|
|
165
|
+
await waitForServerReady(serverConfig.hostname, serverConfig.port);
|
|
166
|
+
|
|
167
|
+
console.log(`✅ Test SMTP server started on ${serverConfig.hostname}:${serverConfig.port}`);
|
|
168
|
+
|
|
169
|
+
return {
|
|
170
|
+
server: mockEmailServer,
|
|
171
|
+
smtpServer: smtpServer,
|
|
172
|
+
port: serverConfig.port,
|
|
173
|
+
hostname: serverConfig.hostname,
|
|
174
|
+
config: serverConfig,
|
|
175
|
+
startTime: Date.now()
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Stops a test SMTP server
|
|
181
|
+
*/
|
|
182
|
+
export async function stopTestServer(testServer: ITestServer): Promise<void> {
|
|
183
|
+
if (!testServer || !testServer.smtpServer) {
|
|
184
|
+
console.warn('⚠️ No test server to stop');
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
try {
|
|
189
|
+
console.log(`🛑 Stopping test SMTP server on ${testServer.hostname}:${testServer.port}`);
|
|
190
|
+
|
|
191
|
+
// Stop the SMTP server
|
|
192
|
+
if (testServer.smtpServer.close && typeof testServer.smtpServer.close === 'function') {
|
|
193
|
+
await testServer.smtpServer.close();
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
// Wait for port to be free
|
|
197
|
+
await waitForPortFree(testServer.port);
|
|
198
|
+
|
|
199
|
+
console.log(`✅ Test SMTP server stopped`);
|
|
200
|
+
} catch (error) {
|
|
201
|
+
console.error('❌ Error stopping test server:', error);
|
|
202
|
+
throw error;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Wait for server to be ready to accept connections
|
|
208
|
+
*/
|
|
209
|
+
async function waitForServerReady(hostname: string, port: number, timeout: number = 10000): Promise<void> {
|
|
210
|
+
const startTime = Date.now();
|
|
211
|
+
|
|
212
|
+
while (Date.now() - startTime < timeout) {
|
|
213
|
+
try {
|
|
214
|
+
await new Promise<void>((resolve, reject) => {
|
|
215
|
+
const socket = plugins.net.createConnection({ port, host: hostname });
|
|
216
|
+
|
|
217
|
+
socket.on('connect', () => {
|
|
218
|
+
socket.end();
|
|
219
|
+
resolve();
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
socket.on('error', reject);
|
|
223
|
+
|
|
224
|
+
setTimeout(() => {
|
|
225
|
+
socket.destroy();
|
|
226
|
+
reject(new Error('Connection timeout'));
|
|
227
|
+
}, 1000);
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
return; // Server is ready
|
|
231
|
+
} catch {
|
|
232
|
+
// Server not ready yet, wait and retry
|
|
233
|
+
await new Promise(resolve => setTimeout(resolve, 100));
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
throw new Error(`Server did not become ready within ${timeout}ms`);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Wait for port to be free
|
|
242
|
+
*/
|
|
243
|
+
async function waitForPortFree(port: number, timeout: number = 5000): Promise<void> {
|
|
244
|
+
const startTime = Date.now();
|
|
245
|
+
|
|
246
|
+
while (Date.now() - startTime < timeout) {
|
|
247
|
+
const isFree = await isPortFree(port);
|
|
248
|
+
if (isFree) {
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
await new Promise(resolve => setTimeout(resolve, 100));
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
console.warn(`⚠️ Port ${port} still in use after ${timeout}ms`);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Check if a port is free
|
|
259
|
+
*/
|
|
260
|
+
async function isPortFree(port: number): Promise<boolean> {
|
|
261
|
+
return new Promise((resolve) => {
|
|
262
|
+
const server = plugins.net.createServer();
|
|
263
|
+
|
|
264
|
+
server.listen(port, () => {
|
|
265
|
+
server.close(() => resolve(true));
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
server.on('error', () => resolve(false));
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Get an available port for testing
|
|
274
|
+
*/
|
|
275
|
+
export async function getAvailablePort(startPort: number = 25000): Promise<number> {
|
|
276
|
+
for (let port = startPort; port < startPort + 1000; port++) {
|
|
277
|
+
if (await isPortFree(port)) {
|
|
278
|
+
return port;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
throw new Error(`No available ports found starting from ${startPort}`);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* Create test email data
|
|
286
|
+
*/
|
|
287
|
+
export function createTestEmail(options: {
|
|
288
|
+
from?: string;
|
|
289
|
+
to?: string | string[];
|
|
290
|
+
subject?: string;
|
|
291
|
+
text?: string;
|
|
292
|
+
html?: string;
|
|
293
|
+
attachments?: any[];
|
|
294
|
+
} = {}): any {
|
|
295
|
+
return {
|
|
296
|
+
from: options.from || 'test@example.com',
|
|
297
|
+
to: options.to || 'recipient@example.com',
|
|
298
|
+
subject: options.subject || 'Test Email',
|
|
299
|
+
text: options.text || 'This is a test email',
|
|
300
|
+
html: options.html || '<p>This is a test email</p>',
|
|
301
|
+
attachments: options.attachments || [],
|
|
302
|
+
date: new Date(),
|
|
303
|
+
messageId: `<${Date.now()}@test.example.com>`
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* Simple test server for custom protocol testing
|
|
309
|
+
*/
|
|
310
|
+
export interface ISimpleTestServer {
|
|
311
|
+
server: any;
|
|
312
|
+
hostname: string;
|
|
313
|
+
port: number;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
export async function createTestServer(options: {
|
|
317
|
+
onConnection?: (socket: any) => void | Promise<void>;
|
|
318
|
+
port?: number;
|
|
319
|
+
hostname?: string;
|
|
320
|
+
}): Promise<ISimpleTestServer> {
|
|
321
|
+
const hostname = options.hostname || 'localhost';
|
|
322
|
+
const port = options.port || await getAvailablePort();
|
|
323
|
+
|
|
324
|
+
const server = plugins.net.createServer((socket) => {
|
|
325
|
+
if (options.onConnection) {
|
|
326
|
+
const result = options.onConnection(socket);
|
|
327
|
+
if (result && typeof result.then === 'function') {
|
|
328
|
+
result.catch(error => {
|
|
329
|
+
console.error('Error in onConnection handler:', error);
|
|
330
|
+
socket.destroy();
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
});
|
|
335
|
+
|
|
336
|
+
return new Promise((resolve, reject) => {
|
|
337
|
+
server.listen(port, hostname, () => {
|
|
338
|
+
resolve({
|
|
339
|
+
server,
|
|
340
|
+
hostname,
|
|
341
|
+
port
|
|
342
|
+
});
|
|
343
|
+
});
|
|
344
|
+
|
|
345
|
+
server.on('error', reject);
|
|
346
|
+
});
|
|
347
|
+
}
|