大网数据广告活动
服务器运维问答

DKIM on aliased domains with rspamd and postfix

· 52CE 我爱测

I'm having trouble DKIM signing my outgoing emails when they're sent from an alias domain. That is, when I'm authenticated with [email omitted] sending as [email omitted] or [email omitted] my emails are correctly DKIM-signed, bu…

问题原文

原帖链接 · Arthur Alkmim · CC BY-SA 4.0

I'm having trouble DKIM signing my outgoing emails when they're sent from an alias domain. That is, when I'm authenticated with [email omitted] sending as [email omitted] or [email omitted] my emails are correctly DKIM-signed, but if I send as [email omitted] the signature is NOT added to the mail header. I'm using postfix and rspamd, here are the relevant files:

Postfix

main.cf

(initial boilerplate omitted for brevity)

virtual_mailbox_domains = pgsql:/etc/postfix/pgsql-virtual-mailbox-domains.cf
virtual_mailbox_maps = pgsql:/etc/postfix/pgsql-virtual-mailbox-users.cf
virtual_alias_maps = pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf
virtual_transport = lmtp:unix:private/dovecot-lmtp
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
smtpd_tls_security_level = may
smtpd_tls_auth_only = yes
smtp_tls_security_level = may
smtpd_sender_login_maps = pgsql:/etc/postfix/pgsql-virtual-alias-maps.cf
smtpd_milters = inet:127.0.0.1:11332
non_smtpd_milters = inet:127.0.0.1:11332
milter_protocol = 6
milter_mail_macros = i {mail_addr} {client_addr} {client_name} {auth_authen}

master.cf

(default configs omitted for brevity)

submission inet n - - - - smtpd
  -o syslog_name=postfix/submission
  -o smtpd_tls_security_level=encrypt
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_sasl_type=dovecot
  -o smtpd_sasl_path=private/auth
  -o smtpd_sasl_security_options=noanonymous
  -o smtpd_sender_login_maps=pgsql:/etc/postfix/pgsql-email2email.cf
  -o smtpd_sender_restrictions=reject_unauthenticated_sender_login_mismatch
  -o smtpd_sasl_local_domain=$myhostname
  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
  -o smtpd_recipient_restrictions=reject_non_fqdn_recipient,reject_unknown_recipient_domain,permit_sasl_authenticated,reject

rspamd

local.d/dkim_signing.conf

path = "/var/lib/rspamd/dkim/$domain.$selector.key";
selector_map = "/etc/rspamd/dkim_selectors.map";

Permissions at dkim selectors path are r-x------ for files and r-xr-x--- for folder.

已采纳解答

原帖链接 · Esa Jokinen · CC BY-SA 4.0

From DKIM signing module's Principles of operation:

The DKIM signing module chooses signing domains and selectors according to a predefined policy which can be modified with various settings. Description of this default policy follows: - -

  • If authenticated user is present, this should be suffixed with @domain where domain is what’s seen is envelope/header From address

The secondary domain doesn't match the domain of the authenticated user. To alter this default behaviour, your dkim_signing.conf should have:

allow_username_mismatch = true;

.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-04-20)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。