Proxy for SMTP (#5371)
This commit is contained in:
parent
96b2267cb8
commit
593c2b9517
3 changed files with 11 additions and 0 deletions
|
@ -130,3 +130,11 @@ autoAdmin: true
|
|||
#syslog:
|
||||
# host: localhost
|
||||
# port: 514
|
||||
|
||||
# Proxy for HTTP/HTTPS
|
||||
#proxy: http://127.0.0.1:3128
|
||||
|
||||
# Proxy for SMTP/SMTPS
|
||||
#proxySmtp: http://127.0.0.1:3128 # use HTTP/1.1 CONNECT
|
||||
#proxySmtp: socks4://127.0.0.1:1080 # use SOCKS4
|
||||
#proxySmtp: socks5://127.0.0.1:1080 # use SOCKS5
|
||||
|
|
|
@ -34,6 +34,7 @@ export type Source = {
|
|||
autoAdmin?: boolean;
|
||||
|
||||
proxy?: string;
|
||||
proxySmtp?: string;
|
||||
|
||||
accesslog?: string;
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import * as nodemailer from 'nodemailer';
|
||||
import { fetchMeta } from '../misc/fetch-meta';
|
||||
import Logger from './logger';
|
||||
import config from '../config';
|
||||
|
||||
export const logger = new Logger('email');
|
||||
|
||||
|
@ -14,6 +15,7 @@ export async function sendEmail(to: string, subject: string, text: string) {
|
|||
port: meta.smtpPort,
|
||||
secure: meta.smtpSecure,
|
||||
ignoreTLS: !enableAuth,
|
||||
proxy: config.proxySmtp,
|
||||
auth: enableAuth ? {
|
||||
user: meta.smtpUser,
|
||||
pass: meta.smtpPass
|
||||
|
|
Loading…
Reference in a new issue