mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-11 04:47:29 -08:00
fix(EmailReadImap Node): Improve handling of network problems (#3406)
* ⚡ fix * ⚡ tlsOptions fix
This commit is contained in:
parent
732c8fcf84
commit
6f5809edb3
|
@ -433,10 +433,18 @@ export class EmailReadImap implements INodeType {
|
|||
},
|
||||
};
|
||||
|
||||
const tlsOptions: IDataObject = {};
|
||||
|
||||
if (options.allowUnauthorizedCerts === true) {
|
||||
config.imap.tlsOptions = {
|
||||
rejectUnauthorized: false,
|
||||
};
|
||||
tlsOptions.rejectUnauthorized = false;
|
||||
}
|
||||
|
||||
if (credentials.secure) {
|
||||
tlsOptions.servername = credentials.host as string;
|
||||
}
|
||||
|
||||
if (!_.isEmpty(tlsOptions)) {
|
||||
config.imap.tlsOptions = tlsOptions;
|
||||
}
|
||||
|
||||
// Connect to the IMAP server and open the mailbox
|
||||
|
@ -456,9 +464,8 @@ export class EmailReadImap implements INodeType {
|
|||
}
|
||||
} else {
|
||||
Logger.error('Email Read Imap node encountered a connection error', { error });
|
||||
this.emitError(error);
|
||||
}
|
||||
|
||||
this.emitError(error);
|
||||
});
|
||||
return conn;
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue