fix(Email Trigger (IMAP) Node): improve connection handling and credentials (#4393)

* adds EmailReadImapV2 with fixes
This commit is contained in:
Michael Auerswald
2022-10-24 11:06:43 +02:00
committed by GitHub
parent 779b0d58f7
commit 1a37f0003f
4 changed files with 1326 additions and 609 deletions

View File

@@ -38,5 +38,32 @@ export class Imap implements ICredentialType {
type: 'boolean',
default: true,
},
{
displayName: 'Allow Self-Signed Certificates',
name: 'allowUnauthorizedCerts',
type: 'boolean',
description: 'Whether to connect even if SSL certificate validation is not possible',
default: false,
},
];
}
export interface ICredentialsDataImap {
host: string;
port: number;
user: string;
password: string;
secure: boolean;
allowUnauthorizedCerts: boolean;
}
export function isCredentialsDataImap(candidate: unknown): candidate is ICredentialsDataImap {
const o = candidate as ICredentialsDataImap;
return (
o.host !== undefined &&
o.password !== undefined &&
o.port !== undefined &&
o.secure !== undefined &&
o.user !== undefined
);
}