@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,65 @@
|
|
|
1
|
+
import { tap, expect } from '@git.zone/tstest/tapbundle';
|
|
2
|
+
import * as plugins from '../ts/plugins.js';
|
|
3
|
+
import * as paths from '../ts/paths.js';
|
|
4
|
+
import { SenderReputationMonitor } from '../ts/deliverability/classes.senderreputationmonitor.js';
|
|
5
|
+
import { IPWarmupManager } from '../ts/deliverability/classes.ipwarmupmanager.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Basic test to check if our integrated classes work correctly
|
|
9
|
+
*/
|
|
10
|
+
tap.test('verify that SenderReputationMonitor and IPWarmupManager are functioning', async () => {
|
|
11
|
+
// Create instances of both classes
|
|
12
|
+
const reputationMonitor = SenderReputationMonitor.getInstance({
|
|
13
|
+
enabled: true,
|
|
14
|
+
domains: ['example.com']
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const ipWarmupManager = IPWarmupManager.getInstance({
|
|
18
|
+
enabled: true,
|
|
19
|
+
ipAddresses: ['192.168.1.1', '192.168.1.2'],
|
|
20
|
+
targetDomains: ['example.com']
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
// Test SenderReputationMonitor
|
|
24
|
+
reputationMonitor.recordSendEvent('example.com', { type: 'sent', count: 100 });
|
|
25
|
+
reputationMonitor.recordSendEvent('example.com', { type: 'delivered', count: 95 });
|
|
26
|
+
|
|
27
|
+
const reputationData = reputationMonitor.getReputationData('example.com');
|
|
28
|
+
expect(reputationData).toBeTruthy();
|
|
29
|
+
|
|
30
|
+
const summary = reputationMonitor.getReputationSummary();
|
|
31
|
+
expect(summary.length).toBeGreaterThan(0);
|
|
32
|
+
|
|
33
|
+
// Add and remove domains
|
|
34
|
+
reputationMonitor.addDomain('test.com');
|
|
35
|
+
reputationMonitor.removeDomain('test.com');
|
|
36
|
+
|
|
37
|
+
// Test IPWarmupManager
|
|
38
|
+
ipWarmupManager.setActiveAllocationPolicy('balanced');
|
|
39
|
+
|
|
40
|
+
const bestIP = ipWarmupManager.getBestIPForSending({
|
|
41
|
+
from: 'test@example.com',
|
|
42
|
+
to: ['recipient@test.com'],
|
|
43
|
+
domain: 'example.com'
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
if (bestIP) {
|
|
47
|
+
ipWarmupManager.recordSend(bestIP);
|
|
48
|
+
const canSendMore = ipWarmupManager.canSendMoreToday(bestIP);
|
|
49
|
+
expect(typeof canSendMore).toEqual('boolean');
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const stageCount = ipWarmupManager.getStageCount();
|
|
53
|
+
expect(stageCount).toBeGreaterThan(0);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
// Final clean-up test
|
|
57
|
+
tap.test('clean up after tests', async () => {
|
|
58
|
+
// No-op - just to make sure everything is cleaned up properly
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
tap.test('stop', async () => {
|
|
62
|
+
await tap.stopForcefully();
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
export default tap.start();
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { tap, expect } from '@git.zone/tstest/tapbundle';
|
|
2
|
+
import { BounceManager, BounceType, BounceCategory } from '../ts/mail/core/classes.bouncemanager.js';
|
|
3
|
+
import { Email } from '../ts/mail/core/classes.email.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Test the BounceManager class
|
|
7
|
+
*/
|
|
8
|
+
tap.test('BounceManager - should be instantiable', async () => {
|
|
9
|
+
const bounceManager = new BounceManager();
|
|
10
|
+
expect(bounceManager).toBeTruthy();
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
tap.test('BounceManager - should process basic bounce categories', async () => {
|
|
14
|
+
const bounceManager = new BounceManager();
|
|
15
|
+
|
|
16
|
+
// Test hard bounce detection
|
|
17
|
+
const hardBounce = await bounceManager.processBounce({
|
|
18
|
+
recipient: 'invalid@example.com',
|
|
19
|
+
sender: 'sender@example.com',
|
|
20
|
+
smtpResponse: 'user unknown',
|
|
21
|
+
domain: 'example.com'
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
expect(hardBounce.bounceCategory).toEqual(BounceCategory.HARD);
|
|
25
|
+
|
|
26
|
+
// Test soft bounce detection
|
|
27
|
+
const softBounce = await bounceManager.processBounce({
|
|
28
|
+
recipient: 'valid@example.com',
|
|
29
|
+
sender: 'sender@example.com',
|
|
30
|
+
smtpResponse: 'server unavailable',
|
|
31
|
+
domain: 'example.com'
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
expect(softBounce.bounceCategory).toEqual(BounceCategory.SOFT);
|
|
35
|
+
|
|
36
|
+
// Test auto-response detection
|
|
37
|
+
const autoResponse = await bounceManager.processBounce({
|
|
38
|
+
recipient: 'away@example.com',
|
|
39
|
+
sender: 'sender@example.com',
|
|
40
|
+
smtpResponse: 'auto-reply: out of office',
|
|
41
|
+
domain: 'example.com'
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
expect(autoResponse.bounceCategory).toEqual(BounceCategory.AUTO_RESPONSE);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
tap.test('BounceManager - should add and check suppression list entries', async () => {
|
|
48
|
+
const bounceManager = new BounceManager();
|
|
49
|
+
|
|
50
|
+
// Add to suppression list permanently
|
|
51
|
+
bounceManager.addToSuppressionList('permanent@example.com', 'Test hard bounce', undefined);
|
|
52
|
+
|
|
53
|
+
// Add to suppression list temporarily (5 seconds)
|
|
54
|
+
const expireTime = Date.now() + 5000;
|
|
55
|
+
bounceManager.addToSuppressionList('temporary@example.com', 'Test soft bounce', expireTime);
|
|
56
|
+
|
|
57
|
+
// Check suppression status
|
|
58
|
+
expect(bounceManager.isEmailSuppressed('permanent@example.com')).toEqual(true);
|
|
59
|
+
expect(bounceManager.isEmailSuppressed('temporary@example.com')).toEqual(true);
|
|
60
|
+
expect(bounceManager.isEmailSuppressed('notsuppressed@example.com')).toEqual(false);
|
|
61
|
+
|
|
62
|
+
// Get suppression info
|
|
63
|
+
const info = bounceManager.getSuppressionInfo('permanent@example.com');
|
|
64
|
+
expect(info).toBeTruthy();
|
|
65
|
+
expect(info.reason).toEqual('Test hard bounce');
|
|
66
|
+
expect(info.expiresAt).toBeUndefined();
|
|
67
|
+
|
|
68
|
+
// Verify temporary suppression info
|
|
69
|
+
const tempInfo = bounceManager.getSuppressionInfo('temporary@example.com');
|
|
70
|
+
expect(tempInfo).toBeTruthy();
|
|
71
|
+
expect(tempInfo.reason).toEqual('Test soft bounce');
|
|
72
|
+
expect(tempInfo.expiresAt).toEqual(expireTime);
|
|
73
|
+
|
|
74
|
+
// Wait for expiration (6 seconds)
|
|
75
|
+
await new Promise(resolve => setTimeout(resolve, 6000));
|
|
76
|
+
|
|
77
|
+
// Verify permanent suppression is still active
|
|
78
|
+
expect(bounceManager.isEmailSuppressed('permanent@example.com')).toEqual(true);
|
|
79
|
+
|
|
80
|
+
// Verify temporary suppression has expired
|
|
81
|
+
expect(bounceManager.isEmailSuppressed('temporary@example.com')).toEqual(false);
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
tap.test('BounceManager - should process SMTP failures correctly', async () => {
|
|
85
|
+
const bounceManager = new BounceManager();
|
|
86
|
+
|
|
87
|
+
const result = await bounceManager.processSmtpFailure(
|
|
88
|
+
'recipient@example.com',
|
|
89
|
+
'550 5.1.1 User unknown',
|
|
90
|
+
{
|
|
91
|
+
sender: 'sender@example.com',
|
|
92
|
+
statusCode: '550'
|
|
93
|
+
}
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
expect(result.bounceType).toEqual(BounceType.INVALID_RECIPIENT);
|
|
97
|
+
expect(result.bounceCategory).toEqual(BounceCategory.HARD);
|
|
98
|
+
|
|
99
|
+
// Check that the email was added to the suppression list
|
|
100
|
+
expect(bounceManager.isEmailSuppressed('recipient@example.com')).toEqual(true);
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
tap.test('BounceManager - should process bounce emails correctly', async () => {
|
|
104
|
+
const bounceManager = new BounceManager();
|
|
105
|
+
|
|
106
|
+
// Create a mock bounce email
|
|
107
|
+
const bounceEmail = new Email({
|
|
108
|
+
from: 'mailer-daemon@example.com',
|
|
109
|
+
subject: 'Mail delivery failed: returning message to sender',
|
|
110
|
+
text: `
|
|
111
|
+
This message was created automatically by mail delivery software.
|
|
112
|
+
|
|
113
|
+
A message that you sent could not be delivered to one or more of its recipients.
|
|
114
|
+
The following address(es) failed:
|
|
115
|
+
|
|
116
|
+
recipient@example.com
|
|
117
|
+
mailbox is full
|
|
118
|
+
|
|
119
|
+
------ This is a copy of the message, including all the headers. ------
|
|
120
|
+
|
|
121
|
+
Original-Recipient: rfc822;recipient@example.com
|
|
122
|
+
Final-Recipient: rfc822;recipient@example.com
|
|
123
|
+
Status: 5.2.2
|
|
124
|
+
diagnostic-code: smtp; 552 5.2.2 Mailbox full
|
|
125
|
+
`,
|
|
126
|
+
to: 'sender@example.com' // Bounce emails are typically sent back to the original sender
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
const result = await bounceManager.processBounceEmail(bounceEmail);
|
|
130
|
+
|
|
131
|
+
expect(result).toBeTruthy();
|
|
132
|
+
expect(result.bounceType).toEqual(BounceType.MAILBOX_FULL);
|
|
133
|
+
expect(result.bounceCategory).toEqual(BounceCategory.HARD);
|
|
134
|
+
expect(result.recipient).toEqual('recipient@example.com');
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
tap.test('BounceManager - should handle retries for soft bounces', async () => {
|
|
138
|
+
const bounceManager = new BounceManager({
|
|
139
|
+
retryStrategy: {
|
|
140
|
+
maxRetries: 2,
|
|
141
|
+
initialDelay: 100, // 100ms for test
|
|
142
|
+
maxDelay: 1000,
|
|
143
|
+
backoffFactor: 2
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
// First attempt
|
|
148
|
+
const result1 = await bounceManager.processBounce({
|
|
149
|
+
recipient: 'retry@example.com',
|
|
150
|
+
sender: 'sender@example.com',
|
|
151
|
+
bounceType: BounceType.SERVER_UNAVAILABLE,
|
|
152
|
+
bounceCategory: BounceCategory.SOFT,
|
|
153
|
+
domain: 'example.com'
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
// Email should be suppressed temporarily
|
|
157
|
+
expect(bounceManager.isEmailSuppressed('retry@example.com')).toEqual(true);
|
|
158
|
+
expect(result1.retryCount).toEqual(1);
|
|
159
|
+
expect(result1.nextRetryTime).toBeGreaterThan(Date.now());
|
|
160
|
+
|
|
161
|
+
// Second attempt
|
|
162
|
+
const result2 = await bounceManager.processBounce({
|
|
163
|
+
recipient: 'retry@example.com',
|
|
164
|
+
sender: 'sender@example.com',
|
|
165
|
+
bounceType: BounceType.SERVER_UNAVAILABLE,
|
|
166
|
+
bounceCategory: BounceCategory.SOFT,
|
|
167
|
+
domain: 'example.com',
|
|
168
|
+
retryCount: 1
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
expect(result2.retryCount).toEqual(2);
|
|
172
|
+
|
|
173
|
+
// Third attempt (should convert to hard bounce)
|
|
174
|
+
const result3 = await bounceManager.processBounce({
|
|
175
|
+
recipient: 'retry@example.com',
|
|
176
|
+
sender: 'sender@example.com',
|
|
177
|
+
bounceType: BounceType.SERVER_UNAVAILABLE,
|
|
178
|
+
bounceCategory: BounceCategory.SOFT,
|
|
179
|
+
domain: 'example.com',
|
|
180
|
+
retryCount: 2
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
// Should now be a hard bounce after max retries
|
|
184
|
+
expect(result3.bounceCategory).toEqual(BounceCategory.HARD);
|
|
185
|
+
|
|
186
|
+
// Email should be suppressed permanently
|
|
187
|
+
expect(bounceManager.isEmailSuppressed('retry@example.com')).toEqual(true);
|
|
188
|
+
const info = bounceManager.getSuppressionInfo('retry@example.com');
|
|
189
|
+
expect(info.expiresAt).toBeUndefined(); // Permanent
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
tap.test('stop', async () => {
|
|
193
|
+
await tap.stopForcefully();
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
export default tap.start();
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
# DCRouter Test Configuration
|
|
2
|
+
|
|
3
|
+
## Running Tests
|
|
4
|
+
|
|
5
|
+
### Run All Tests
|
|
6
|
+
```bash
|
|
7
|
+
cd dcrouter
|
|
8
|
+
pnpm test
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Run Specific Category
|
|
12
|
+
```bash
|
|
13
|
+
# Run all connection tests
|
|
14
|
+
tsx test/run-category.ts connection
|
|
15
|
+
|
|
16
|
+
# Run all security tests
|
|
17
|
+
tsx test/run-category.ts security
|
|
18
|
+
|
|
19
|
+
# Run all performance tests
|
|
20
|
+
tsx test/run-category.ts performance
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Run Individual Test File
|
|
24
|
+
```bash
|
|
25
|
+
# Run TLS connection test
|
|
26
|
+
tsx test/suite/connection/test.tls-connection.ts
|
|
27
|
+
|
|
28
|
+
# Run authentication test
|
|
29
|
+
tsx test/suite/security/test.authentication.ts
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Run Tests with Verbose Output
|
|
33
|
+
```bash
|
|
34
|
+
# All tests with verbose logging
|
|
35
|
+
pnpm test -- --verbose
|
|
36
|
+
|
|
37
|
+
# Individual test with verbose
|
|
38
|
+
tsx test/suite/connection/test.tls-connection.ts --verbose
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Test Server Configuration
|
|
42
|
+
|
|
43
|
+
Each test file starts its own SMTP server with specific configuration. Common configurations:
|
|
44
|
+
|
|
45
|
+
### Basic Server
|
|
46
|
+
```typescript
|
|
47
|
+
const testServer = await startTestServer({
|
|
48
|
+
port: 2525,
|
|
49
|
+
hostname: 'localhost'
|
|
50
|
+
});
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### TLS-Enabled Server
|
|
54
|
+
```typescript
|
|
55
|
+
const testServer = await startTestServer({
|
|
56
|
+
port: 2525,
|
|
57
|
+
hostname: 'localhost',
|
|
58
|
+
tlsEnabled: true
|
|
59
|
+
});
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Authenticated Server
|
|
63
|
+
```typescript
|
|
64
|
+
const testServer = await startTestServer({
|
|
65
|
+
port: 2525,
|
|
66
|
+
hostname: 'localhost',
|
|
67
|
+
authRequired: true
|
|
68
|
+
});
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### High-Performance Server
|
|
72
|
+
```typescript
|
|
73
|
+
const testServer = await startTestServer({
|
|
74
|
+
port: 2525,
|
|
75
|
+
hostname: 'localhost',
|
|
76
|
+
maxConnections: 1000,
|
|
77
|
+
size: 50 * 1024 * 1024 // 50MB
|
|
78
|
+
});
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Port Allocation
|
|
82
|
+
|
|
83
|
+
Tests use different ports to avoid conflicts:
|
|
84
|
+
- Connection tests: 2525-2530
|
|
85
|
+
- Command tests: 2531-2540
|
|
86
|
+
- Email processing: 2541-2550
|
|
87
|
+
- Security tests: 2551-2560
|
|
88
|
+
- Performance tests: 2561-2570
|
|
89
|
+
- Edge cases: 2571-2580
|
|
90
|
+
- RFC compliance: 2581-2590
|
|
91
|
+
|
|
92
|
+
## Test Utilities
|
|
93
|
+
|
|
94
|
+
### Server Lifecycle
|
|
95
|
+
All tests follow this pattern:
|
|
96
|
+
```typescript
|
|
97
|
+
import { tap, expect } from '@git.zone/tstest/tapbundle';
|
|
98
|
+
import { startTestServer, stopTestServer } from '../../helpers/server.loader.js';
|
|
99
|
+
|
|
100
|
+
let testServer;
|
|
101
|
+
|
|
102
|
+
tap.test('setup', async () => {
|
|
103
|
+
testServer = await startTestServer({ port: 2525 });
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
// Your tests here...
|
|
107
|
+
|
|
108
|
+
tap.test('cleanup', async () => {
|
|
109
|
+
await stopTestServer(testServer);
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
tap.start();
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### SMTP Client Testing
|
|
116
|
+
```typescript
|
|
117
|
+
import { createTestSmtpClient } from '../../helpers/smtp.client.js';
|
|
118
|
+
|
|
119
|
+
const client = createTestSmtpClient({
|
|
120
|
+
host: 'localhost',
|
|
121
|
+
port: 2525
|
|
122
|
+
});
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Low-Level SMTP Testing
|
|
126
|
+
```typescript
|
|
127
|
+
import { connectToSmtp, sendSmtpCommand } from '../../helpers/test.utils.js';
|
|
128
|
+
|
|
129
|
+
const socket = await connectToSmtp('localhost', 2525);
|
|
130
|
+
const response = await sendSmtpCommand(socket, 'EHLO test.example.com', '250');
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Performance Benchmarks
|
|
134
|
+
|
|
135
|
+
Expected minimums for production:
|
|
136
|
+
- Throughput: >10 emails/second
|
|
137
|
+
- Concurrent connections: >100
|
|
138
|
+
- Memory increase: <2% under load
|
|
139
|
+
- Connection time: <5000ms
|
|
140
|
+
- Error rate: <5%
|
|
141
|
+
|
|
142
|
+
## Debugging Failed Tests
|
|
143
|
+
|
|
144
|
+
### Enable Verbose Logging
|
|
145
|
+
```bash
|
|
146
|
+
DEBUG=* tsx test/suite/connection/test.tls-connection.ts
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Check Server Logs
|
|
150
|
+
Tests output server logs to console. Look for:
|
|
151
|
+
- 🚀 Server start messages
|
|
152
|
+
- 📧 Email processing logs
|
|
153
|
+
- ❌ Error messages
|
|
154
|
+
- ✅ Success confirmations
|
|
155
|
+
|
|
156
|
+
### Common Issues
|
|
157
|
+
|
|
158
|
+
1. **Port Already in Use**
|
|
159
|
+
- Tests use unique ports
|
|
160
|
+
- Check for orphaned processes: `lsof -i :2525`
|
|
161
|
+
- Kill process: `kill -9 <PID>`
|
|
162
|
+
|
|
163
|
+
2. **TLS Certificate Errors**
|
|
164
|
+
- Tests use self-signed certificates
|
|
165
|
+
- Production should use real certificates
|
|
166
|
+
|
|
167
|
+
3. **Timeout Errors**
|
|
168
|
+
- Increase timeout in test configuration
|
|
169
|
+
- Check network connectivity
|
|
170
|
+
- Verify server started successfully
|
|
171
|
+
|
|
172
|
+
4. **Authentication Failures**
|
|
173
|
+
- Test servers may not validate credentials
|
|
174
|
+
- Check authRequired configuration
|
|
175
|
+
- Verify AUTH mechanisms supported
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
import { tap, expect } from '@git.zone/tstest/tapbundle';
|
|
2
|
+
import { ContentScanner, ThreatCategory } from '../ts/security/classes.contentscanner.js';
|
|
3
|
+
import { Email } from '../ts/mail/core/classes.email.js';
|
|
4
|
+
|
|
5
|
+
// Test instantiation
|
|
6
|
+
tap.test('ContentScanner - should be instantiable', async () => {
|
|
7
|
+
const scanner = ContentScanner.getInstance({
|
|
8
|
+
scanBody: true,
|
|
9
|
+
scanSubject: true,
|
|
10
|
+
scanAttachments: true
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
expect(scanner).toBeTruthy();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
// Test singleton pattern
|
|
17
|
+
tap.test('ContentScanner - should use singleton pattern', async () => {
|
|
18
|
+
const scanner1 = ContentScanner.getInstance();
|
|
19
|
+
const scanner2 = ContentScanner.getInstance();
|
|
20
|
+
|
|
21
|
+
// Both instances should be the same object
|
|
22
|
+
expect(scanner1 === scanner2).toEqual(true);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
// Test clean email can be correctly distinguished from high-risk email
|
|
26
|
+
tap.test('ContentScanner - should distinguish between clean and suspicious emails', async () => {
|
|
27
|
+
// Create an instance with a higher minimum threat score
|
|
28
|
+
const scanner = new ContentScanner({
|
|
29
|
+
minThreatScore: 50 // Higher threshold to consider clean
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
// Create a truly clean email with no potentially sensitive data patterns
|
|
33
|
+
const cleanEmail = new Email({
|
|
34
|
+
from: 'sender@example.com',
|
|
35
|
+
to: 'recipient@example.com',
|
|
36
|
+
subject: 'Project Update',
|
|
37
|
+
text: 'The project is on track. Let me know if you have questions.',
|
|
38
|
+
html: '<p>The project is on track. Let me know if you have questions.</p>'
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
// Create a highly suspicious email
|
|
42
|
+
const suspiciousEmail = new Email({
|
|
43
|
+
from: 'admin@bank-fake.com',
|
|
44
|
+
to: 'victim@example.com',
|
|
45
|
+
subject: 'URGENT: Your account needs verification now!',
|
|
46
|
+
text: 'Click here to verify your account or it will be suspended: https://bit.ly/12345',
|
|
47
|
+
html: '<p>Click here to verify your account or it will be suspended: <a href="https://bit.ly/12345">click here</a></p>'
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
// Test both emails
|
|
51
|
+
const cleanResult = await scanner.scanEmail(cleanEmail);
|
|
52
|
+
const suspiciousResult = await scanner.scanEmail(suspiciousEmail);
|
|
53
|
+
|
|
54
|
+
console.log('Clean vs Suspicious results:', {
|
|
55
|
+
cleanScore: cleanResult.threatScore,
|
|
56
|
+
suspiciousScore: suspiciousResult.threatScore
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
// Verify the scanner can distinguish between them
|
|
60
|
+
// Suspicious email should have a significantly higher score
|
|
61
|
+
expect(suspiciousResult.threatScore > cleanResult.threatScore + 40).toEqual(true);
|
|
62
|
+
|
|
63
|
+
// Verify clean email scans all expected elements
|
|
64
|
+
expect(cleanResult.scannedElements.length > 0).toEqual(true);
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
// Test phishing detection in subject
|
|
68
|
+
tap.test('ContentScanner - should detect phishing in subject', async () => {
|
|
69
|
+
// Create a dedicated scanner for this test
|
|
70
|
+
const scanner = new ContentScanner({
|
|
71
|
+
scanSubject: true,
|
|
72
|
+
scanBody: true,
|
|
73
|
+
scanAttachments: false,
|
|
74
|
+
customRules: []
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
const email = new Email({
|
|
78
|
+
from: 'security@bank-account-verify.com',
|
|
79
|
+
to: 'victim@example.com',
|
|
80
|
+
subject: 'URGENT: Verify your bank account details immediately',
|
|
81
|
+
text: 'Your account will be suspended. Please verify your details.',
|
|
82
|
+
html: '<p>Your account will be suspended. Please verify your details.</p>'
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
const result = await scanner.scanEmail(email);
|
|
86
|
+
|
|
87
|
+
console.log('Phishing email scan result:', result);
|
|
88
|
+
|
|
89
|
+
// We only care that it detected something suspicious
|
|
90
|
+
expect(result.threatScore >= 20).toEqual(true);
|
|
91
|
+
|
|
92
|
+
// Check if any threat was detected (specific type may vary)
|
|
93
|
+
expect(result.threatType).toBeTruthy();
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
// Test malware indicators in body
|
|
97
|
+
tap.test('ContentScanner - should detect malware indicators in body', async () => {
|
|
98
|
+
const scanner = ContentScanner.getInstance();
|
|
99
|
+
|
|
100
|
+
const email = new Email({
|
|
101
|
+
from: 'invoice@company.com',
|
|
102
|
+
to: 'recipient@example.com',
|
|
103
|
+
subject: 'Your invoice',
|
|
104
|
+
text: 'Please see the attached invoice. You need to enable macros to view this document properly.',
|
|
105
|
+
html: '<p>Please see the attached invoice. You need to enable macros to view this document properly.</p>'
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
const result = await scanner.scanEmail(email);
|
|
109
|
+
|
|
110
|
+
expect(result.isClean).toEqual(false);
|
|
111
|
+
expect(result.threatType === ThreatCategory.MALWARE || result.threatType).toBeTruthy();
|
|
112
|
+
expect(result.threatScore >= 30).toEqual(true);
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
// Test suspicious link detection
|
|
116
|
+
tap.test('ContentScanner - should detect suspicious links', async () => {
|
|
117
|
+
const scanner = ContentScanner.getInstance();
|
|
118
|
+
|
|
119
|
+
const email = new Email({
|
|
120
|
+
from: 'newsletter@example.com',
|
|
121
|
+
to: 'recipient@example.com',
|
|
122
|
+
subject: 'Weekly Newsletter',
|
|
123
|
+
text: 'Check our latest offer at https://bit.ly/2x3F5 and https://t.co/abc123',
|
|
124
|
+
html: '<p>Check our latest offer at <a href="https://bit.ly/2x3F5">here</a> and <a href="https://t.co/abc123">here</a></p>'
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
const result = await scanner.scanEmail(email);
|
|
128
|
+
|
|
129
|
+
expect(result.isClean).toEqual(false);
|
|
130
|
+
expect(result.threatType).toEqual(ThreatCategory.SUSPICIOUS_LINK);
|
|
131
|
+
expect(result.threatScore >= 30).toEqual(true);
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
// Test script injection detection
|
|
135
|
+
tap.test('ContentScanner - should detect script injection', async () => {
|
|
136
|
+
const scanner = ContentScanner.getInstance();
|
|
137
|
+
|
|
138
|
+
const email = new Email({
|
|
139
|
+
from: 'newsletter@example.com',
|
|
140
|
+
to: 'recipient@example.com',
|
|
141
|
+
subject: 'Newsletter',
|
|
142
|
+
text: 'Check our website',
|
|
143
|
+
html: '<p>Check our website</p><script>document.cookie="session="+localStorage.getItem("token");</script>'
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
const result = await scanner.scanEmail(email);
|
|
147
|
+
|
|
148
|
+
expect(result.isClean).toEqual(false);
|
|
149
|
+
expect(result.threatType).toEqual(ThreatCategory.XSS);
|
|
150
|
+
expect(result.threatScore >= 40).toEqual(true);
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
// Test executable attachment detection
|
|
154
|
+
tap.test('ContentScanner - should detect executable attachments', async () => {
|
|
155
|
+
const scanner = ContentScanner.getInstance();
|
|
156
|
+
|
|
157
|
+
const email = new Email({
|
|
158
|
+
from: 'sender@example.com',
|
|
159
|
+
to: 'recipient@example.com',
|
|
160
|
+
subject: 'Software Update',
|
|
161
|
+
text: 'Please install the attached software update.',
|
|
162
|
+
attachments: [{
|
|
163
|
+
filename: 'update.exe',
|
|
164
|
+
content: Buffer.from('MZ...fake executable content...'),
|
|
165
|
+
contentType: 'application/octet-stream'
|
|
166
|
+
}]
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
const result = await scanner.scanEmail(email);
|
|
170
|
+
|
|
171
|
+
expect(result.isClean).toEqual(false);
|
|
172
|
+
expect(result.threatType).toEqual(ThreatCategory.EXECUTABLE);
|
|
173
|
+
expect(result.threatScore >= 70).toEqual(true);
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
// Test macro document detection
|
|
177
|
+
tap.test('ContentScanner - should detect macro documents', async () => {
|
|
178
|
+
// Create a mock Office document with macro indicators
|
|
179
|
+
const fakeDocContent = Buffer.from('Document content...vbaProject.bin...Auto_Open...DocumentOpen...Microsoft VBA...');
|
|
180
|
+
|
|
181
|
+
const scanner = ContentScanner.getInstance();
|
|
182
|
+
|
|
183
|
+
const email = new Email({
|
|
184
|
+
from: 'sender@example.com',
|
|
185
|
+
to: 'recipient@example.com',
|
|
186
|
+
subject: 'Financial Report',
|
|
187
|
+
text: 'Please review the attached financial report.',
|
|
188
|
+
attachments: [{
|
|
189
|
+
filename: 'report.docm',
|
|
190
|
+
content: fakeDocContent,
|
|
191
|
+
contentType: 'application/vnd.ms-word.document.macroEnabled.12'
|
|
192
|
+
}]
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
const result = await scanner.scanEmail(email);
|
|
196
|
+
|
|
197
|
+
expect(result.isClean).toEqual(false);
|
|
198
|
+
expect(result.threatType).toEqual(ThreatCategory.MALICIOUS_MACRO);
|
|
199
|
+
expect(result.threatScore >= 60).toEqual(true);
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
// Test compound threat detection (multiple indicators)
|
|
203
|
+
tap.test('ContentScanner - should detect compound threats', async () => {
|
|
204
|
+
const scanner = ContentScanner.getInstance();
|
|
205
|
+
|
|
206
|
+
const email = new Email({
|
|
207
|
+
from: 'security@bank-verify.com',
|
|
208
|
+
to: 'victim@example.com',
|
|
209
|
+
subject: 'URGENT: Verify your account details immediately',
|
|
210
|
+
text: 'Your account will be suspended unless you verify your details at https://bit.ly/2x3F5',
|
|
211
|
+
html: '<p>Your account will be suspended unless you verify your details <a href="https://bit.ly/2x3F5">here</a>.</p>',
|
|
212
|
+
attachments: [{
|
|
213
|
+
filename: 'verification.exe',
|
|
214
|
+
content: Buffer.from('MZ...fake executable content...'),
|
|
215
|
+
contentType: 'application/octet-stream'
|
|
216
|
+
}]
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
const result = await scanner.scanEmail(email);
|
|
220
|
+
|
|
221
|
+
expect(result.isClean).toEqual(false);
|
|
222
|
+
expect(result.threatScore > 70).toEqual(true); // Should have a high score due to multiple threats
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
// Test custom rules
|
|
226
|
+
tap.test('ContentScanner - should apply custom rules', async () => {
|
|
227
|
+
// Create a scanner with custom rules
|
|
228
|
+
const scanner = new ContentScanner({
|
|
229
|
+
customRules: [
|
|
230
|
+
{
|
|
231
|
+
pattern: /CUSTOM_PATTERN_FOR_TESTING/,
|
|
232
|
+
type: ThreatCategory.CUSTOM_RULE,
|
|
233
|
+
score: 50,
|
|
234
|
+
description: 'Custom pattern detected'
|
|
235
|
+
}
|
|
236
|
+
]
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
const email = new Email({
|
|
240
|
+
from: 'sender@example.com',
|
|
241
|
+
to: 'recipient@example.com',
|
|
242
|
+
subject: 'Test Custom Rule',
|
|
243
|
+
text: 'This message contains CUSTOM_PATTERN_FOR_TESTING that should be detected.'
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
const result = await scanner.scanEmail(email);
|
|
247
|
+
|
|
248
|
+
expect(result.isClean).toEqual(false);
|
|
249
|
+
expect(result.threatType).toEqual(ThreatCategory.CUSTOM_RULE);
|
|
250
|
+
expect(result.threatScore >= 50).toEqual(true);
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
// Test threat level classification
|
|
254
|
+
tap.test('ContentScanner - should classify threat levels correctly', async () => {
|
|
255
|
+
expect(ContentScanner.getThreatLevel(10)).toEqual('none');
|
|
256
|
+
expect(ContentScanner.getThreatLevel(25)).toEqual('low');
|
|
257
|
+
expect(ContentScanner.getThreatLevel(50)).toEqual('medium');
|
|
258
|
+
expect(ContentScanner.getThreatLevel(80)).toEqual('high');
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
tap.test('stop', async () => {
|
|
262
|
+
await tap.stopForcefully();
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
export default tap.start();
|