正在转换的 [email protected] 的 SPF SOFTFAIL 域未指定 XXXX 为允许的发件人)

正在转换的 [email protected] 的 SPF SOFTFAIL 域未指定 XXXX 为允许的发件人)

在我的公司,我遇到了以下错误。

softfail (google.com: domain of transitioning [email protected] does not designate X.X.X.X as permitted sender) client-ip=X.X.X.X;

假设我的 mail.company.com 服务器是 YYYY,每个用户都从 Thunderbird 连接到他/她的邮件帐户,SMTP/POP3/IMAP 由 YYYY 域上托管的 DirectAdmin 提供服务。一些使用 GMail 从外部 POP3 服务器 (mail.company.com) 下载邮件的用户收到上述错误,并且电子邮件位于 SPAM 目录中。我拥有的 SPF 记录是:

v=spf1 a mx ip4:Y.Y.Y.Y ~all

我不明白的是,为什么标记为指定 IP 的 IP 是 XXXX,有时会有所不同,但它仍然不是 SMTP 服务器的 IP YYYY?我将 SPF 记录更改为:

v=spf1 mx a ptr ~all

但我认为这不是最佳解决方案。我的域名存储在 cloudflare 后面,但 mail.company.com 没有代理,只有 company.com 有代理。感谢您的帮助。

答案1

我通过在 exim 配置 (/etc/exim.conf) 中设置自定义接收标头解决了这个问题。在上述文件中,我添加了:

received_header_text = ${if def:authenticated_id {Received: from $primary_hostname ([X.X.X.X] helo=[s1.example.com]) by $primary_hostname with ESMTP\n\t(Exim $version_number)\n\t${if def:sender_address {(envelope-from <$sender_address>)\n\t}}id $message_exim_id${if def:received_for {\n\tfor $received_for}}\n\t}}Received: ${if def:sender_rcvhost {from $sender_rcvhost\n\t}{${if def:sender_ident {from ${quote_local_part:$sender_ident} }}${if def:sender_helo_name {(helo=$sender_helo_name)\n\t}}}}by $primary_hostname ${if def:received_protocol {with $received_protocol}} ${if def:tls_cipher {($tls_cipher)\n\t}}(Exim $version_number)\n\t${if def:sender_address {(envelope-from <$sender_address>)\n\t}}id $message_exim_id${if def:received_for {\n\tfor $received_for}}

其中 XXXX 是邮件服务器 IP,s1.example.com 是邮件服务器主机名或 IP 地址。我将其放在后面:

#EDIT#1:
# primary_hostname =
smtp_active_hostname = ${if exists{/etc/virtual/helo_data}{${lookup{$interface_address}iplsearch{/etc/virtual/helo_data}{$value}{$primary_hostname}}}{$primary_hostname}}

之后我重新启动了 exim:

service exim restart

现在,Google 不会因 SPF SOFTFAIL 而导致垃圾邮件检查失败。

相关内容