feat(server): add fallback smtp config (#13377)

fix AF-2749

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Added support for configuring a fallback SMTP server for outgoing
emails.
* Introduced the ability to specify email domains that will always use
the fallback SMTP server.
* Enhanced email sending to automatically route messages to the
appropriate SMTP server based on recipient domain.

* **Documentation**
* Updated configuration options and descriptions in the admin interface
to reflect new fallback SMTP settings.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
DarkSky
2025-07-31 17:56:30 +08:00
committed by GitHub
parent 77950cfc1b
commit 61fa3ef6f6
4 changed files with 132 additions and 6 deletions

View File

@@ -114,6 +114,34 @@
"type": "Boolean",
"desc": "Whether ignore email server's TSL certification verification. Enable it for self-signed certificates.",
"env": "MAILER_IGNORE_TLS"
},
"fallbackDomains": {
"type": "Array",
"desc": "The emails from these domains are always sent using the fallback SMTP server."
},
"fallbackSMTP.host": {
"type": "String",
"desc": "Host of the email server (e.g. smtp.gmail.com)"
},
"fallbackSMTP.port": {
"type": "Number",
"desc": "Port of the email server (they commonly are 25, 465 or 587)"
},
"fallbackSMTP.username": {
"type": "String",
"desc": "Username used to authenticate the email server"
},
"fallbackSMTP.password": {
"type": "String",
"desc": "Password used to authenticate the email server"
},
"fallbackSMTP.sender": {
"type": "String",
"desc": "Sender of all the emails (e.g. \"AFFiNE Team <noreply@affine.pro>\")"
},
"fallbackSMTP.ignoreTLS": {
"type": "Boolean",
"desc": "Whether ignore email server's TSL certification verification. Enable it for self-signed certificates."
}
},
"doc": {