✨Be able to use SMTP transport without TLS (#406)
This commit is contained in:
@@ -43,12 +43,13 @@ export default class EmailPusherClass
|
|||||||
this.interface = this.configuration.get<string>("email_interface", "");
|
this.interface = this.configuration.get<string>("email_interface", "");
|
||||||
this.platformUrl = this.configuration.get<string>("platform_url", "");
|
this.platformUrl = this.configuration.get<string>("platform_url", "");
|
||||||
if (this.interface === "smtp") {
|
if (this.interface === "smtp") {
|
||||||
|
const useTLS = this.configuration.get<string>("smtp_tls", "false") == "true";
|
||||||
const smtpConfig: SMTPClientConfigType = {
|
const smtpConfig: SMTPClientConfigType = {
|
||||||
host: this.configuration.get<string>("smtp_host", ""),
|
host: this.configuration.get<string>("smtp_host", ""),
|
||||||
port: this.configuration.get<number>("smtp_port", 25),
|
port: this.configuration.get<number>("smtp_port", 25),
|
||||||
secure: false,
|
secure: false,
|
||||||
ignoreTLS: !this.configuration.get<boolean>("smtp_tls", false),
|
ignoreTLS: !useTLS,
|
||||||
requireTLS: this.configuration.get<boolean>("smtp_tls", true),
|
requireTLS: useTLS,
|
||||||
};
|
};
|
||||||
this.logger.info(`Start SMTP client with configuration: ${JSON.stringify(smtpConfig)}`);
|
this.logger.info(`Start SMTP client with configuration: ${JSON.stringify(smtpConfig)}`);
|
||||||
this.transporter = nodemailer.createTransport(smtpConfig);
|
this.transporter = nodemailer.createTransport(smtpConfig);
|
||||||
|
|||||||
Reference in New Issue
Block a user