chore(deploy): 配置已发送邮件自动归档

- 为 `submission` 和 `smtps` 启用 `sender_bcc_maps`,将已认证发件人自动抄送到 `发件人+Sent@域名`。
- 补充 Postfix 与 Dovecot 的 `recipient_delimiter` 和 `lmtp_save_to_detail_mailbox` 配置,确保 `Sent` 文件夹可落盘保存。
- 更新部署文档,说明第三方客户端发信后的“已发送”同步流程。
This commit is contained in:
LanQin
2026-06-17 00:19:40 +08:00
parent 2029c8804a
commit c21ebe43aa
5 changed files with 8 additions and 0 deletions
+1
View File
@@ -128,6 +128,7 @@ docker compose -f docker-compose.stack.yml -f docker-compose.stack.build.yml up
- Rspamd 会周期性从 SQLite 导出域名 DKIM 私钥到容器内 `/var/lib/rspamd/dkim` - Rspamd 会周期性从 SQLite 导出域名 DKIM 私钥到容器内 `/var/lib/rspamd/dkim`
- Go API 是 Webmail 和管理后台入口;浏览器不直接连接 SMTP/IMAP/POP3。 - Go API 是 Webmail 和管理后台入口;浏览器不直接连接 SMTP/IMAP/POP3。
- Go API 会读取 `LANQIN_MAILDIR_ROOT=/var/mail/vhosts`,周期扫描 Maildir,把 Postfix/Dovecot 入站邮件同步成 Webmail 索引。 - Go API 会读取 `LANQIN_MAILDIR_ROOT=/var/mail/vhosts`,周期扫描 Maildir,把 Postfix/Dovecot 入站邮件同步成 Webmail 索引。
- 第三方客户端通过 SMTP `465/587` 发信时,Postfix 会把已认证发件人的邮件自动 BCC 到 `发件人+Sent@域名`Dovecot LMTP 会保存到该邮箱的 `Sent` 文件夹,Webmail 扫描后会显示在“已发送”。
## 邮件客户端 TLS 证书 ## 邮件客户端 TLS 证书
+2
View File
@@ -68,4 +68,6 @@ service auth {
protocol lmtp { protocol lmtp {
postmaster_address = postmaster@localhost postmaster_address = postmaster@localhost
recipient_delimiter = +
lmtp_save_to_detail_mailbox = yes
} }
+1
View File
@@ -4,6 +4,7 @@ myorigin = $myhostname
mydestination = localhost mydestination = localhost
inet_interfaces = all inet_interfaces = all
inet_protocols = all inet_protocols = all
recipient_delimiter = +
# SQLite maps read the same LanQin DB created by the Go API. # SQLite maps read the same LanQin DB created by the Go API.
virtual_mailbox_domains = sqlite:/etc/postfix/sqlite-domains.cf virtual_mailbox_domains = sqlite:/etc/postfix/sqlite-domains.cf
+2
View File
@@ -4,11 +4,13 @@ submission inet n - n - - smtpd
-o smtpd_tls_security_level=may -o smtpd_tls_security_level=may
-o smtpd_sasl_auth_enable=yes -o smtpd_sasl_auth_enable=yes
-o smtpd_relay_restrictions=permit_sasl_authenticated,reject -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
-o sender_bcc_maps=sqlite:/etc/postfix/sqlite-sender-bcc.cf
smtps inet n - n - - smtpd smtps inet n - n - - smtpd
-o syslog_name=postfix/smtps -o syslog_name=postfix/smtps
-o smtpd_tls_wrappermode=yes -o smtpd_tls_wrappermode=yes
-o smtpd_sasl_auth_enable=yes -o smtpd_sasl_auth_enable=yes
-o smtpd_relay_restrictions=permit_sasl_authenticated,reject -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
-o sender_bcc_maps=sqlite:/etc/postfix/sqlite-sender-bcc.cf
pickup unix n - n 60 1 pickup pickup unix n - n 60 1 pickup
cleanup unix n - n - 0 cleanup cleanup unix n - n - 0 cleanup
qmgr unix n - n 300 1 qmgr qmgr unix n - n 300 1 qmgr
+2
View File
@@ -0,0 +1,2 @@
dbpath = /data/lanqin.db
query = SELECT local_part || '+Sent@' || substr(address, instr(address, '@') + 1) FROM mailboxes WHERE address='%s' AND status='active'