首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >后缀标头指出错误的IP

后缀标头指出错误的IP
EN

Server Fault用户
提问于 2015-06-06 02:50:00
回答 2查看 1.3K关注 0票数 2

我在Debian8.0上使用后缀2.11.3

我将后缀配置为运行多个实例(3),每个连接到服务器的公共IP都有一个实例,以便根据服务平衡传出通信量。

我为所有子域配置了DKIM和SPF (每个IP有一个子域),但有时我从GMail和其他提供程序那里接收SPF和DKIM失败,并查看标题,它看起来像是接收邮件服务器无法解析我的IP。

请检查以下标题,例如

代码语言:javascript
复制
Delivered-To: XX@XXXX.com
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: <chris@hello3.much.cheap>
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 <XX@XXXX.com>;
        Fri, 05 Jun 2015 19:26:15 -0700 (PDT)
Received-SPF: permerror (google.com: domain of chris@hello3.much.cheap 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 chris@hello3.much.cheap uses a mechanism not recognized by this client. unknown  mechanisms: )) smtp.mail=chris@hello3.much.cheap;
       dkim=pass header.i=@much.cheap;
       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 <XX@XXXX.com>; 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: XX@XXXX.com
From: Chris <chris@hello3.much.cheap>
Subject: Wonderful trip with family!
Bounces-To: chris@hello3.much.cheap

你可以看到SPF和DKIM都因为错误的解决ip: 2607:5300:60:6516::最奇怪的事情是,在SPF和DKIM记录之后,google实际上可以看到我的真实IP ( 167.114.180.233:by hello3.much.cheap)。

错误不是常量,有时它得到正确的IP (167.114.180.233),即使在第一个头和所有检查通过。

请注意,我不在防火墙/代理后面,相关的后缀实例绑定到正确的IP地址。

master.cf

代码语言:javascript
复制
67.114.180.233:2533     inet  n       -       n       -       -       smtpd

main.cf

代码语言:javascript
复制
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

有什么想法吗?

EN

回答 2

Server Fault用户

回答已采纳

发布于 2015-06-09 04:49:57

此标头

代码语言:javascript
复制
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 <XX@XXXX.com>;
        Fri, 05 Jun 2015 19:26:15 -0700 (PDT)

指示后缀通过mx.google.com通过IPv6发送电子邮件。在其他情况下,后缀将通过IPv4发送电子邮件。

SPF检查器mx.google.com将使用您的IPv6地址与SPF记录进行比较。

代码语言:javascript
复制
v=spf1 mx a ptr include:much.cheap ~all

正如你所看到的,IPv6记录没有被列在SPF记录中,因此google警告你SPF检查失败。服务器mx.google.com在解析IP地址时不会出错。是您的服务器将其与IPv6一起发送。

修复应该是添加IPv6记录到您的SPF。

我仍然不知道为什么后缀通过IPv6发送电子邮件,因为你有参数

代码语言:javascript
复制
smtp_bind_address = 167.114.180.233

但是,在详细级别上跟踪邮件日志可能会暴露问题。

票数 3
EN

Server Fault用户

发布于 2015-06-06 05:56:32

它可能与DNS优先级规则相关。标准是先解决IPv6,然后解决IPv4。如果希望优先考虑IPv4,可以更改文件/etc/gai.conf,取消注释以下一行:

#precedence ::ffff:0:0/96 100

票数 0
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/697031

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档