@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,333 @@
|
|
|
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
|
+
|
|
9
|
+
tap.test('setup test SMTP server', async () => {
|
|
10
|
+
testServer = await startTestServer({
|
|
11
|
+
port: 2548,
|
|
12
|
+
tlsEnabled: false,
|
|
13
|
+
authRequired: false
|
|
14
|
+
});
|
|
15
|
+
expect(testServer).toBeTruthy();
|
|
16
|
+
expect(testServer.port).toBeGreaterThan(0);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
tap.test('CCMD-08: Client handles transaction reset internally', async () => {
|
|
20
|
+
const smtpClient = createSmtpClient({
|
|
21
|
+
host: testServer.hostname,
|
|
22
|
+
port: testServer.port,
|
|
23
|
+
secure: false,
|
|
24
|
+
connectionTimeout: 5000,
|
|
25
|
+
debug: true
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
// Send first email
|
|
29
|
+
const email1 = new Email({
|
|
30
|
+
from: 'sender1@example.com',
|
|
31
|
+
to: 'recipient1@example.com',
|
|
32
|
+
subject: 'First Email',
|
|
33
|
+
text: 'This is the first email'
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const result1 = await smtpClient.sendMail(email1);
|
|
37
|
+
expect(result1.success).toBeTrue();
|
|
38
|
+
|
|
39
|
+
// Send second email - client handles RSET internally if needed
|
|
40
|
+
const email2 = new Email({
|
|
41
|
+
from: 'sender2@example.com',
|
|
42
|
+
to: 'recipient2@example.com',
|
|
43
|
+
subject: 'Second Email',
|
|
44
|
+
text: 'This is the second email'
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
const result2 = await smtpClient.sendMail(email2);
|
|
48
|
+
expect(result2.success).toBeTrue();
|
|
49
|
+
|
|
50
|
+
console.log('✅ Client handles transaction reset between emails');
|
|
51
|
+
console.log('RSET is used internally to ensure clean state');
|
|
52
|
+
|
|
53
|
+
await smtpClient.close();
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
tap.test('CCMD-08: Clean state after failed recipient', async () => {
|
|
57
|
+
const smtpClient = createSmtpClient({
|
|
58
|
+
host: testServer.hostname,
|
|
59
|
+
port: testServer.port,
|
|
60
|
+
secure: false,
|
|
61
|
+
connectionTimeout: 5000,
|
|
62
|
+
debug: true
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
// Send email with multiple recipients - if one fails, RSET ensures clean state
|
|
66
|
+
const email = new Email({
|
|
67
|
+
from: 'sender@example.com',
|
|
68
|
+
to: [
|
|
69
|
+
'valid1@example.com',
|
|
70
|
+
'valid2@example.com',
|
|
71
|
+
'valid3@example.com'
|
|
72
|
+
],
|
|
73
|
+
subject: 'Multi-recipient Email',
|
|
74
|
+
text: 'Testing state management'
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
const result = await smtpClient.sendMail(email);
|
|
78
|
+
expect(result.success).toBeTrue();
|
|
79
|
+
|
|
80
|
+
// All recipients should be accepted
|
|
81
|
+
expect(result.acceptedRecipients.length).toEqual(3);
|
|
82
|
+
|
|
83
|
+
console.log('✅ State remains clean with multiple recipients');
|
|
84
|
+
console.log('Internal RSET ensures proper transaction handling');
|
|
85
|
+
|
|
86
|
+
await smtpClient.close();
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
tap.test('CCMD-08: Multiple emails in sequence', async () => {
|
|
90
|
+
const smtpClient = createSmtpClient({
|
|
91
|
+
host: testServer.hostname,
|
|
92
|
+
port: testServer.port,
|
|
93
|
+
secure: false,
|
|
94
|
+
connectionTimeout: 5000,
|
|
95
|
+
debug: true
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
// Send multiple emails in sequence
|
|
99
|
+
const emails = [
|
|
100
|
+
{
|
|
101
|
+
from: 'sender1@example.com',
|
|
102
|
+
to: 'recipient1@example.com',
|
|
103
|
+
subject: 'Email 1',
|
|
104
|
+
text: 'First email'
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
from: 'sender2@example.com',
|
|
108
|
+
to: 'recipient2@example.com',
|
|
109
|
+
subject: 'Email 2',
|
|
110
|
+
text: 'Second email'
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
from: 'sender3@example.com',
|
|
114
|
+
to: 'recipient3@example.com',
|
|
115
|
+
subject: 'Email 3',
|
|
116
|
+
text: 'Third email'
|
|
117
|
+
}
|
|
118
|
+
];
|
|
119
|
+
|
|
120
|
+
for (const emailData of emails) {
|
|
121
|
+
const email = new Email(emailData);
|
|
122
|
+
const result = await smtpClient.sendMail(email);
|
|
123
|
+
expect(result.success).toBeTrue();
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
console.log('✅ Successfully sent multiple emails in sequence');
|
|
127
|
+
console.log('RSET ensures clean state between each transaction');
|
|
128
|
+
|
|
129
|
+
await smtpClient.close();
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
tap.test('CCMD-08: Connection pooling with clean state', async () => {
|
|
133
|
+
const smtpClient = createSmtpClient({
|
|
134
|
+
host: testServer.hostname,
|
|
135
|
+
port: testServer.port,
|
|
136
|
+
secure: false,
|
|
137
|
+
pool: true,
|
|
138
|
+
maxConnections: 2,
|
|
139
|
+
connectionTimeout: 5000,
|
|
140
|
+
debug: true
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
// Send emails concurrently
|
|
144
|
+
const promises = Array.from({ length: 5 }, (_, i) => {
|
|
145
|
+
const email = new Email({
|
|
146
|
+
from: `sender${i}@example.com`,
|
|
147
|
+
to: `recipient${i}@example.com`,
|
|
148
|
+
subject: `Pooled Email ${i}`,
|
|
149
|
+
text: `This is pooled email ${i}`
|
|
150
|
+
});
|
|
151
|
+
return smtpClient.sendMail(email);
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
const results = await Promise.all(promises);
|
|
155
|
+
|
|
156
|
+
// Check results and log any failures
|
|
157
|
+
results.forEach((result, index) => {
|
|
158
|
+
console.log(`Email ${index}: ${result.success ? '✅' : '❌'} ${!result.success ? result.error?.message : ''}`);
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
// With connection pooling, at least some emails should succeed
|
|
162
|
+
const successCount = results.filter(r => r.success).length;
|
|
163
|
+
console.log(`Successfully sent ${successCount} of ${results.length} emails`);
|
|
164
|
+
expect(successCount).toBeGreaterThan(0);
|
|
165
|
+
|
|
166
|
+
console.log('✅ Connection pool maintains clean state');
|
|
167
|
+
console.log('RSET ensures each pooled connection starts fresh');
|
|
168
|
+
|
|
169
|
+
await smtpClient.close();
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
tap.test('CCMD-08: Error recovery with state reset', async () => {
|
|
173
|
+
const smtpClient = createSmtpClient({
|
|
174
|
+
host: testServer.hostname,
|
|
175
|
+
port: testServer.port,
|
|
176
|
+
secure: false,
|
|
177
|
+
connectionTimeout: 5000,
|
|
178
|
+
debug: true
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
// First, try with invalid sender (should fail early)
|
|
182
|
+
try {
|
|
183
|
+
const badEmail = new Email({
|
|
184
|
+
from: '', // Invalid
|
|
185
|
+
to: 'recipient@example.com',
|
|
186
|
+
subject: 'Bad Email',
|
|
187
|
+
text: 'This should fail'
|
|
188
|
+
});
|
|
189
|
+
await smtpClient.sendMail(badEmail);
|
|
190
|
+
} catch (error) {
|
|
191
|
+
// Expected to fail
|
|
192
|
+
console.log('✅ Invalid email rejected as expected');
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
// Now send a valid email - should work fine
|
|
196
|
+
const goodEmail = new Email({
|
|
197
|
+
from: 'sender@example.com',
|
|
198
|
+
to: 'recipient@example.com',
|
|
199
|
+
subject: 'Good Email',
|
|
200
|
+
text: 'This should succeed'
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
const result = await smtpClient.sendMail(goodEmail);
|
|
204
|
+
expect(result.success).toBeTrue();
|
|
205
|
+
|
|
206
|
+
console.log('✅ State recovered after error');
|
|
207
|
+
console.log('RSET ensures clean state after failures');
|
|
208
|
+
|
|
209
|
+
await smtpClient.close();
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
tap.test('CCMD-08: Verify command maintains session', async () => {
|
|
213
|
+
const smtpClient = createSmtpClient({
|
|
214
|
+
host: testServer.hostname,
|
|
215
|
+
port: testServer.port,
|
|
216
|
+
secure: false,
|
|
217
|
+
connectionTimeout: 5000,
|
|
218
|
+
debug: true
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
// verify() creates temporary connection
|
|
222
|
+
const verified1 = await smtpClient.verify();
|
|
223
|
+
expect(verified1).toBeTrue();
|
|
224
|
+
|
|
225
|
+
// Send email after verify
|
|
226
|
+
const email = new Email({
|
|
227
|
+
from: 'sender@example.com',
|
|
228
|
+
to: 'recipient@example.com',
|
|
229
|
+
subject: 'After Verify',
|
|
230
|
+
text: 'Email after verification'
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
const result = await smtpClient.sendMail(email);
|
|
234
|
+
expect(result.success).toBeTrue();
|
|
235
|
+
|
|
236
|
+
// verify() again
|
|
237
|
+
const verified2 = await smtpClient.verify();
|
|
238
|
+
expect(verified2).toBeTrue();
|
|
239
|
+
|
|
240
|
+
console.log('✅ Verify operations maintain clean session state');
|
|
241
|
+
console.log('Each operation ensures proper state management');
|
|
242
|
+
|
|
243
|
+
await smtpClient.close();
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
tap.test('CCMD-08: Rapid sequential sends', async () => {
|
|
247
|
+
const smtpClient = createSmtpClient({
|
|
248
|
+
host: testServer.hostname,
|
|
249
|
+
port: testServer.port,
|
|
250
|
+
secure: false,
|
|
251
|
+
connectionTimeout: 5000,
|
|
252
|
+
debug: true
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
// Send emails rapidly
|
|
256
|
+
const count = 10;
|
|
257
|
+
const startTime = Date.now();
|
|
258
|
+
|
|
259
|
+
for (let i = 0; i < count; i++) {
|
|
260
|
+
const email = new Email({
|
|
261
|
+
from: 'sender@example.com',
|
|
262
|
+
to: 'recipient@example.com',
|
|
263
|
+
subject: `Rapid Email ${i}`,
|
|
264
|
+
text: `Rapid test email ${i}`
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
const result = await smtpClient.sendMail(email);
|
|
268
|
+
expect(result.success).toBeTrue();
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
const elapsed = Date.now() - startTime;
|
|
272
|
+
const avgTime = elapsed / count;
|
|
273
|
+
|
|
274
|
+
console.log(`✅ Sent ${count} emails in ${elapsed}ms`);
|
|
275
|
+
console.log(`Average time per email: ${avgTime.toFixed(2)}ms`);
|
|
276
|
+
console.log('RSET maintains efficiency in rapid sends');
|
|
277
|
+
|
|
278
|
+
await smtpClient.close();
|
|
279
|
+
});
|
|
280
|
+
|
|
281
|
+
tap.test('CCMD-08: State isolation between clients', async () => {
|
|
282
|
+
// Create two separate clients
|
|
283
|
+
const client1 = createSmtpClient({
|
|
284
|
+
host: testServer.hostname,
|
|
285
|
+
port: testServer.port,
|
|
286
|
+
secure: false,
|
|
287
|
+
connectionTimeout: 5000
|
|
288
|
+
});
|
|
289
|
+
|
|
290
|
+
const client2 = createSmtpClient({
|
|
291
|
+
host: testServer.hostname,
|
|
292
|
+
port: testServer.port,
|
|
293
|
+
secure: false,
|
|
294
|
+
connectionTimeout: 5000
|
|
295
|
+
});
|
|
296
|
+
|
|
297
|
+
// Send from both clients
|
|
298
|
+
const email1 = new Email({
|
|
299
|
+
from: 'client1@example.com',
|
|
300
|
+
to: 'recipient1@example.com',
|
|
301
|
+
subject: 'From Client 1',
|
|
302
|
+
text: 'Email from client 1'
|
|
303
|
+
});
|
|
304
|
+
|
|
305
|
+
const email2 = new Email({
|
|
306
|
+
from: 'client2@example.com',
|
|
307
|
+
to: 'recipient2@example.com',
|
|
308
|
+
subject: 'From Client 2',
|
|
309
|
+
text: 'Email from client 2'
|
|
310
|
+
});
|
|
311
|
+
|
|
312
|
+
// Send concurrently
|
|
313
|
+
const [result1, result2] = await Promise.all([
|
|
314
|
+
client1.sendMail(email1),
|
|
315
|
+
client2.sendMail(email2)
|
|
316
|
+
]);
|
|
317
|
+
|
|
318
|
+
expect(result1.success).toBeTrue();
|
|
319
|
+
expect(result2.success).toBeTrue();
|
|
320
|
+
|
|
321
|
+
console.log('✅ Each client maintains isolated state');
|
|
322
|
+
console.log('RSET ensures no cross-contamination');
|
|
323
|
+
|
|
324
|
+
await client1.close();
|
|
325
|
+
await client2.close();
|
|
326
|
+
});
|
|
327
|
+
|
|
328
|
+
tap.test('cleanup test SMTP server', async () => {
|
|
329
|
+
await stopTestServer(testServer);
|
|
330
|
+
expect(testServer).toBeTruthy();
|
|
331
|
+
});
|
|
332
|
+
|
|
333
|
+
export default tap.start();
|
|
@@ -0,0 +1,339 @@
|
|
|
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 test SMTP server', async () => {
|
|
11
|
+
testServer = await startTestServer({
|
|
12
|
+
port: 2549,
|
|
13
|
+
tlsEnabled: false,
|
|
14
|
+
authRequired: false
|
|
15
|
+
});
|
|
16
|
+
expect(testServer).toBeTruthy();
|
|
17
|
+
expect(testServer.port).toBeGreaterThan(0);
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
tap.test('CCMD-09: Connection keepalive test', async () => {
|
|
21
|
+
// NOOP is used internally for keepalive - test that connections remain active
|
|
22
|
+
smtpClient = createSmtpClient({
|
|
23
|
+
host: testServer.hostname,
|
|
24
|
+
port: testServer.port,
|
|
25
|
+
secure: false,
|
|
26
|
+
connectionTimeout: 10000,
|
|
27
|
+
greetingTimeout: 5000,
|
|
28
|
+
socketTimeout: 10000
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
// Send an initial email to establish connection
|
|
32
|
+
const email1 = new Email({
|
|
33
|
+
from: 'sender@example.com',
|
|
34
|
+
to: ['recipient@example.com'],
|
|
35
|
+
subject: 'Initial connection test',
|
|
36
|
+
text: 'Testing connection establishment'
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
await smtpClient.sendMail(email1);
|
|
40
|
+
console.log('First email sent successfully');
|
|
41
|
+
|
|
42
|
+
// Wait 5 seconds (connection should stay alive with internal NOOP)
|
|
43
|
+
await new Promise(resolve => setTimeout(resolve, 5000));
|
|
44
|
+
|
|
45
|
+
// Send another email on the same connection
|
|
46
|
+
const email2 = new Email({
|
|
47
|
+
from: 'sender@example.com',
|
|
48
|
+
to: ['recipient@example.com'],
|
|
49
|
+
subject: 'Keepalive test',
|
|
50
|
+
text: 'Testing connection after delay'
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
await smtpClient.sendMail(email2);
|
|
54
|
+
console.log('Second email sent successfully after 5 second delay');
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
tap.test('CCMD-09: Multiple emails in sequence', async () => {
|
|
58
|
+
// Test that client can handle multiple emails without issues
|
|
59
|
+
// Internal NOOP commands may be used between transactions
|
|
60
|
+
|
|
61
|
+
const emails = [];
|
|
62
|
+
for (let i = 0; i < 5; i++) {
|
|
63
|
+
emails.push(new Email({
|
|
64
|
+
from: 'sender@example.com',
|
|
65
|
+
to: [`recipient${i}@example.com`],
|
|
66
|
+
subject: `Sequential email ${i + 1}`,
|
|
67
|
+
text: `This is email number ${i + 1}`
|
|
68
|
+
}));
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
console.log('Sending 5 emails in sequence...');
|
|
72
|
+
|
|
73
|
+
for (let i = 0; i < emails.length; i++) {
|
|
74
|
+
await smtpClient.sendMail(emails[i]);
|
|
75
|
+
console.log(`Email ${i + 1} sent successfully`);
|
|
76
|
+
|
|
77
|
+
// Small delay between emails
|
|
78
|
+
await new Promise(resolve => setTimeout(resolve, 500));
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
console.log('All emails sent successfully');
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
tap.test('CCMD-09: Rapid email sending', async () => {
|
|
85
|
+
// Test rapid email sending without delays
|
|
86
|
+
// Internal connection management should handle this properly
|
|
87
|
+
|
|
88
|
+
const emailCount = 10;
|
|
89
|
+
const emails = [];
|
|
90
|
+
|
|
91
|
+
for (let i = 0; i < emailCount; i++) {
|
|
92
|
+
emails.push(new Email({
|
|
93
|
+
from: 'sender@example.com',
|
|
94
|
+
to: ['recipient@example.com'],
|
|
95
|
+
subject: `Rapid email ${i + 1}`,
|
|
96
|
+
text: `Rapid fire email number ${i + 1}`
|
|
97
|
+
}));
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
console.log(`Sending ${emailCount} emails rapidly...`);
|
|
101
|
+
const startTime = Date.now();
|
|
102
|
+
|
|
103
|
+
// Send all emails as fast as possible
|
|
104
|
+
for (const email of emails) {
|
|
105
|
+
await smtpClient.sendMail(email);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const elapsed = Date.now() - startTime;
|
|
109
|
+
console.log(`All ${emailCount} emails sent in ${elapsed}ms`);
|
|
110
|
+
console.log(`Average: ${(elapsed / emailCount).toFixed(2)}ms per email`);
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
tap.test('CCMD-09: Long-lived connection test', async () => {
|
|
114
|
+
// Test that connection stays alive over extended period
|
|
115
|
+
// SmtpClient should use internal keepalive mechanisms
|
|
116
|
+
|
|
117
|
+
console.log('Testing connection over 10 seconds with periodic emails...');
|
|
118
|
+
|
|
119
|
+
const testDuration = 10000;
|
|
120
|
+
const emailInterval = 2500;
|
|
121
|
+
const iterations = Math.floor(testDuration / emailInterval);
|
|
122
|
+
|
|
123
|
+
for (let i = 0; i < iterations; i++) {
|
|
124
|
+
const email = new Email({
|
|
125
|
+
from: 'sender@example.com',
|
|
126
|
+
to: ['recipient@example.com'],
|
|
127
|
+
subject: `Keepalive test ${i + 1}`,
|
|
128
|
+
text: `Testing connection keepalive - email ${i + 1}`
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
const startTime = Date.now();
|
|
132
|
+
await smtpClient.sendMail(email);
|
|
133
|
+
const elapsed = Date.now() - startTime;
|
|
134
|
+
|
|
135
|
+
console.log(`Email ${i + 1} sent in ${elapsed}ms`);
|
|
136
|
+
|
|
137
|
+
if (i < iterations - 1) {
|
|
138
|
+
await new Promise(resolve => setTimeout(resolve, emailInterval));
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
console.log('Connection remained stable over 10 seconds');
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
tap.test('CCMD-09: Connection pooling behavior', async () => {
|
|
146
|
+
// Test connection pooling with different email patterns
|
|
147
|
+
// Internal NOOP may be used to maintain pool connections
|
|
148
|
+
|
|
149
|
+
const testPatterns = [
|
|
150
|
+
{ count: 3, delay: 0, desc: 'Burst of 3 emails' },
|
|
151
|
+
{ count: 2, delay: 1000, desc: '2 emails with 1s delay' },
|
|
152
|
+
{ count: 1, delay: 3000, desc: '1 email after 3s delay' }
|
|
153
|
+
];
|
|
154
|
+
|
|
155
|
+
for (const pattern of testPatterns) {
|
|
156
|
+
console.log(`\nTesting: ${pattern.desc}`);
|
|
157
|
+
|
|
158
|
+
if (pattern.delay > 0) {
|
|
159
|
+
await new Promise(resolve => setTimeout(resolve, pattern.delay));
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
for (let i = 0; i < pattern.count; i++) {
|
|
163
|
+
const email = new Email({
|
|
164
|
+
from: 'sender@example.com',
|
|
165
|
+
to: ['recipient@example.com'],
|
|
166
|
+
subject: `${pattern.desc} - Email ${i + 1}`,
|
|
167
|
+
text: 'Testing connection pooling behavior'
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
await smtpClient.sendMail(email);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
console.log(`Completed: ${pattern.desc}`);
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
tap.test('CCMD-09: Email sending performance', async () => {
|
|
178
|
+
// Measure email sending performance
|
|
179
|
+
// Connection management (including internal NOOP) affects timing
|
|
180
|
+
|
|
181
|
+
const measurements = 20;
|
|
182
|
+
const times: number[] = [];
|
|
183
|
+
|
|
184
|
+
console.log(`Measuring performance over ${measurements} emails...`);
|
|
185
|
+
|
|
186
|
+
for (let i = 0; i < measurements; i++) {
|
|
187
|
+
const email = new Email({
|
|
188
|
+
from: 'sender@example.com',
|
|
189
|
+
to: ['recipient@example.com'],
|
|
190
|
+
subject: `Performance test ${i + 1}`,
|
|
191
|
+
text: 'Measuring email sending performance'
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
const startTime = Date.now();
|
|
195
|
+
await smtpClient.sendMail(email);
|
|
196
|
+
const elapsed = Date.now() - startTime;
|
|
197
|
+
times.push(elapsed);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// Calculate statistics
|
|
201
|
+
const avgTime = times.reduce((a, b) => a + b, 0) / times.length;
|
|
202
|
+
const minTime = Math.min(...times);
|
|
203
|
+
const maxTime = Math.max(...times);
|
|
204
|
+
|
|
205
|
+
// Calculate standard deviation
|
|
206
|
+
const variance = times.reduce((sum, time) => sum + Math.pow(time - avgTime, 2), 0) / times.length;
|
|
207
|
+
const stdDev = Math.sqrt(variance);
|
|
208
|
+
|
|
209
|
+
console.log(`\nPerformance analysis (${measurements} emails):`);
|
|
210
|
+
console.log(` Average: ${avgTime.toFixed(2)}ms`);
|
|
211
|
+
console.log(` Min: ${minTime}ms`);
|
|
212
|
+
console.log(` Max: ${maxTime}ms`);
|
|
213
|
+
console.log(` Std Dev: ${stdDev.toFixed(2)}ms`);
|
|
214
|
+
|
|
215
|
+
// First email might be slower due to connection establishment
|
|
216
|
+
const avgWithoutFirst = times.slice(1).reduce((a, b) => a + b, 0) / (times.length - 1);
|
|
217
|
+
console.log(` Average (excl. first): ${avgWithoutFirst.toFixed(2)}ms`);
|
|
218
|
+
|
|
219
|
+
// Performance should be reasonable
|
|
220
|
+
expect(avgTime).toBeLessThan(200);
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
tap.test('CCMD-09: Email with NOOP in content', async () => {
|
|
224
|
+
// Test that NOOP as email content doesn't affect delivery
|
|
225
|
+
const email = new Email({
|
|
226
|
+
from: 'sender@example.com',
|
|
227
|
+
to: ['recipient@example.com'],
|
|
228
|
+
subject: 'Email containing NOOP',
|
|
229
|
+
text: `This email contains SMTP commands as content:
|
|
230
|
+
|
|
231
|
+
NOOP
|
|
232
|
+
HELO test
|
|
233
|
+
MAIL FROM:<test@example.com>
|
|
234
|
+
|
|
235
|
+
These should be treated as plain text, not commands.
|
|
236
|
+
The word NOOP appears multiple times in this email.
|
|
237
|
+
|
|
238
|
+
NOOP is used internally by SMTP for keepalive.`
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
await smtpClient.sendMail(email);
|
|
242
|
+
console.log('Email with NOOP content sent successfully');
|
|
243
|
+
|
|
244
|
+
// Send another email to verify connection still works
|
|
245
|
+
const email2 = new Email({
|
|
246
|
+
from: 'sender@example.com',
|
|
247
|
+
to: ['recipient@example.com'],
|
|
248
|
+
subject: 'Follow-up email',
|
|
249
|
+
text: 'Verifying connection still works after NOOP content'
|
|
250
|
+
});
|
|
251
|
+
|
|
252
|
+
await smtpClient.sendMail(email2);
|
|
253
|
+
console.log('Follow-up email sent successfully');
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
tap.test('CCMD-09: Concurrent email sending', async () => {
|
|
257
|
+
// Test concurrent email sending
|
|
258
|
+
// Connection pooling and internal management should handle this
|
|
259
|
+
|
|
260
|
+
const concurrentCount = 5;
|
|
261
|
+
const emails = [];
|
|
262
|
+
|
|
263
|
+
for (let i = 0; i < concurrentCount; i++) {
|
|
264
|
+
emails.push(new Email({
|
|
265
|
+
from: 'sender@example.com',
|
|
266
|
+
to: [`recipient${i}@example.com`],
|
|
267
|
+
subject: `Concurrent email ${i + 1}`,
|
|
268
|
+
text: `Testing concurrent email sending - message ${i + 1}`
|
|
269
|
+
}));
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
console.log(`Sending ${concurrentCount} emails concurrently...`);
|
|
273
|
+
const startTime = Date.now();
|
|
274
|
+
|
|
275
|
+
// Send all emails concurrently
|
|
276
|
+
try {
|
|
277
|
+
await Promise.all(emails.map(email => smtpClient.sendMail(email)));
|
|
278
|
+
const elapsed = Date.now() - startTime;
|
|
279
|
+
console.log(`All ${concurrentCount} emails sent concurrently in ${elapsed}ms`);
|
|
280
|
+
} catch (error) {
|
|
281
|
+
// Concurrent sending might not be supported - that's OK
|
|
282
|
+
console.log('Concurrent sending not supported, falling back to sequential');
|
|
283
|
+
for (const email of emails) {
|
|
284
|
+
await smtpClient.sendMail(email);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
});
|
|
288
|
+
|
|
289
|
+
tap.test('CCMD-09: Connection recovery test', async () => {
|
|
290
|
+
// Test connection recovery and error handling
|
|
291
|
+
// SmtpClient should handle connection issues gracefully
|
|
292
|
+
|
|
293
|
+
// Create a new client with shorter timeouts for testing
|
|
294
|
+
const testClient = createSmtpClient({
|
|
295
|
+
host: testServer.hostname,
|
|
296
|
+
port: testServer.port,
|
|
297
|
+
secure: false,
|
|
298
|
+
connectionTimeout: 3000,
|
|
299
|
+
socketTimeout: 3000
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
// Send initial email
|
|
303
|
+
const email1 = new Email({
|
|
304
|
+
from: 'sender@example.com',
|
|
305
|
+
to: ['recipient@example.com'],
|
|
306
|
+
subject: 'Connection test 1',
|
|
307
|
+
text: 'Testing initial connection'
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
await testClient.sendMail(email1);
|
|
311
|
+
console.log('Initial email sent');
|
|
312
|
+
|
|
313
|
+
// Simulate long delay that might timeout connection
|
|
314
|
+
console.log('Waiting 5 seconds to test connection recovery...');
|
|
315
|
+
await new Promise(resolve => setTimeout(resolve, 5000));
|
|
316
|
+
|
|
317
|
+
// Try to send another email - client should recover if needed
|
|
318
|
+
const email2 = new Email({
|
|
319
|
+
from: 'sender@example.com',
|
|
320
|
+
to: ['recipient@example.com'],
|
|
321
|
+
subject: 'Connection test 2',
|
|
322
|
+
text: 'Testing connection recovery'
|
|
323
|
+
});
|
|
324
|
+
|
|
325
|
+
try {
|
|
326
|
+
await testClient.sendMail(email2);
|
|
327
|
+
console.log('Email sent successfully after delay - connection recovered');
|
|
328
|
+
} catch (error) {
|
|
329
|
+
console.log('Connection recovery failed (this might be expected):', error.message);
|
|
330
|
+
}
|
|
331
|
+
});
|
|
332
|
+
|
|
333
|
+
tap.test('cleanup test SMTP server', async () => {
|
|
334
|
+
if (testServer) {
|
|
335
|
+
await stopTestServer(testServer);
|
|
336
|
+
}
|
|
337
|
+
});
|
|
338
|
+
|
|
339
|
+
export default tap.start();
|