This commit is contained in:
MeiMei 2018-11-30 00:35:17 +09:00 committed by syuilo
parent 89047fd66d
commit 683a85ecc0
1 changed files with 4 additions and 2 deletions

View File

@ -69,12 +69,14 @@ export default define(meta, (ps, user) => new Promise(async (res, rej) => {
const meta = await fetchMeta(); const meta = await fetchMeta();
const enableAuth = meta.smtpUser != null && meta.smtpUser !== '';
const transporter = nodemailer.createTransport({ const transporter = nodemailer.createTransport({
host: meta.smtpHost, host: meta.smtpHost,
port: meta.smtpPort, port: meta.smtpPort,
secure: meta.smtpSecure, secure: meta.smtpSecure,
ignoreTLS: true, ignoreTLS: !enableAuth,
auth: meta.smtpUser != null ? { auth: enableAuth ? {
user: meta.smtpUser, user: meta.smtpUser,
pass: meta.smtpPass pass: meta.smtpPass
} : undefined } : undefined