Files
NewSzxcn-Email/deploy/dovecot/dovecot.conf
T
LanQin_ f2457c63ee refactor(mail): 统一邮件认证策略请求与返回格式。
- 将 `auth-policy` 调整为读取 `login`、`remote` 等字段,并返回数值型 `status`。
- 支持按邮箱定位用户与邮箱箱体,补充 IMAP/POP3 认证策略校验。
- 更新 Dovecot 与 Postfix 配置,移除原有的发件人 BCC 依赖。
- 补充相关测试并同步部署说明。
2026-06-23 21:52:05 +08:00

104 lines
1.8 KiB
Plaintext

protocols = imap pop3 lmtp
listen = *
base_dir = /var/run/dovecot/
log_path = /dev/stderr
info_log_path = /dev/stdout
ssl = yes
ssl_cert = </etc/ssl/certs/ssl-cert-snakeoil.pem
ssl_key = </etc/ssl/private/ssl-cert-snakeoil.key
mail_home = /var/mail/vhosts/%d/%n
mail_max_userip_connections = 10
recipient_delimiter = +
plugin {
quota = maildir:User quota
quota_rule = *:storage=1G
# auth_policy_server is configured via dovecot-sql.conf.ext user_query
}
auth_policy_server_url = http://127.0.0.1:8080/auth-policy
auth_policy_server_api_header = Content-Type: application/json
auth_policy_hash_mech = sha256
auth_policy_hash_truncate = 12
auth_policy_hash_nonce = __LANQIN_AUTH_POLICY_HASH_NONCE__
auth_policy_request_attributes = login=%{requested_username} remote=%{rip} protocol=%s
namespace inbox {
inbox = yes
mailbox Drafts {
auto = create
special_use = \Drafts
}
mailbox Sent {
auto = create
special_use = \Sent
}
mailbox Trash {
auto = create
special_use = \Trash
}
mailbox Archive {
auto = create
special_use = \Archive
}
mailbox Spam {
auto = create
special_use = \Junk
}
}
passdb {
driver = sql
args = /etc/dovecot/dovecot-sql.conf.ext
}
userdb {
driver = sql
args = /etc/dovecot/dovecot-sql.conf.ext
}
protocol imap {
mail_plugins = quota imap_quota
}
protocol pop3 {
mail_plugins = quota
}
service imap-login {
inet_listener imaps {
port = 993
ssl = yes
}
}
service pop3-login {
inet_listener pop3s {
port = 995
ssl = yes
}
}
service lmtp {
inet_listener lmtp {
address = 0.0.0.0
port = 24
}
}
service auth {
inet_listener postfix-auth {
address = 0.0.0.0
port = 12345
}
}
protocol lmtp {
postmaster_address = postmaster@localhost
recipient_delimiter = +
lda_mailbox_autocreate = yes
lmtp_save_to_detail_mailbox = yes
}