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

DKIM not signing with alias addresses - not internal, not authenticated

· 52CE 我爱测

I have postfix, dovecot, opendkim and postsrsd installed. I am trying to forward mail from [email omitted] to [email omitted], and have them signed with DKIM. I use postsrsd in order for the SPF record to pass for the forwarded e…

问题原文

原帖链接 · user2370460 · CC BY-SA 3.0

I have postfix, dovecot, opendkim and postsrsd installed. I am trying to forward mail from [email omitted] to [email omitted], and have them signed with DKIM.

I use postsrsd in order for the SPF record to pass for the forwarded emails.

However, when I send an email from my icloud account to [email omitted], the message is delivered to my gmail inbox, but it is not being signed by DKIM.

Here is an output of my log:

postfix/smtpd:      connect from st11p01im-asmtp001.me.com[17.172.204.151]
postfix/smtpd:      BC23640B53: client=st11p01im-asmtp001.me.com[17.172.204.151]
postsrsd:           srs_forward: <[email omitted]> rewritten as <SRS0=zgyz=HT=icloud.com=[email omitted]>
postfix/cleanup:    BC23640B53: message-id=<[email omitted]>
opendkim:           BC23640B53: st11p01im-asmtp001.me.com [17.172.204.151] not internal
opendkim:           BC23640B53: not authenticated
opendkim:           BC23640B53: no signature data

I have looked at http://seasonofcode.com/posts/setting-up-dkim-and-srs-in-postfix.html and all my configuration files appear to be correct.

From what I have seen online, the "not internal, not authenticated" message means that the domain is not present in /etc/opendkim/TrustedHosts, but the domain being listed in the logs (st11p01im-asmtp001.me.com) is not my domain. I believe me.com belongs to Apple.

Is DKIM signing with an alias address using SRS not possible?

Update:
Having disabled postsrsd in /etc/postfix/main.cf, the problem still persists. Therefore, the issue is not with postsrsd, but with opendkim not signing mail for aliases addresses.

I think this is because opendkim looks at the original hostname that send the mail, which in my case is st11p01im-asmtp001.me.com, and therefore does not sign it because this address is not listed in /etc/opendkim/TrustedHosts.

Is there any way to get opendkim to work with alias addresses?

社区高分解答

原帖链接 · masegaloeh · CC BY-SA 3.0

For your concept here the ideal workflow

  1. External email receive by postfix
  2. OpenDKIM verifies the DKIM signature, if exists
  3. Postfix rewrite From: header so it comes from your domain that you controlled, for example example.com
  4. OpenDKIM re-sign DKIM into rewritten email (and remove the original DKIM signature if exists).
  5. Postfix deliver it into aliases address.

Unfortunately, postfix and OpenDKIM doesn't support DKIM signing right before sending to final destination. OpenDKIM only support milter interface that only operates when postfix receives email. Yes, you can have workaround like postfix multi instance so the first instance will do rewriting and the second one will do signing, but I think it's not worth in your case.

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

资料来源与适用范围

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

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

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