mirror of
https://github.com/nodemailer/wildduck.git
synced 2025-09-08 14:15:40 +08:00
sppress HOSTUNREACH
This commit is contained in:
parent
8ffa4808f4
commit
0d9d44a257
4 changed files with 14 additions and 8 deletions
|
@ -261,12 +261,13 @@ class IMAPConnection extends EventEmitter {
|
|||
if (err.processed) {
|
||||
return;
|
||||
}
|
||||
if (err.code === 'ECONNRESET' || err.code === 'EPIPE' || err.code === 'ETIMEDOUT') {
|
||||
|
||||
if (['ECONNRESET', 'EPIPE', 'ETIMEDOUT', 'EHOSTUNREACH'].includes(err.code)) {
|
||||
this.close(); // mark connection as 'closing'
|
||||
return;
|
||||
}
|
||||
|
||||
if (err && /SSL23_GET_CLIENT_HELLO|ssl3_get_client_hello/i.test(err.message)) {
|
||||
if (err && /SSL[23]*_GET_CLIENT_HELLO/i.test(err.message)) {
|
||||
let message = err.message;
|
||||
err.message = 'Failed to establish TLS session';
|
||||
err.meta = {
|
||||
|
@ -276,7 +277,8 @@ class IMAPConnection extends EventEmitter {
|
|||
remoteAddress: this.remoteAddress
|
||||
};
|
||||
}
|
||||
if (!err) {
|
||||
|
||||
if (!err || !err.message) {
|
||||
err = new Error('Socket closed unexpectedly');
|
||||
err.meta = {
|
||||
remoteAddress: this.remoteAddress
|
||||
|
|
|
@ -436,8 +436,9 @@ class IRCConnection extends EventEmitter {
|
|||
* @param {Error} err Error object
|
||||
*/
|
||||
_onError(err) {
|
||||
if (err.code === 'ECONNRESET' || err.code === 'EPIPE' || err.code === 'ETIMEDOUT') {
|
||||
return this.close(); // mark connection as 'closing'
|
||||
if (['ECONNRESET', 'EPIPE', 'ETIMEDOUT', 'EHOSTUNREACH'].includes(err.code)) {
|
||||
this.close(); // mark connection as 'closing'
|
||||
return;
|
||||
}
|
||||
|
||||
this.server.logger.error(
|
||||
|
|
|
@ -118,8 +118,9 @@ class POP3Connection extends EventEmitter {
|
|||
* @param {Error} err Error object
|
||||
*/
|
||||
_onError(err) {
|
||||
if (err.code === 'ECONNRESET' || err.code === 'EPIPE' || err.code === 'ETIMEDOUT') {
|
||||
return this.close(); // mark connection as 'closing'
|
||||
if (['ECONNRESET', 'EPIPE', 'ETIMEDOUT', 'EHOSTUNREACH'].includes(err.code)) {
|
||||
this.close(); // mark connection as 'closing'
|
||||
return;
|
||||
}
|
||||
|
||||
this._server.logger.error(
|
||||
|
|
|
@ -72,7 +72,8 @@ class POP3Server extends EventEmitter {
|
|||
return;
|
||||
}
|
||||
returned = true;
|
||||
if (err && /SSL23_GET_CLIENT_HELLO|ssl3_get_client_hello/i.test(err.message)) {
|
||||
|
||||
if (err && /SSL[23]*_GET_CLIENT_HELLO/i.test(err.message)) {
|
||||
let message = err.message;
|
||||
err.message = 'Failed to establish TLS session on connection';
|
||||
err.meta = {
|
||||
|
@ -82,6 +83,7 @@ class POP3Server extends EventEmitter {
|
|||
remoteAddress
|
||||
};
|
||||
}
|
||||
|
||||
if (!err || !err.message) {
|
||||
err = new Error('Socket closed while initiating TLS');
|
||||
err.meta = {
|
||||
|
|
Loading…
Add table
Reference in a new issue