Comparing version 0.1.0-alpha.12 to 0.1.0-alpha.13
@@ -106,6 +106,6 @@ 'use strict'; | ||
} | ||
client.send({ | ||
plugins.handler.runHooks('queue:release', [client.zone, data], () => client.send({ | ||
req: data.req, | ||
response | ||
}); | ||
})); | ||
}); | ||
@@ -217,2 +217,3 @@ | ||
delivery._lock = req._lock; | ||
zone.releaseDelivery(delivery, err => { | ||
@@ -219,0 +220,0 @@ if (err) { |
@@ -127,4 +127,10 @@ 'use strict'; | ||
log.info('Sender/' + this.zone.name + '/' + process.pid, '%s.%s ACCEPTED to=%s mx=%s (%s)', delivery.id, delivery.seq, delivery.recipient, connection.options.servername, this.formatSMTPResponse(info.response)); | ||
log.info('Sender/' + this.zone.name + '/' + process.pid, '%s.%s ACCEPTED to=%s mx=%s (%s)', delivery.id, delivery.seq, delivery.recipient, connection.options.servername || delivery.domain, this.formatSMTPResponse(info.response)); | ||
delivery.status = { | ||
delivered: true, | ||
mx: connection.options.servername || delivery.domain, | ||
response: this.formatSMTPResponse(info.response) | ||
}; | ||
this.releaseDelivery(delivery, err => { | ||
@@ -149,7 +155,8 @@ if (err) { | ||
handleResponseError(delivery, connection, err, callback) { | ||
let bounce; | ||
let maxDeferred = 6; | ||
let bounce = bounces.check(err.response); | ||
let deferredCount = delivery._deferred && delivery._deferred.count || 0; | ||
let smtpResponse = this.formatSMTPResponse(err.response || err.message); | ||
if ((bounce = bounces.check(err.response)).action !== 'reject' || deferredCount > 6) { | ||
if (bounce.action !== 'reject' && deferredCount < maxDeferred) { | ||
let ttl = Math.min(Math.pow(5, deferredCount + 1), 1024) * 60 * 1000; | ||
@@ -171,2 +178,8 @@ | ||
delivery.status = { | ||
delivered: false, | ||
mx: connection.options.servername || delivery.domain, | ||
response: smtpResponse | ||
}; | ||
return this.releaseDelivery(delivery, err => { | ||
@@ -363,2 +376,3 @@ if (err) { | ||
seq: delivery.seq, | ||
status: delivery.status, | ||
_lock: delivery._lock | ||
@@ -365,0 +379,0 @@ }, (err, updated) => { |
{ | ||
"name": "zone-mta", | ||
"private": false, | ||
"version": "0.1.0-alpha.12", | ||
"version": "0.1.0-alpha.13", | ||
"description": "Tiny outbound MTA", | ||
@@ -6,0 +6,0 @@ "main": "app.js", |
@@ -88,2 +88,3 @@ # ZoneMTA plugins | ||
- **'queue:bounce'** with arguments `bounce` called when a message bounced and is no longer queued for delivery | ||
- **'queue:release'** with arguments `zone`, `data` called when a message was removed from the queue | ||
@@ -90,0 +91,0 @@ **'sender' context** |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
300223
5918