Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/config.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public_url = "https://gateway.example.com"
# ============================================================
# [mail]
# smtp_host = "smtp.example.com"
# smtp_port = 587
# smtp_port = 465
# smtp_user = "noreply@example.com"
# smtp_password = "your-smtp-password"
# from = "noreply@example.com"
Expand Down
7 changes: 6 additions & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,13 @@ pub struct Mail {
pub verify_subject: String,
}

/// SMTP 端口的缺省值:**由 `mail.rs` 选用的传输模式决定** ——
/// `SmtpTransport::relay` = implicit TLS ⇒ 465(`lettre` 的 `SUBMISSIONS_PORT`)。
/// 填 587(STARTTLS 口)会在连接后立即对 587 做 TLS 握手 ⇒ rustls `InvalidContentType`
/// (2026-08-20 实测,详见 `src/mail.rs` 文件头)。
/// `config.example.toml` 里的同一个值由 `smtp_port_gate.rs` 守着,两者必须一致。
fn default_smtp_port() -> u16 {
587
465
}

impl Mail {
Expand Down
4 changes: 4 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ mod citation_gate;
// 加 #[cfg(test)] 后不会进入发布产物。
#[cfg(test)]
mod readme_gate;
// SMTP 端口门禁(R127):同样是仅测试期编译 —— config 示例 / config.rs / mail.rs
// 都在编译期读入,加 #[cfg(test)] 后不会进入发布产物。
#[cfg(test)]
mod smtp_port_gate;

use std::sync::Arc;

Expand Down
Loading
Loading