Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

n8n-3713-node-improvement-emailreadimap-network-problems #3406

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions packages/nodes-base/nodes/EmailReadImap/EmailReadImap.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
});
Expand Down