我在Debian 8.0上使用Postfix 2.11.3
我configuration了Postfix来运行多个实例(3),每个公共IP连接到我们的服务器,以平衡出站stream量取决于服务。
我为所有子域(每个IP有1个子域)configuration了DKIM和SPF,但是有时我从GMail和其他提供商那里收到SPF和DKIM失败,并且看起来像接收的邮件服务器看起来像邮件服务器无法parsing我的IP。
例如,请检查以下标题
Delivered-To: [email protected] Received: by 10.28.221.87 with SMTP id u84csp184407wmg; Fri, 5 Jun 2015 19:26:17 -0700 (PDT) X-Received: by 10.52.116.162 with SMTP id jx2mr11374004vdb.80.1433557576885; Fri, 05 Jun 2015 19:26:16 -0700 (PDT) Return-Path: <[email protected]> Received: from hello3.much.cheap ([2607:5300:60:6516::]) by mx.google.com with ESMTP id f2si9741219vdb.2.2015.06.05.19.26.14 for <[email protected]>; Fri, 05 Jun 2015 19:26:15 -0700 (PDT) Received-SPF: permerror (google.com: domain of [email protected] uses a mechanism not recognized by this client. unknown mechanisms: )) client-ip=2607:5300:60:6516::; Authentication-Results: mx.google.com; spf=permerror (google.com: domain of [email protected] uses a mechanism not recognized by this client. unknown mechanisms: )) smtp[email protected]; dkim=pass [email protected]; dmarc=pass (p=NONE dis=NONE) header.from=hello3.much.cheap Message-Id: <55725a47.220a340a.cc4f.ffffada7SMTPIN_ADDED_MISSING@mx.google.com> Received: from hello3.much.cheap (hello3.much.cheap [167.114.180.233]) by hello3.much.cheap (Postfix) with ESMTP id 27F7940083 for <[email protected]>; Fri, 5 Jun 2015 22:26:10 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=much.cheap; s=hello; t=1433557570; bh=z/R8LvudDLyZmOBbw+42+SG7pLmnI+4/+E4YxHqibK4=; h=Date:To:From:Subject:From; b=tJdvbP1c+me6BwXx4Qayzwvw7GR+OFd/xG+OwCqXz/YNPVhTIS56HxGxRkEvnztTr ClouAavusckmwXfQ5GmwjWvzVlcIZc7eT9rkBrAL8Th+2YPXNiw4k36ZDRik9lfICp qpvcGIhruOCE4BBQFE31j2qEDTl6qVh2D0jSAbD8= Received: from [167.114.180.233] by hello3.much.cheap with HTTP; Fri, 05 Jun 2015 22:26:09 -0400 Date: Fri, 5 Jun 2015 22:26:10 -0400 To: [email protected] From: Chris <[email protected]> Subject: Wonderful trip with family! Bounces-To: [email protected]
正如你可以看到,由于错误解决IP:2607:5300:60:6516 :: SPF和DKIM失败:最奇怪的是,SPF和DKIMlogging后,谷歌实际上可以看到我的真实IP(收到:[167.114。 180.233] by hello3.much.cheap)
错误不是恒定的,有时甚至在第一个标题中得到正确的IP(167.114.180.233),并且所有检查都通过。
请注意我不在防火墙/代理之后,相关的postfix实例绑定到正确的IP地址
master.cf
67.114.180.233:2533 inet n - n - - smtpd
main.cf
myorigin = hello3.much.cheap myhostname = hello3.much.cheap mydomain = hello3.much.cheap queue_directory = /var/spool/postfix-3 data_directory = /var/lib/postfix-3 multi_instance_group = outgoing multi_instance_name = postfix-3 inet_interfaces = all smtp_bind_address = 167.114.180.233 mynetworks = 127.0.0.0/8 167.114.64.22 167.114.180.232/29 smtpd_client_restrictions = permit_mynetworks, permit_sasl_authenticated, reject smtpd_helo_restrictions = permit_mynetworks, permit_sasl_authenticated, reject smtpd_sender_restrictions = permit_mynetworks, permit_sasl_authenticated, reject smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject milter_protocol = 2 milter_default_action = accept smtpd_milters = inet:localhost:12301 non_smtpd_milters = inet:localhost:12301 multi_instance_enable = yes smtp_generic_maps = hash:/etc/postfix-3/generic sender_canonical_classes = envelope_sender, header_sender sender_canonical_maps = regexp:/etc/postfix-3/sender_canonical_maps smtp_header_checks = regexp:/etc/postfix-3/header_check mime_header_checks = regexp:/etc/postfix-3/header_check header_checks = regexp:/etc/postfix-3/header_check strict_mailbox_ownership = no
任何想法?
这个头
Received: from hello3.much.cheap ([2607:5300:60:6516::]) by mx.google.com with ESMTP id f2si9741219vdb.2.2015.06.05.19.26.14 for <[email protected]>; Fri, 05 Jun 2015 19:26:15 -0700 (PDT)
表示后缀通过IPv6将电子邮件发送到mx.google.com。 在其他情况下,postfix将通过IPv4发送电子邮件。
SPF检查器mx.google.com将使用您的IPv6地址与您的SPFlogging进行比较
v=spf1 mx a ptr include:much.cheap ~all
正如你所看到的,IPv6logging没有在SPFlogging中列出,因此谷歌警告你失败的SPF检查。 parsing您的IP地址时,服务器mx.google.com没有错误。 这是你的服务器与IPv6发送。
修复应该是添加IPv6logging到您的SPF。
我仍然不知道为什么后缀通过IPv6发送电子邮件,因为你有参数
smtp_bind_address = 167.114.180.233
尾巴maillog在详细级别可能会揭示问题,虽然。
这可能与DNS优先级规则有关。 标准是先解决IPv6,再解决IPv4。 你可以改变这个行为改变文件/etc/gai.conf如果你想优先考虑IPv4,请取消注释这一行:
#precedence ::ffff:0:0/96 100