feat: add dual-engine email service with aliyun smtp and resend routing

Route Chinese domains (edu.cn, qq.com, 163.com, etc.) via Aliyun SMTP
and international addresses via Resend API.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-25 18:33:17 +08:00
parent fcd9816b0b
commit 5371b1d1c6
5 changed files with 197 additions and 0 deletions

View File

@@ -16,6 +16,25 @@ type Config struct {
Mathpix MathpixConfig `mapstructure:"mathpix"`
BaiduOCR BaiduOCRConfig `mapstructure:"baidu_ocr"`
Google GoogleOAuthConfig `mapstructure:"google"`
Email EmailConfig `mapstructure:"email"`
}
type EmailConfig struct {
FromName string `mapstructure:"from_name"`
FromAddr string `mapstructure:"from_addr"`
AliyunSMTP AliyunSMTPConfig `mapstructure:"aliyun_smtp"`
Resend ResendEmailConfig `mapstructure:"resend"`
}
type AliyunSMTPConfig struct {
Host string `mapstructure:"host"`
Port int `mapstructure:"port"`
Username string `mapstructure:"username"`
Password string `mapstructure:"password"`
}
type ResendEmailConfig struct {
APIKey string `mapstructure:"api_key"`
}
type BaiduOCRConfig struct {

View File

@@ -56,3 +56,14 @@ google:
client_secret: "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"
redirect_uri: "https://app.cloud.texpixel.com:10443/auth/google/callback"
proxy: "http://localhost:7890"
email:
from_name: "TexPixel Support"
from_addr: "support@texpixel.com"
aliyun_smtp:
host: "smtp.qiye.aliyun.com"
port: 465
username: "support@texpixel.com"
password: "8bPw2W9LlgHSTTfk"
resend:
api_key: "re_xxxxxxxxxxxx"

View File

@@ -56,3 +56,14 @@ google:
client_secret: "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"
redirect_uri: "https://texpixel.com/auth/google/callback"
proxy: "http://100.115.184.74:7890"
email:
from_name: "TexPixel Support"
from_addr: "support@texpixel.com"
aliyun_smtp:
host: "smtp.qiye.aliyun.com"
port: 465
username: "support@texpixel.com"
password: "8bPw2W9LlgHSTTfk"
resend:
api_key: "re_xxxxxxxxxxxx"