@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,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SMTP Client Constants and Error Codes
|
|
3
|
+
* All constants, error codes, and enums for SMTP client operations
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* SMTP response codes
|
|
8
|
+
*/
|
|
9
|
+
export const SMTP_CODES = {
|
|
10
|
+
// Positive completion replies
|
|
11
|
+
SERVICE_READY: 220,
|
|
12
|
+
SERVICE_CLOSING: 221,
|
|
13
|
+
AUTHENTICATION_SUCCESSFUL: 235,
|
|
14
|
+
REQUESTED_ACTION_OK: 250,
|
|
15
|
+
USER_NOT_LOCAL: 251,
|
|
16
|
+
CANNOT_VERIFY_USER: 252,
|
|
17
|
+
|
|
18
|
+
// Positive intermediate replies
|
|
19
|
+
START_MAIL_INPUT: 354,
|
|
20
|
+
|
|
21
|
+
// Transient negative completion replies
|
|
22
|
+
SERVICE_NOT_AVAILABLE: 421,
|
|
23
|
+
MAILBOX_BUSY: 450,
|
|
24
|
+
LOCAL_ERROR: 451,
|
|
25
|
+
INSUFFICIENT_STORAGE: 452,
|
|
26
|
+
UNABLE_TO_ACCOMMODATE: 455,
|
|
27
|
+
|
|
28
|
+
// Permanent negative completion replies
|
|
29
|
+
SYNTAX_ERROR: 500,
|
|
30
|
+
SYNTAX_ERROR_PARAMETERS: 501,
|
|
31
|
+
COMMAND_NOT_IMPLEMENTED: 502,
|
|
32
|
+
BAD_SEQUENCE: 503,
|
|
33
|
+
PARAMETER_NOT_IMPLEMENTED: 504,
|
|
34
|
+
MAILBOX_UNAVAILABLE: 550,
|
|
35
|
+
USER_NOT_LOCAL_TRY_FORWARD: 551,
|
|
36
|
+
EXCEEDED_STORAGE: 552,
|
|
37
|
+
MAILBOX_NAME_NOT_ALLOWED: 553,
|
|
38
|
+
TRANSACTION_FAILED: 554
|
|
39
|
+
} as const;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* SMTP command names
|
|
43
|
+
*/
|
|
44
|
+
export const SMTP_COMMANDS = {
|
|
45
|
+
HELO: 'HELO',
|
|
46
|
+
EHLO: 'EHLO',
|
|
47
|
+
MAIL_FROM: 'MAIL FROM',
|
|
48
|
+
RCPT_TO: 'RCPT TO',
|
|
49
|
+
DATA: 'DATA',
|
|
50
|
+
RSET: 'RSET',
|
|
51
|
+
NOOP: 'NOOP',
|
|
52
|
+
QUIT: 'QUIT',
|
|
53
|
+
STARTTLS: 'STARTTLS',
|
|
54
|
+
AUTH: 'AUTH'
|
|
55
|
+
} as const;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Authentication methods
|
|
59
|
+
*/
|
|
60
|
+
export const AUTH_METHODS = {
|
|
61
|
+
PLAIN: 'PLAIN',
|
|
62
|
+
LOGIN: 'LOGIN',
|
|
63
|
+
OAUTH2: 'XOAUTH2',
|
|
64
|
+
CRAM_MD5: 'CRAM-MD5'
|
|
65
|
+
} as const;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Common SMTP extensions
|
|
69
|
+
*/
|
|
70
|
+
export const SMTP_EXTENSIONS = {
|
|
71
|
+
PIPELINING: 'PIPELINING',
|
|
72
|
+
SIZE: 'SIZE',
|
|
73
|
+
STARTTLS: 'STARTTLS',
|
|
74
|
+
AUTH: 'AUTH',
|
|
75
|
+
EIGHT_BIT_MIME: '8BITMIME',
|
|
76
|
+
CHUNKING: 'CHUNKING',
|
|
77
|
+
ENHANCED_STATUS_CODES: 'ENHANCEDSTATUSCODES',
|
|
78
|
+
DSN: 'DSN'
|
|
79
|
+
} as const;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Default configuration values
|
|
83
|
+
*/
|
|
84
|
+
export const DEFAULTS = {
|
|
85
|
+
CONNECTION_TIMEOUT: 60000, // 60 seconds
|
|
86
|
+
SOCKET_TIMEOUT: 300000, // 5 minutes
|
|
87
|
+
COMMAND_TIMEOUT: 30000, // 30 seconds
|
|
88
|
+
MAX_CONNECTIONS: 5,
|
|
89
|
+
MAX_MESSAGES: 100,
|
|
90
|
+
PORT_SMTP: 25,
|
|
91
|
+
PORT_SUBMISSION: 587,
|
|
92
|
+
PORT_SMTPS: 465,
|
|
93
|
+
RETRY_ATTEMPTS: 3,
|
|
94
|
+
RETRY_DELAY: 1000,
|
|
95
|
+
POOL_IDLE_TIMEOUT: 30000 // 30 seconds
|
|
96
|
+
} as const;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Error types for classification
|
|
100
|
+
*/
|
|
101
|
+
export enum SmtpErrorType {
|
|
102
|
+
CONNECTION_ERROR = 'CONNECTION_ERROR',
|
|
103
|
+
AUTHENTICATION_ERROR = 'AUTHENTICATION_ERROR',
|
|
104
|
+
PROTOCOL_ERROR = 'PROTOCOL_ERROR',
|
|
105
|
+
TIMEOUT_ERROR = 'TIMEOUT_ERROR',
|
|
106
|
+
TLS_ERROR = 'TLS_ERROR',
|
|
107
|
+
SYNTAX_ERROR = 'SYNTAX_ERROR',
|
|
108
|
+
MAILBOX_ERROR = 'MAILBOX_ERROR',
|
|
109
|
+
QUOTA_ERROR = 'QUOTA_ERROR',
|
|
110
|
+
UNKNOWN_ERROR = 'UNKNOWN_ERROR'
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Regular expressions for parsing
|
|
115
|
+
*/
|
|
116
|
+
export const REGEX_PATTERNS = {
|
|
117
|
+
EMAIL_ADDRESS: /^[^\s@]+@[^\s@]+\.[^\s@]+$/,
|
|
118
|
+
RESPONSE_CODE: /^(\d{3})([ -])(.*)/,
|
|
119
|
+
ENHANCED_STATUS: /^(\d\.\d\.\d)\s/,
|
|
120
|
+
AUTH_CAPABILITIES: /AUTH\s+(.+)/i,
|
|
121
|
+
SIZE_EXTENSION: /SIZE\s+(\d+)/i
|
|
122
|
+
} as const;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Line endings and separators
|
|
126
|
+
*/
|
|
127
|
+
export const LINE_ENDINGS = {
|
|
128
|
+
CRLF: '\r\n',
|
|
129
|
+
LF: '\n',
|
|
130
|
+
CR: '\r'
|
|
131
|
+
} as const;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Connection states for internal use
|
|
135
|
+
*/
|
|
136
|
+
export const CONNECTION_STATES = {
|
|
137
|
+
DISCONNECTED: 'disconnected',
|
|
138
|
+
CONNECTING: 'connecting',
|
|
139
|
+
CONNECTED: 'connected',
|
|
140
|
+
AUTHENTICATED: 'authenticated',
|
|
141
|
+
READY: 'ready',
|
|
142
|
+
BUSY: 'busy',
|
|
143
|
+
CLOSING: 'closing',
|
|
144
|
+
ERROR: 'error'
|
|
145
|
+
} as const;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SMTP Client Factory
|
|
3
|
+
* Factory function for client creation and dependency injection
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { SmtpClient } from './smtp-client.js';
|
|
7
|
+
import { ConnectionManager } from './connection-manager.js';
|
|
8
|
+
import { CommandHandler } from './command-handler.js';
|
|
9
|
+
import { AuthHandler } from './auth-handler.js';
|
|
10
|
+
import { TlsHandler } from './tls-handler.js';
|
|
11
|
+
import { SmtpErrorHandler } from './error-handler.js';
|
|
12
|
+
import type { ISmtpClientOptions } from './interfaces.js';
|
|
13
|
+
import { validateClientOptions } from './utils/validation.js';
|
|
14
|
+
import { DEFAULTS } from './constants.js';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Create a complete SMTP client with all components
|
|
18
|
+
*/
|
|
19
|
+
export function createSmtpClient(options: ISmtpClientOptions): SmtpClient {
|
|
20
|
+
// Validate options
|
|
21
|
+
const errors = validateClientOptions(options);
|
|
22
|
+
if (errors.length > 0) {
|
|
23
|
+
throw new Error(`Invalid client options: ${errors.join(', ')}`);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Apply defaults
|
|
27
|
+
const clientOptions: ISmtpClientOptions = {
|
|
28
|
+
connectionTimeout: DEFAULTS.CONNECTION_TIMEOUT,
|
|
29
|
+
socketTimeout: DEFAULTS.SOCKET_TIMEOUT,
|
|
30
|
+
maxConnections: DEFAULTS.MAX_CONNECTIONS,
|
|
31
|
+
maxMessages: DEFAULTS.MAX_MESSAGES,
|
|
32
|
+
pool: false,
|
|
33
|
+
secure: false,
|
|
34
|
+
debug: false,
|
|
35
|
+
...options
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
// Create handlers
|
|
39
|
+
const errorHandler = new SmtpErrorHandler(clientOptions);
|
|
40
|
+
const connectionManager = new ConnectionManager(clientOptions);
|
|
41
|
+
const commandHandler = new CommandHandler(clientOptions);
|
|
42
|
+
const authHandler = new AuthHandler(clientOptions, commandHandler);
|
|
43
|
+
const tlsHandler = new TlsHandler(clientOptions, commandHandler);
|
|
44
|
+
|
|
45
|
+
// Create and return SMTP client
|
|
46
|
+
return new SmtpClient({
|
|
47
|
+
options: clientOptions,
|
|
48
|
+
connectionManager,
|
|
49
|
+
commandHandler,
|
|
50
|
+
authHandler,
|
|
51
|
+
tlsHandler,
|
|
52
|
+
errorHandler
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Create SMTP client with connection pooling enabled
|
|
58
|
+
*/
|
|
59
|
+
export function createPooledSmtpClient(options: ISmtpClientOptions): SmtpClient {
|
|
60
|
+
return createSmtpClient({
|
|
61
|
+
...options,
|
|
62
|
+
pool: true,
|
|
63
|
+
maxConnections: options.maxConnections || DEFAULTS.MAX_CONNECTIONS,
|
|
64
|
+
maxMessages: options.maxMessages || DEFAULTS.MAX_MESSAGES
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Create SMTP client for high-volume sending
|
|
70
|
+
*/
|
|
71
|
+
export function createBulkSmtpClient(options: ISmtpClientOptions): SmtpClient {
|
|
72
|
+
return createSmtpClient({
|
|
73
|
+
...options,
|
|
74
|
+
pool: true,
|
|
75
|
+
maxConnections: Math.max(options.maxConnections || 10, 10),
|
|
76
|
+
maxMessages: Math.max(options.maxMessages || 1000, 1000),
|
|
77
|
+
connectionTimeout: options.connectionTimeout || 30000,
|
|
78
|
+
socketTimeout: options.socketTimeout || 120000
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Create SMTP client for transactional emails
|
|
84
|
+
*/
|
|
85
|
+
export function createTransactionalSmtpClient(options: ISmtpClientOptions): SmtpClient {
|
|
86
|
+
return createSmtpClient({
|
|
87
|
+
...options,
|
|
88
|
+
pool: false, // Use fresh connections for transactional emails
|
|
89
|
+
maxConnections: 1,
|
|
90
|
+
maxMessages: 1,
|
|
91
|
+
connectionTimeout: options.connectionTimeout || 10000,
|
|
92
|
+
socketTimeout: options.socketTimeout || 30000
|
|
93
|
+
});
|
|
94
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SMTP Client Error Handler
|
|
3
|
+
* Error classification and recovery strategies
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { SmtpErrorType } from './constants.js';
|
|
7
|
+
import type { ISmtpResponse, ISmtpErrorContext, ISmtpClientOptions } from './interfaces.js';
|
|
8
|
+
import { logDebug } from './utils/logging.js';
|
|
9
|
+
|
|
10
|
+
export class SmtpErrorHandler {
|
|
11
|
+
private options: ISmtpClientOptions;
|
|
12
|
+
|
|
13
|
+
constructor(options: ISmtpClientOptions) {
|
|
14
|
+
this.options = options;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Classify error type based on response or error
|
|
19
|
+
*/
|
|
20
|
+
public classifyError(error: Error | ISmtpResponse, context?: ISmtpErrorContext): SmtpErrorType {
|
|
21
|
+
logDebug('Classifying error', this.options, { errorMessage: error instanceof Error ? error.message : String(error), context });
|
|
22
|
+
|
|
23
|
+
// Handle Error objects
|
|
24
|
+
if (error instanceof Error) {
|
|
25
|
+
return this.classifyErrorByMessage(error);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Handle SMTP response codes
|
|
29
|
+
if (typeof error === 'object' && 'code' in error) {
|
|
30
|
+
return this.classifyErrorByCode(error.code);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return SmtpErrorType.UNKNOWN_ERROR;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Determine if error is retryable
|
|
38
|
+
*/
|
|
39
|
+
public isRetryable(errorType: SmtpErrorType, response?: ISmtpResponse): boolean {
|
|
40
|
+
switch (errorType) {
|
|
41
|
+
case SmtpErrorType.CONNECTION_ERROR:
|
|
42
|
+
case SmtpErrorType.TIMEOUT_ERROR:
|
|
43
|
+
return true;
|
|
44
|
+
|
|
45
|
+
case SmtpErrorType.PROTOCOL_ERROR:
|
|
46
|
+
// Only retry on temporary failures (4xx codes)
|
|
47
|
+
return response ? response.code >= 400 && response.code < 500 : false;
|
|
48
|
+
|
|
49
|
+
case SmtpErrorType.AUTHENTICATION_ERROR:
|
|
50
|
+
case SmtpErrorType.TLS_ERROR:
|
|
51
|
+
case SmtpErrorType.SYNTAX_ERROR:
|
|
52
|
+
case SmtpErrorType.MAILBOX_ERROR:
|
|
53
|
+
case SmtpErrorType.QUOTA_ERROR:
|
|
54
|
+
return false;
|
|
55
|
+
|
|
56
|
+
default:
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Get retry delay for error type
|
|
63
|
+
*/
|
|
64
|
+
public getRetryDelay(attempt: number, errorType: SmtpErrorType): number {
|
|
65
|
+
const baseDelay = 1000; // 1 second
|
|
66
|
+
const maxDelay = 30000; // 30 seconds
|
|
67
|
+
|
|
68
|
+
// Exponential backoff with jitter
|
|
69
|
+
const delay = Math.min(baseDelay * Math.pow(2, attempt - 1), maxDelay);
|
|
70
|
+
const jitter = Math.random() * 0.1 * delay; // 10% jitter
|
|
71
|
+
|
|
72
|
+
return Math.floor(delay + jitter);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Create enhanced error with context
|
|
77
|
+
*/
|
|
78
|
+
public createError(
|
|
79
|
+
message: string,
|
|
80
|
+
errorType: SmtpErrorType,
|
|
81
|
+
context?: ISmtpErrorContext,
|
|
82
|
+
originalError?: Error
|
|
83
|
+
): Error {
|
|
84
|
+
const error = new Error(message);
|
|
85
|
+
(error as any).type = errorType;
|
|
86
|
+
(error as any).context = context;
|
|
87
|
+
(error as any).originalError = originalError;
|
|
88
|
+
|
|
89
|
+
return error;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
private classifyErrorByMessage(error: Error): SmtpErrorType {
|
|
93
|
+
const message = error.message.toLowerCase();
|
|
94
|
+
|
|
95
|
+
if (message.includes('timeout') || message.includes('etimedout')) {
|
|
96
|
+
return SmtpErrorType.TIMEOUT_ERROR;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if (message.includes('connect') || message.includes('econnrefused') ||
|
|
100
|
+
message.includes('enotfound') || message.includes('enetunreach')) {
|
|
101
|
+
return SmtpErrorType.CONNECTION_ERROR;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (message.includes('tls') || message.includes('ssl') ||
|
|
105
|
+
message.includes('certificate') || message.includes('handshake')) {
|
|
106
|
+
return SmtpErrorType.TLS_ERROR;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (message.includes('auth')) {
|
|
110
|
+
return SmtpErrorType.AUTHENTICATION_ERROR;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return SmtpErrorType.UNKNOWN_ERROR;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
private classifyErrorByCode(code: number): SmtpErrorType {
|
|
117
|
+
if (code >= 500) {
|
|
118
|
+
// Permanent failures
|
|
119
|
+
if (code === 550 || code === 551 || code === 553) {
|
|
120
|
+
return SmtpErrorType.MAILBOX_ERROR;
|
|
121
|
+
}
|
|
122
|
+
if (code === 552) {
|
|
123
|
+
return SmtpErrorType.QUOTA_ERROR;
|
|
124
|
+
}
|
|
125
|
+
if (code === 500 || code === 501 || code === 502 || code === 504) {
|
|
126
|
+
return SmtpErrorType.SYNTAX_ERROR;
|
|
127
|
+
}
|
|
128
|
+
return SmtpErrorType.PROTOCOL_ERROR;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
if (code >= 400) {
|
|
132
|
+
// Temporary failures
|
|
133
|
+
if (code === 450 || code === 451 || code === 452) {
|
|
134
|
+
return SmtpErrorType.QUOTA_ERROR;
|
|
135
|
+
}
|
|
136
|
+
return SmtpErrorType.PROTOCOL_ERROR;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
return SmtpErrorType.UNKNOWN_ERROR;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SMTP Client Module Exports
|
|
3
|
+
* Modular SMTP client implementation for robust email delivery
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
// Main client class and factory
|
|
7
|
+
export * from './smtp-client.js';
|
|
8
|
+
export * from './create-client.js';
|
|
9
|
+
|
|
10
|
+
// Core handlers
|
|
11
|
+
export * from './connection-manager.js';
|
|
12
|
+
export * from './command-handler.js';
|
|
13
|
+
export * from './auth-handler.js';
|
|
14
|
+
export * from './tls-handler.js';
|
|
15
|
+
export * from './error-handler.js';
|
|
16
|
+
|
|
17
|
+
// Interfaces and types
|
|
18
|
+
export * from './interfaces.js';
|
|
19
|
+
export * from './constants.js';
|
|
20
|
+
|
|
21
|
+
// Utilities
|
|
22
|
+
export * from './utils/validation.js';
|
|
23
|
+
export * from './utils/logging.js';
|
|
24
|
+
export * from './utils/helpers.js';
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SMTP Client Interfaces and Types
|
|
3
|
+
* All interface definitions for the modular SMTP client
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type * as tls from 'node:tls';
|
|
7
|
+
import type * as net from 'node:net';
|
|
8
|
+
import type { Email } from '../../core/classes.email.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* SMTP client connection options
|
|
12
|
+
*/
|
|
13
|
+
export interface ISmtpClientOptions {
|
|
14
|
+
/** Hostname of the SMTP server */
|
|
15
|
+
host: string;
|
|
16
|
+
|
|
17
|
+
/** Port to connect to */
|
|
18
|
+
port: number;
|
|
19
|
+
|
|
20
|
+
/** Whether to use TLS for the connection */
|
|
21
|
+
secure?: boolean;
|
|
22
|
+
|
|
23
|
+
/** Connection timeout in milliseconds */
|
|
24
|
+
connectionTimeout?: number;
|
|
25
|
+
|
|
26
|
+
/** Socket timeout in milliseconds */
|
|
27
|
+
socketTimeout?: number;
|
|
28
|
+
|
|
29
|
+
/** Domain name for EHLO command */
|
|
30
|
+
domain?: string;
|
|
31
|
+
|
|
32
|
+
/** Authentication options */
|
|
33
|
+
auth?: ISmtpAuthOptions;
|
|
34
|
+
|
|
35
|
+
/** TLS options */
|
|
36
|
+
tls?: tls.ConnectionOptions;
|
|
37
|
+
|
|
38
|
+
/** Maximum number of connections in pool */
|
|
39
|
+
pool?: boolean;
|
|
40
|
+
maxConnections?: number;
|
|
41
|
+
maxMessages?: number;
|
|
42
|
+
|
|
43
|
+
/** Enable debug logging */
|
|
44
|
+
debug?: boolean;
|
|
45
|
+
|
|
46
|
+
/** Proxy settings */
|
|
47
|
+
proxy?: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Authentication options for SMTP
|
|
52
|
+
*/
|
|
53
|
+
export interface ISmtpAuthOptions {
|
|
54
|
+
/** Username */
|
|
55
|
+
user?: string;
|
|
56
|
+
|
|
57
|
+
/** Password */
|
|
58
|
+
pass?: string;
|
|
59
|
+
|
|
60
|
+
/** OAuth2 settings */
|
|
61
|
+
oauth2?: IOAuth2Options;
|
|
62
|
+
|
|
63
|
+
/** Authentication method preference */
|
|
64
|
+
method?: 'PLAIN' | 'LOGIN' | 'OAUTH2' | 'AUTO';
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* OAuth2 authentication options
|
|
69
|
+
*/
|
|
70
|
+
export interface IOAuth2Options {
|
|
71
|
+
/** OAuth2 user identifier */
|
|
72
|
+
user: string;
|
|
73
|
+
|
|
74
|
+
/** OAuth2 client ID */
|
|
75
|
+
clientId: string;
|
|
76
|
+
|
|
77
|
+
/** OAuth2 client secret */
|
|
78
|
+
clientSecret: string;
|
|
79
|
+
|
|
80
|
+
/** OAuth2 refresh token */
|
|
81
|
+
refreshToken: string;
|
|
82
|
+
|
|
83
|
+
/** OAuth2 access token */
|
|
84
|
+
accessToken?: string;
|
|
85
|
+
|
|
86
|
+
/** Token expiry time */
|
|
87
|
+
expires?: number;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Result of an email send operation
|
|
92
|
+
*/
|
|
93
|
+
export interface ISmtpSendResult {
|
|
94
|
+
/** Whether the send was successful */
|
|
95
|
+
success: boolean;
|
|
96
|
+
|
|
97
|
+
/** Message ID from server */
|
|
98
|
+
messageId?: string;
|
|
99
|
+
|
|
100
|
+
/** List of accepted recipients */
|
|
101
|
+
acceptedRecipients: string[];
|
|
102
|
+
|
|
103
|
+
/** List of rejected recipients */
|
|
104
|
+
rejectedRecipients: string[];
|
|
105
|
+
|
|
106
|
+
/** Error information if failed */
|
|
107
|
+
error?: Error;
|
|
108
|
+
|
|
109
|
+
/** Server response */
|
|
110
|
+
response?: string;
|
|
111
|
+
|
|
112
|
+
/** Envelope information */
|
|
113
|
+
envelope?: ISmtpEnvelope;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* SMTP envelope information
|
|
118
|
+
*/
|
|
119
|
+
export interface ISmtpEnvelope {
|
|
120
|
+
/** Sender address */
|
|
121
|
+
from: string;
|
|
122
|
+
|
|
123
|
+
/** Recipient addresses */
|
|
124
|
+
to: string[];
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Connection pool status
|
|
129
|
+
*/
|
|
130
|
+
export interface IConnectionPoolStatus {
|
|
131
|
+
/** Total connections in pool */
|
|
132
|
+
total: number;
|
|
133
|
+
|
|
134
|
+
/** Active connections */
|
|
135
|
+
active: number;
|
|
136
|
+
|
|
137
|
+
/** Idle connections */
|
|
138
|
+
idle: number;
|
|
139
|
+
|
|
140
|
+
/** Pending connection requests */
|
|
141
|
+
pending: number;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* SMTP command response
|
|
146
|
+
*/
|
|
147
|
+
export interface ISmtpResponse {
|
|
148
|
+
/** Response code */
|
|
149
|
+
code: number;
|
|
150
|
+
|
|
151
|
+
/** Response message */
|
|
152
|
+
message: string;
|
|
153
|
+
|
|
154
|
+
/** Enhanced status code */
|
|
155
|
+
enhancedCode?: string;
|
|
156
|
+
|
|
157
|
+
/** Raw response */
|
|
158
|
+
raw: string;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Connection state
|
|
163
|
+
*/
|
|
164
|
+
export enum ConnectionState {
|
|
165
|
+
DISCONNECTED = 'disconnected',
|
|
166
|
+
CONNECTING = 'connecting',
|
|
167
|
+
CONNECTED = 'connected',
|
|
168
|
+
AUTHENTICATED = 'authenticated',
|
|
169
|
+
READY = 'ready',
|
|
170
|
+
BUSY = 'busy',
|
|
171
|
+
CLOSING = 'closing',
|
|
172
|
+
ERROR = 'error'
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* SMTP capabilities
|
|
177
|
+
*/
|
|
178
|
+
export interface ISmtpCapabilities {
|
|
179
|
+
/** Supported extensions */
|
|
180
|
+
extensions: Set<string>;
|
|
181
|
+
|
|
182
|
+
/** Maximum message size */
|
|
183
|
+
maxSize?: number;
|
|
184
|
+
|
|
185
|
+
/** Supported authentication methods */
|
|
186
|
+
authMethods: Set<string>;
|
|
187
|
+
|
|
188
|
+
/** Support for pipelining */
|
|
189
|
+
pipelining: boolean;
|
|
190
|
+
|
|
191
|
+
/** Support for STARTTLS */
|
|
192
|
+
starttls: boolean;
|
|
193
|
+
|
|
194
|
+
/** Support for 8BITMIME */
|
|
195
|
+
eightBitMime: boolean;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Internal connection interface
|
|
200
|
+
*/
|
|
201
|
+
export interface ISmtpConnection {
|
|
202
|
+
/** Socket connection */
|
|
203
|
+
socket: net.Socket | tls.TLSSocket;
|
|
204
|
+
|
|
205
|
+
/** Connection state */
|
|
206
|
+
state: ConnectionState;
|
|
207
|
+
|
|
208
|
+
/** Server capabilities */
|
|
209
|
+
capabilities?: ISmtpCapabilities;
|
|
210
|
+
|
|
211
|
+
/** Connection options */
|
|
212
|
+
options: ISmtpClientOptions;
|
|
213
|
+
|
|
214
|
+
/** Whether connection is secure */
|
|
215
|
+
secure: boolean;
|
|
216
|
+
|
|
217
|
+
/** Connection creation time */
|
|
218
|
+
createdAt: Date;
|
|
219
|
+
|
|
220
|
+
/** Last activity time */
|
|
221
|
+
lastActivity: Date;
|
|
222
|
+
|
|
223
|
+
/** Number of messages sent */
|
|
224
|
+
messageCount: number;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Error context for detailed error reporting
|
|
229
|
+
*/
|
|
230
|
+
export interface ISmtpErrorContext {
|
|
231
|
+
/** Command that caused the error */
|
|
232
|
+
command?: string;
|
|
233
|
+
|
|
234
|
+
/** Server response */
|
|
235
|
+
response?: ISmtpResponse;
|
|
236
|
+
|
|
237
|
+
/** Connection state */
|
|
238
|
+
connectionState?: ConnectionState;
|
|
239
|
+
|
|
240
|
+
/** Additional context data */
|
|
241
|
+
data?: Record<string, any>;
|
|
242
|
+
}
|