diff --git a/.config/example.yml b/.config/example.yml index 0a62d5cebd..5c11006655 100644 --- a/.config/example.yml +++ b/.config/example.yml @@ -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 diff --git a/src/config/types.ts b/src/config/types.ts index fbb348fc02..6a3fc3092a 100644 --- a/src/config/types.ts +++ b/src/config/types.ts @@ -34,6 +34,7 @@ export type Source = { autoAdmin?: boolean; proxy?: string; + proxySmtp?: string; accesslog?: string; diff --git a/src/services/send-email.ts b/src/services/send-email.ts index 8818c5fcde..5a8f92be54 100644 --- a/src/services/send-email.ts +++ b/src/services/send-email.ts @@ -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