@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,411 @@
|
|
|
1
|
+
import { tap, expect } from '@git.zone/tstest/tapbundle';
|
|
2
|
+
import { startTestServer, stopTestServer, type ITestServer } from '../../helpers/server.loader.js';
|
|
3
|
+
import { createSmtpClient } from '../../../ts/mail/delivery/smtpclient/index.js';
|
|
4
|
+
import { Email } from '../../../ts/mail/core/classes.email.js';
|
|
5
|
+
|
|
6
|
+
let testServer: ITestServer;
|
|
7
|
+
|
|
8
|
+
tap.test('setup test SMTP server', async () => {
|
|
9
|
+
testServer = await startTestServer({
|
|
10
|
+
port: 2570,
|
|
11
|
+
tlsEnabled: false,
|
|
12
|
+
authRequired: false
|
|
13
|
+
});
|
|
14
|
+
expect(testServer).toBeTruthy();
|
|
15
|
+
expect(testServer.port).toEqual(2570);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
tap.test('CEP-10: Read receipt headers', async () => {
|
|
19
|
+
const smtpClient = await createSmtpClient({
|
|
20
|
+
host: testServer.hostname,
|
|
21
|
+
port: testServer.port,
|
|
22
|
+
secure: false,
|
|
23
|
+
connectionTimeout: 5000
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
// Create email requesting read receipt
|
|
27
|
+
const email = new Email({
|
|
28
|
+
from: 'sender@example.com',
|
|
29
|
+
to: 'recipient@example.com',
|
|
30
|
+
subject: 'Important: Please confirm receipt',
|
|
31
|
+
text: 'Please confirm you have read this message',
|
|
32
|
+
headers: {
|
|
33
|
+
'Disposition-Notification-To': 'sender@example.com',
|
|
34
|
+
'Return-Receipt-To': 'sender@example.com',
|
|
35
|
+
'X-Confirm-Reading-To': 'sender@example.com',
|
|
36
|
+
'X-MS-Receipt-Request': 'sender@example.com'
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const result = await smtpClient.sendMail(email);
|
|
41
|
+
expect(result.success).toBeTruthy();
|
|
42
|
+
console.log('Read receipt headers test sent successfully');
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
tap.test('CEP-10: DSN (Delivery Status Notification) requests', async () => {
|
|
46
|
+
const smtpClient = await createSmtpClient({
|
|
47
|
+
host: testServer.hostname,
|
|
48
|
+
port: testServer.port,
|
|
49
|
+
secure: false,
|
|
50
|
+
connectionTimeout: 5000
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
// Create email with DSN options
|
|
54
|
+
const email = new Email({
|
|
55
|
+
from: 'sender@example.com',
|
|
56
|
+
to: 'recipient@example.com',
|
|
57
|
+
subject: 'DSN Test Email',
|
|
58
|
+
text: 'Testing delivery status notifications',
|
|
59
|
+
headers: {
|
|
60
|
+
'X-DSN-Options': 'notify=SUCCESS,FAILURE,DELAY;return=HEADERS',
|
|
61
|
+
'X-Envelope-ID': `msg-${Date.now()}`
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
const result = await smtpClient.sendMail(email);
|
|
66
|
+
expect(result.success).toBeTruthy();
|
|
67
|
+
console.log('DSN requests test sent successfully');
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
tap.test('CEP-10: DSN notify options', async () => {
|
|
71
|
+
const smtpClient = await createSmtpClient({
|
|
72
|
+
host: testServer.hostname,
|
|
73
|
+
port: testServer.port,
|
|
74
|
+
secure: false,
|
|
75
|
+
connectionTimeout: 5000
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
// Test different DSN notify combinations
|
|
79
|
+
const notifyOptions = [
|
|
80
|
+
{ notify: ['SUCCESS'], description: 'Notify on successful delivery only' },
|
|
81
|
+
{ notify: ['FAILURE'], description: 'Notify on failure only' },
|
|
82
|
+
{ notify: ['DELAY'], description: 'Notify on delays only' },
|
|
83
|
+
{ notify: ['SUCCESS', 'FAILURE'], description: 'Notify on success and failure' },
|
|
84
|
+
{ notify: ['NEVER'], description: 'Never send notifications' }
|
|
85
|
+
];
|
|
86
|
+
|
|
87
|
+
for (const option of notifyOptions) {
|
|
88
|
+
console.log(`Testing DSN: ${option.description}`);
|
|
89
|
+
|
|
90
|
+
const email = new Email({
|
|
91
|
+
from: 'sender@example.com',
|
|
92
|
+
to: 'recipient@example.com',
|
|
93
|
+
subject: `DSN Test: ${option.description}`,
|
|
94
|
+
text: 'Testing DSN notify options',
|
|
95
|
+
headers: {
|
|
96
|
+
'X-DSN-Notify': option.notify.join(','),
|
|
97
|
+
'X-DSN-Return': 'HEADERS'
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
const result = await smtpClient.sendMail(email);
|
|
102
|
+
expect(result.success).toBeTruthy();
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
console.log('DSN notify options test completed successfully');
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
tap.test('CEP-10: DSN return types', async () => {
|
|
109
|
+
const smtpClient = await createSmtpClient({
|
|
110
|
+
host: testServer.hostname,
|
|
111
|
+
port: testServer.port,
|
|
112
|
+
secure: false,
|
|
113
|
+
connectionTimeout: 5000
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
// Test different return types
|
|
117
|
+
const returnTypes = [
|
|
118
|
+
{ type: 'FULL', description: 'Return full message on failure' },
|
|
119
|
+
{ type: 'HEADERS', description: 'Return headers only' }
|
|
120
|
+
];
|
|
121
|
+
|
|
122
|
+
for (const returnType of returnTypes) {
|
|
123
|
+
console.log(`Testing DSN return type: ${returnType.description}`);
|
|
124
|
+
|
|
125
|
+
const email = new Email({
|
|
126
|
+
from: 'sender@example.com',
|
|
127
|
+
to: 'recipient@example.com',
|
|
128
|
+
subject: `DSN Return Type: ${returnType.type}`,
|
|
129
|
+
text: 'Testing DSN return types',
|
|
130
|
+
headers: {
|
|
131
|
+
'X-DSN-Notify': 'FAILURE',
|
|
132
|
+
'X-DSN-Return': returnType.type
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
const result = await smtpClient.sendMail(email);
|
|
137
|
+
expect(result.success).toBeTruthy();
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
console.log('DSN return types test completed successfully');
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
tap.test('CEP-10: MDN (Message Disposition Notification)', async () => {
|
|
144
|
+
const smtpClient = await createSmtpClient({
|
|
145
|
+
host: testServer.hostname,
|
|
146
|
+
port: testServer.port,
|
|
147
|
+
secure: false,
|
|
148
|
+
connectionTimeout: 5000
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
// Create MDN request email
|
|
152
|
+
const email = new Email({
|
|
153
|
+
from: 'sender@example.com',
|
|
154
|
+
to: 'recipient@example.com',
|
|
155
|
+
subject: 'Please confirm reading',
|
|
156
|
+
text: 'This message requests a read receipt',
|
|
157
|
+
headers: {
|
|
158
|
+
'Disposition-Notification-To': 'sender@example.com',
|
|
159
|
+
'Disposition-Notification-Options': 'signed-receipt-protocol=optional,pkcs7-signature',
|
|
160
|
+
'Original-Message-ID': `<${Date.now()}@example.com>`
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
const result = await smtpClient.sendMail(email);
|
|
165
|
+
expect(result.success).toBeTruthy();
|
|
166
|
+
|
|
167
|
+
// Simulate MDN response
|
|
168
|
+
const mdnResponse = new Email({
|
|
169
|
+
from: 'recipient@example.com',
|
|
170
|
+
to: 'sender@example.com',
|
|
171
|
+
subject: 'Read: Please confirm reading',
|
|
172
|
+
headers: {
|
|
173
|
+
'Content-Type': 'multipart/report; report-type=disposition-notification',
|
|
174
|
+
'In-Reply-To': `<${Date.now()}@example.com>`,
|
|
175
|
+
'References': `<${Date.now()}@example.com>`,
|
|
176
|
+
'Auto-Submitted': 'auto-replied'
|
|
177
|
+
},
|
|
178
|
+
text: 'The message was displayed to the recipient',
|
|
179
|
+
attachments: [{
|
|
180
|
+
filename: 'disposition-notification.txt',
|
|
181
|
+
content: Buffer.from(`Reporting-UA: mail.example.com; MailClient/1.0
|
|
182
|
+
Original-Recipient: rfc822;recipient@example.com
|
|
183
|
+
Final-Recipient: rfc822;recipient@example.com
|
|
184
|
+
Original-Message-ID: <${Date.now()}@example.com>
|
|
185
|
+
Disposition: automatic-action/MDN-sent-automatically; displayed`),
|
|
186
|
+
contentType: 'message/disposition-notification'
|
|
187
|
+
}]
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
const mdnResult = await smtpClient.sendMail(mdnResponse);
|
|
191
|
+
expect(mdnResult.success).toBeTruthy();
|
|
192
|
+
console.log('MDN test completed successfully');
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
tap.test('CEP-10: Multiple recipients with different DSN', async () => {
|
|
196
|
+
const smtpClient = await createSmtpClient({
|
|
197
|
+
host: testServer.hostname,
|
|
198
|
+
port: testServer.port,
|
|
199
|
+
secure: false,
|
|
200
|
+
connectionTimeout: 5000
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
// Email with multiple recipients
|
|
204
|
+
const emails = [
|
|
205
|
+
{
|
|
206
|
+
to: 'important@example.com',
|
|
207
|
+
dsn: 'SUCCESS,FAILURE,DELAY'
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
to: 'normal@example.com',
|
|
211
|
+
dsn: 'FAILURE'
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
to: 'optional@example.com',
|
|
215
|
+
dsn: 'NEVER'
|
|
216
|
+
}
|
|
217
|
+
];
|
|
218
|
+
|
|
219
|
+
for (const emailData of emails) {
|
|
220
|
+
const email = new Email({
|
|
221
|
+
from: 'sender@example.com',
|
|
222
|
+
to: emailData.to,
|
|
223
|
+
subject: 'Multi-recipient DSN Test',
|
|
224
|
+
text: 'Testing per-recipient DSN options',
|
|
225
|
+
headers: {
|
|
226
|
+
'X-DSN-Notify': emailData.dsn,
|
|
227
|
+
'X-DSN-Return': 'HEADERS'
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
const result = await smtpClient.sendMail(email);
|
|
232
|
+
expect(result.success).toBeTruthy();
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
console.log('Multiple recipients DSN test completed successfully');
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
tap.test('CEP-10: DSN with ORCPT', async () => {
|
|
239
|
+
const smtpClient = await createSmtpClient({
|
|
240
|
+
host: testServer.hostname,
|
|
241
|
+
port: testServer.port,
|
|
242
|
+
secure: false,
|
|
243
|
+
connectionTimeout: 5000
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
// Test ORCPT (Original Recipient) parameter
|
|
247
|
+
const email = new Email({
|
|
248
|
+
from: 'sender@example.com',
|
|
249
|
+
to: 'forwarded@example.com',
|
|
250
|
+
subject: 'DSN with ORCPT Test',
|
|
251
|
+
text: 'Testing original recipient tracking',
|
|
252
|
+
headers: {
|
|
253
|
+
'X-DSN-Notify': 'SUCCESS,FAILURE',
|
|
254
|
+
'X-DSN-Return': 'HEADERS',
|
|
255
|
+
'X-Original-Recipient': 'rfc822;original@example.com'
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
const result = await smtpClient.sendMail(email);
|
|
260
|
+
expect(result.success).toBeTruthy();
|
|
261
|
+
console.log('DSN with ORCPT test sent successfully');
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
tap.test('CEP-10: Receipt request formats', async () => {
|
|
265
|
+
const smtpClient = await createSmtpClient({
|
|
266
|
+
host: testServer.hostname,
|
|
267
|
+
port: testServer.port,
|
|
268
|
+
secure: false,
|
|
269
|
+
connectionTimeout: 5000
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
// Test various receipt request formats
|
|
273
|
+
const receiptFormats = [
|
|
274
|
+
{
|
|
275
|
+
name: 'Simple email',
|
|
276
|
+
value: 'receipts@example.com'
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
name: 'With display name',
|
|
280
|
+
value: '"Receipt Handler" <receipts@example.com>'
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
name: 'Multiple addresses',
|
|
284
|
+
value: 'receipts@example.com, backup@example.com'
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
name: 'With comment',
|
|
288
|
+
value: 'receipts@example.com (Automated System)'
|
|
289
|
+
}
|
|
290
|
+
];
|
|
291
|
+
|
|
292
|
+
for (const format of receiptFormats) {
|
|
293
|
+
console.log(`Testing receipt format: ${format.name}`);
|
|
294
|
+
|
|
295
|
+
const email = new Email({
|
|
296
|
+
from: 'sender@example.com',
|
|
297
|
+
to: 'recipient@example.com',
|
|
298
|
+
subject: `Receipt Format: ${format.name}`,
|
|
299
|
+
text: 'Testing receipt address formats',
|
|
300
|
+
headers: {
|
|
301
|
+
'Disposition-Notification-To': format.value
|
|
302
|
+
}
|
|
303
|
+
});
|
|
304
|
+
|
|
305
|
+
const result = await smtpClient.sendMail(email);
|
|
306
|
+
expect(result.success).toBeTruthy();
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
console.log('Receipt request formats test completed successfully');
|
|
310
|
+
});
|
|
311
|
+
|
|
312
|
+
tap.test('CEP-10: Non-delivery reports', async () => {
|
|
313
|
+
const smtpClient = await createSmtpClient({
|
|
314
|
+
host: testServer.hostname,
|
|
315
|
+
port: testServer.port,
|
|
316
|
+
secure: false,
|
|
317
|
+
connectionTimeout: 5000
|
|
318
|
+
});
|
|
319
|
+
|
|
320
|
+
// Simulate bounce/NDR structure
|
|
321
|
+
const ndrEmail = new Email({
|
|
322
|
+
from: 'MAILER-DAEMON@example.com',
|
|
323
|
+
to: 'original-sender@example.com',
|
|
324
|
+
subject: 'Undelivered Mail Returned to Sender',
|
|
325
|
+
headers: {
|
|
326
|
+
'Auto-Submitted': 'auto-replied',
|
|
327
|
+
'Content-Type': 'multipart/report; report-type=delivery-status',
|
|
328
|
+
'X-Failed-Recipients': 'nonexistent@example.com'
|
|
329
|
+
},
|
|
330
|
+
text: 'This is the mail delivery agent at example.com.\n\n' +
|
|
331
|
+
'I was unable to deliver your message to the following addresses:\n\n' +
|
|
332
|
+
'<nonexistent@example.com>: User unknown',
|
|
333
|
+
attachments: [
|
|
334
|
+
{
|
|
335
|
+
filename: 'delivery-status.txt',
|
|
336
|
+
content: Buffer.from(`Reporting-MTA: dns; mail.example.com
|
|
337
|
+
X-Queue-ID: 123456789
|
|
338
|
+
Arrival-Date: ${new Date().toUTCString()}
|
|
339
|
+
|
|
340
|
+
Final-Recipient: rfc822;nonexistent@example.com
|
|
341
|
+
Original-Recipient: rfc822;nonexistent@example.com
|
|
342
|
+
Action: failed
|
|
343
|
+
Status: 5.1.1
|
|
344
|
+
Diagnostic-Code: smtp; 550 5.1.1 User unknown`),
|
|
345
|
+
contentType: 'message/delivery-status'
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
filename: 'original-message.eml',
|
|
349
|
+
content: Buffer.from('From: original-sender@example.com\r\n' +
|
|
350
|
+
'To: nonexistent@example.com\r\n' +
|
|
351
|
+
'Subject: Original Subject\r\n\r\n' +
|
|
352
|
+
'Original message content'),
|
|
353
|
+
contentType: 'message/rfc822'
|
|
354
|
+
}
|
|
355
|
+
]
|
|
356
|
+
});
|
|
357
|
+
|
|
358
|
+
const result = await smtpClient.sendMail(ndrEmail);
|
|
359
|
+
expect(result.success).toBeTruthy();
|
|
360
|
+
console.log('Non-delivery report test sent successfully');
|
|
361
|
+
});
|
|
362
|
+
|
|
363
|
+
tap.test('CEP-10: Delivery delay notifications', async () => {
|
|
364
|
+
const smtpClient = await createSmtpClient({
|
|
365
|
+
host: testServer.hostname,
|
|
366
|
+
port: testServer.port,
|
|
367
|
+
secure: false,
|
|
368
|
+
connectionTimeout: 5000
|
|
369
|
+
});
|
|
370
|
+
|
|
371
|
+
// Simulate delayed delivery notification
|
|
372
|
+
const delayNotification = new Email({
|
|
373
|
+
from: 'postmaster@example.com',
|
|
374
|
+
to: 'sender@example.com',
|
|
375
|
+
subject: 'Delivery Status: Delayed',
|
|
376
|
+
headers: {
|
|
377
|
+
'Auto-Submitted': 'auto-replied',
|
|
378
|
+
'Content-Type': 'multipart/report; report-type=delivery-status',
|
|
379
|
+
'X-Delay-Reason': 'Remote server temporarily unavailable'
|
|
380
|
+
},
|
|
381
|
+
text: 'This is an automatically generated Delivery Delay Notification.\n\n' +
|
|
382
|
+
'Your message has not been delivered to the following recipients yet:\n\n' +
|
|
383
|
+
' recipient@remote-server.com\n\n' +
|
|
384
|
+
'The server will continue trying to deliver your message for 48 hours.',
|
|
385
|
+
attachments: [{
|
|
386
|
+
filename: 'delay-status.txt',
|
|
387
|
+
content: Buffer.from(`Reporting-MTA: dns; mail.example.com
|
|
388
|
+
Arrival-Date: ${new Date(Date.now() - 3600000).toUTCString()}
|
|
389
|
+
Last-Attempt-Date: ${new Date().toUTCString()}
|
|
390
|
+
|
|
391
|
+
Final-Recipient: rfc822;recipient@remote-server.com
|
|
392
|
+
Action: delayed
|
|
393
|
+
Status: 4.4.1
|
|
394
|
+
Will-Retry-Until: ${new Date(Date.now() + 172800000).toUTCString()}
|
|
395
|
+
Diagnostic-Code: smtp; 421 4.4.1 Remote server temporarily unavailable`),
|
|
396
|
+
contentType: 'message/delivery-status'
|
|
397
|
+
}]
|
|
398
|
+
});
|
|
399
|
+
|
|
400
|
+
const result = await smtpClient.sendMail(delayNotification);
|
|
401
|
+
expect(result.success).toBeTruthy();
|
|
402
|
+
console.log('Delivery delay notification test sent successfully');
|
|
403
|
+
});
|
|
404
|
+
|
|
405
|
+
tap.test('cleanup test SMTP server', async () => {
|
|
406
|
+
if (testServer) {
|
|
407
|
+
await stopTestServer(testServer);
|
|
408
|
+
}
|
|
409
|
+
});
|
|
410
|
+
|
|
411
|
+
export default tap.start();
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
import { tap, expect } from '@git.zone/tstest/tapbundle';
|
|
2
|
+
import { startTestServer, stopTestServer, type ITestServer } from '../../helpers/server.loader.js';
|
|
3
|
+
import { createSmtpClient } from '../../../ts/mail/delivery/smtpclient/index.js';
|
|
4
|
+
import type { SmtpClient } from '../../../ts/mail/delivery/smtpclient/smtp-client.js';
|
|
5
|
+
import { Email } from '../../../ts/mail/core/classes.email.js';
|
|
6
|
+
|
|
7
|
+
let testServer: ITestServer;
|
|
8
|
+
let smtpClient: SmtpClient;
|
|
9
|
+
|
|
10
|
+
tap.test('setup - start SMTP server for error handling tests', async () => {
|
|
11
|
+
testServer = await startTestServer({
|
|
12
|
+
port: 2550,
|
|
13
|
+
tlsEnabled: false,
|
|
14
|
+
authRequired: false,
|
|
15
|
+
maxRecipients: 5 // Low limit to trigger errors
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
expect(testServer.port).toEqual(2550);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
tap.test('CERR-01: 4xx Errors - should handle invalid recipient (450)', async () => {
|
|
22
|
+
smtpClient = await createSmtpClient({
|
|
23
|
+
host: testServer.hostname,
|
|
24
|
+
port: testServer.port,
|
|
25
|
+
secure: false,
|
|
26
|
+
connectionTimeout: 5000
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
// Create email with syntactically valid but nonexistent recipient
|
|
30
|
+
const email = new Email({
|
|
31
|
+
from: 'test@example.com',
|
|
32
|
+
to: 'nonexistent-user@nonexistent-domain-12345.invalid',
|
|
33
|
+
subject: 'Testing 4xx Error',
|
|
34
|
+
text: 'This should trigger a 4xx error'
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const result = await smtpClient.sendMail(email);
|
|
38
|
+
|
|
39
|
+
// Test server may accept or reject - both are valid test outcomes
|
|
40
|
+
if (!result.success) {
|
|
41
|
+
console.log('✅ Invalid recipient handled:', result.error?.message);
|
|
42
|
+
} else {
|
|
43
|
+
console.log('ℹ️ Test server accepted recipient (common in test environments)');
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
expect(result).toBeTruthy();
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
tap.test('CERR-01: 4xx Errors - should handle mailbox unavailable (450)', async () => {
|
|
50
|
+
const email = new Email({
|
|
51
|
+
from: 'test@example.com',
|
|
52
|
+
to: 'mailbox-full@example.com', // Valid format but might be unavailable
|
|
53
|
+
subject: 'Mailbox Unavailable Test',
|
|
54
|
+
text: 'Testing mailbox unavailable error'
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const result = await smtpClient.sendMail(email);
|
|
58
|
+
|
|
59
|
+
// Depending on server configuration, this might be accepted or rejected
|
|
60
|
+
if (!result.success) {
|
|
61
|
+
console.log('✅ Mailbox unavailable handled:', result.error?.message);
|
|
62
|
+
} else {
|
|
63
|
+
// Some test servers accept all recipients
|
|
64
|
+
console.log('ℹ️ Test server accepted recipient (common in test environments)');
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
expect(result).toBeTruthy();
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
tap.test('CERR-01: 4xx Errors - should handle quota exceeded (452)', async () => {
|
|
71
|
+
// Send multiple emails to trigger quota/limit errors
|
|
72
|
+
const emails = [];
|
|
73
|
+
for (let i = 0; i < 10; i++) {
|
|
74
|
+
emails.push(new Email({
|
|
75
|
+
from: 'test@example.com',
|
|
76
|
+
to: `recipient${i}@example.com`,
|
|
77
|
+
subject: `Quota Test ${i}`,
|
|
78
|
+
text: 'Testing quota limits'
|
|
79
|
+
}));
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
let quotaErrorCount = 0;
|
|
83
|
+
const results = await Promise.allSettled(
|
|
84
|
+
emails.map(email => smtpClient.sendMail(email))
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
results.forEach((result, index) => {
|
|
88
|
+
if (result.status === 'rejected') {
|
|
89
|
+
quotaErrorCount++;
|
|
90
|
+
console.log(`Email ${index} rejected:`, result.reason);
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
console.log(`✅ Handled ${quotaErrorCount} quota-related errors`);
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
tap.test('CERR-01: 4xx Errors - should handle too many recipients (452)', async () => {
|
|
98
|
+
// Create email with many recipients to exceed limit
|
|
99
|
+
const recipients = [];
|
|
100
|
+
for (let i = 0; i < 10; i++) {
|
|
101
|
+
recipients.push(`recipient${i}@example.com`);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const email = new Email({
|
|
105
|
+
from: 'test@example.com',
|
|
106
|
+
to: recipients, // Many recipients
|
|
107
|
+
subject: 'Too Many Recipients Test',
|
|
108
|
+
text: 'Testing recipient limit'
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
const result = await smtpClient.sendMail(email);
|
|
112
|
+
|
|
113
|
+
// Check if some recipients were rejected due to limits
|
|
114
|
+
if (result.rejectedRecipients.length > 0) {
|
|
115
|
+
console.log(`✅ Rejected ${result.rejectedRecipients.length} recipients due to limits`);
|
|
116
|
+
expect(result.rejectedRecipients).toBeArray();
|
|
117
|
+
} else {
|
|
118
|
+
// Server might accept all
|
|
119
|
+
expect(result.acceptedRecipients.length).toEqual(recipients.length);
|
|
120
|
+
console.log('ℹ️ Server accepted all recipients');
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
tap.test('CERR-01: 4xx Errors - should handle authentication required (450)', async () => {
|
|
125
|
+
// Create new server requiring auth
|
|
126
|
+
const authServer = await startTestServer({
|
|
127
|
+
port: 2551,
|
|
128
|
+
authRequired: true // This will reject unauthenticated commands
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
const unauthClient = await createSmtpClient({
|
|
132
|
+
host: authServer.hostname,
|
|
133
|
+
port: authServer.port,
|
|
134
|
+
secure: false,
|
|
135
|
+
// No auth credentials provided
|
|
136
|
+
connectionTimeout: 5000
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
const email = new Email({
|
|
140
|
+
from: 'test@example.com',
|
|
141
|
+
to: 'recipient@example.com',
|
|
142
|
+
subject: 'Auth Required Test',
|
|
143
|
+
text: 'Should fail without auth'
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
let authError = false;
|
|
147
|
+
try {
|
|
148
|
+
const result = await unauthClient.sendMail(email);
|
|
149
|
+
if (!result.success) {
|
|
150
|
+
authError = true;
|
|
151
|
+
console.log('✅ Authentication required error handled:', result.error?.message);
|
|
152
|
+
}
|
|
153
|
+
} catch (error) {
|
|
154
|
+
authError = true;
|
|
155
|
+
console.log('✅ Authentication required error caught:', error.message);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
expect(authError).toBeTrue();
|
|
159
|
+
|
|
160
|
+
await stopTestServer(authServer);
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
tap.test('CERR-01: 4xx Errors - should parse enhanced status codes', async () => {
|
|
164
|
+
// 4xx errors often include enhanced status codes (e.g., 4.7.1)
|
|
165
|
+
const email = new Email({
|
|
166
|
+
from: 'test@blocked-domain.com', // Might trigger policy rejection
|
|
167
|
+
to: 'recipient@example.com',
|
|
168
|
+
subject: 'Enhanced Status Code Test',
|
|
169
|
+
text: 'Testing enhanced status codes'
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
try {
|
|
173
|
+
const result = await smtpClient.sendMail(email);
|
|
174
|
+
|
|
175
|
+
if (!result.success && result.error) {
|
|
176
|
+
console.log('✅ Error details:', {
|
|
177
|
+
message: result.error.message,
|
|
178
|
+
response: result.response
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
} catch (error: any) {
|
|
182
|
+
// Check if error includes status information
|
|
183
|
+
expect(error.message).toBeTypeofString();
|
|
184
|
+
console.log('✅ Error with potential enhanced status:', error.message);
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
tap.test('CERR-01: 4xx Errors - should not retry permanent 4xx errors', async () => {
|
|
189
|
+
// Track retry attempts
|
|
190
|
+
let attemptCount = 0;
|
|
191
|
+
|
|
192
|
+
const trackingClient = await createSmtpClient({
|
|
193
|
+
host: testServer.hostname,
|
|
194
|
+
port: testServer.port,
|
|
195
|
+
secure: false,
|
|
196
|
+
connectionTimeout: 5000
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
const email = new Email({
|
|
200
|
+
from: 'blocked-sender@blacklisted-domain.invalid', // Might trigger policy rejection
|
|
201
|
+
to: 'recipient@example.com',
|
|
202
|
+
subject: 'Permanent Error Test',
|
|
203
|
+
text: 'Should not retry'
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
const result = await trackingClient.sendMail(email);
|
|
207
|
+
|
|
208
|
+
// Test completed - whether success or failure, no retries should occur
|
|
209
|
+
if (!result.success) {
|
|
210
|
+
console.log('✅ Permanent error handled without retry:', result.error?.message);
|
|
211
|
+
} else {
|
|
212
|
+
console.log('ℹ️ Email accepted (no policy rejection in test server)');
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
expect(result).toBeTruthy();
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
tap.test('cleanup - close SMTP client', async () => {
|
|
219
|
+
if (smtpClient) {
|
|
220
|
+
try {
|
|
221
|
+
await smtpClient.close();
|
|
222
|
+
} catch (error) {
|
|
223
|
+
console.log('Client already closed or error during close');
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
tap.test('cleanup - stop SMTP server', async () => {
|
|
229
|
+
await stopTestServer(testServer);
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
export default tap.start();
|