Skip to content

Commit

Permalink
v1.0.0-beta.8
Browse files Browse the repository at this point in the history
  • Loading branch information
andris9 committed Jan 11, 2017
1 parent 7f07230 commit c284476
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/sender.js
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ class Sender extends EventEmitter {
err.category = err.category || 'network';
err.logtrail = logtrail;

if ((err.code === 'ETLS' || /SSL23_GET_SERVER_HELLO|\/deps\/openssl/.test(err.message)) && !this.tlsDisabled.has(ip)) {
if ((err.code === 'ETLS' || /SSL23_GET_SERVER_HELLO|\/deps\/openssl/.test(err.message) || err.code === 'ECONNRESET') && !this.tlsDisabled.has(ip)) {
// STARTTLS failed, try again, this time without encryption
log.info('Sender/' + this.zone.name + '/' + process.pid, '%s.%s ERRCONNECT [%s] Failed to connect to %s[%s] using STARTTLS, proceeding with plaintext', delivery.id, delivery.seq, connId, exchange.exchange, ip);
this.tlsDisabled.add(ip);
Expand Down Expand Up @@ -690,7 +690,7 @@ class Sender extends EventEmitter {
}
// still have not returned, this means we have an unexpected connection close
let err = new Error('Unexpected socket close');
if (connection._socket instanceof tls.TLSSocket) {
if (connection._socket instanceof tls.TLSSocket || (connection._socket && connection._socket.upgrading)) {
// todo: edit smtp-connection, add `upgrading` property to better detect
// starttls connection errors
err.code = 'ETLS';
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "zone-mta",
"private": false,
"version": "1.0.0-beta.7",
"version": "1.0.0-beta.8",
"description": "Tiny outbound MTA",
"main": "app.js",
"scripts": {
Expand Down

0 comments on commit c284476

Please sign in to comment.