1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-10-30 14:51:48 +09:00

Proxy for SMTP (#5371)

This commit is contained in:
MeiMei 2019-09-02 04:42:52 +09:00 committed by syuilo
parent 96b2267cb8
commit 593c2b9517
3 changed files with 11 additions and 0 deletions

View File

@ -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

View File

@ -34,6 +34,7 @@ export type Source = {
autoAdmin?: boolean;
proxy?: string;
proxySmtp?: string;
accesslog?: string;

View File

@ -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