fix: configuring gmail smtp relay without any authentication
This commit is contained in:
2 files changed
+12
-1
No files matched your search
@@ -96,9 +96,10 @@ class EmailService {
|
||||
systemEmailUser,
|
||||
systemEmailAddress,
|
||||
systemEmailPassword,
|
||||
systemEmailConnectionHost
|
||||
} = await this.settingsService.getDBSettings();
|
||||
|
||||
const emailConfig = {
|
||||
const baseEmailConfig = {
|
||||
host: systemEmailHost,
|
||||
port: systemEmailPort,
|
||||
secure: true,
|
||||
@@ -109,6 +110,15 @@ class EmailService {
|
||||
connectionTimeout: 5000,
|
||||
};
|
||||
|
||||
const emailConfig = systemEmailPort === "465" ? baseEmailConfig : {
|
||||
...baseEmailConfig,
|
||||
name: systemEmailConnectionHost,
|
||||
secure: false,
|
||||
pool: true,
|
||||
tls: { rejectUnauthorized: false },
|
||||
auth: null
|
||||
};
|
||||
|
||||
this.transporter = this.nodemailer.createTransport(emailConfig);
|
||||
|
||||
const buildHtml = async (template, context) => {
|
||||
|
||||
@@ -7,6 +7,7 @@ const envConfig = {
|
||||
systemEmailUser: process.env.SYSTEM_EMAIL_USER,
|
||||
systemEmailAddress: process.env.SYSTEM_EMAIL_ADDRESS,
|
||||
systemEmailPassword: process.env.SYSTEM_EMAIL_PASSWORD,
|
||||
systemEmailConnectionHost: process.env.SYSTEM_EMAIL_CONNECTION_HOST,
|
||||
jwtSecret: process.env.JWT_SECRET,
|
||||
jwtTTL: process.env.TOKEN_TTL,
|
||||
clientHost: process.env.CLIENT_HOST,
|
||||
|
||||
Reference in new issue
Block a user