SPF,DKIM和DMARC都设定了,但是dmarc报告却反过来说

时间:2017-04-08 17:47:56

标签: email debian spf dkim dmarc

我(关于)关于电子邮件的事情我已经失去了理智。

我有一台Kimsufi / OVH(Debian Wheezy 7.10)服务器。我有postfix和dovecot全部设置。

我的主域/主机名是mywebsite.fr,我在mywebsite.fr上使用mywebsite.fr设置。

我在两个域的dns区域中设置了spf,dkim和dmarc条目。通过联系[at] mywebsite [dot] fr和no-reply [at] mywebsite [dot] fr,我运行的所有测试都很好:

1)auth-resultats@verifier.port25.com

The Port25 Solutions, Inc. team

==========================================================
 Summary of Results
==========================================================
SPF check:          pass
DomainKeys check:   neutral
DKIM check:         pass
SpamAssassin check: ham

==========================================================
Details:
==========================================================

HELO hostname:  mywebsite.fr
Source IP:      91.121.166.194
mail-from:      contact@mywebsite.fr

----------------------------------------------------------
SPF check details:
----------------------------------------------------------
Result:         pass
ID(s) verified: smtp.mailfrom=contact@mywebsite.fr
DNS record(s):
    mywebsite.fr. SPF (no records)
    mywebsite.fr. 6055 IN TXT "v=spf1 a mx include:mx.ovh.com ~all"
    mywebsite.fr. 6054 IN A 91.121.166.194

----------------------------------------------------------
DomainKeys check details:
----------------------------------------------------------
Result:         neutral (message not signed)
ID(s) verified: header.From=contact@mywebsite.fr
DNS record(s):

----------------------------------------------------------
DKIM check details:
----------------------------------------------------------
Result:         pass (matches From: contact@mywebsite.fr)
ID(s) verified: header.d=mywebsite.fr

2)dmarcian.com

https://dmarcian.com/dmarc-inspector/mywebsite.fr
All seems good

3)dkimvalidator.com

DKIM Information:

DKIM Signature

Message contains this DKIM Signature:
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mywebsite.fr;
    s=mail; t=1491673268;
    bh=g3zLYH4xKxcPrHOD18z9YfpQcnk/GaJedfustWU5uGs=;
    h=Date:From:To:Subject:From;
    b=CScyX9ZvWCDL6FGLroXZi/8dFiWmgPbKwcTuSZqPuCHBOR4tv4QdGzxgZ3acWf6AP
     AwAt3Y2h+9IHeayu8mT2rl2Bz3E3XbMC6waEHoc645sAOq1nV9l8hAuw73hm6YsvXU
     QEAgcDIaD8b5fAXoX99rGkSfD6Rx5ygeuJOs0MzZcxnOzaJM+6mvOzusep4PRv0XvG
     eEJYYwL2sNd0qEJSLJ666fhvE781qtwnWaUewlceSgek5bnJ1DVEOsLkcl3uwTabau
     PsLZm9SPuqsc+aDRTTNNRKuI2noO1/w3M6XWfZxpYPIeoxwNnflWxP0s9O6+UbhsCJ
     PJbZeYVATVFKYKjFJlbwAqPMMmJAiqSWzsXvT06/P/Qw70nT5Q9qK1FI8Uu9NRFhWe
     g+35wx03zNG5OMgKzKsv9qH06qccBsbfhHXKm63YkxLDhO+2AtdicdWqrMlZQap7V0
     CC4VyTCNLZdOASWdLJdh8JDsY2TXNU/Pcpxw0uSf0BigY/0q3qj5O7GRzzSLG1rKz0
     +HpvDql/PpsscXt16URaOtO7/rZ6H3EsS1ZkutO5udiwJvoZulraMbI8sQQghR3Yyw
     OZqDardodYdVo1tHzTPQ4MJTEKI+2IO4ulCj7/kJ109xpTYo8+8x3I7Z5Bhmnyui7j
     TIxRT8MCD1sRUOoP7mD/7Pb0=


Signature Information:
v= Version:         1
a= Algorithm:       rsa-sha256
c= Method:          relaxed/relaxed
d= Domain:          mywebsite.fr
s= Selector:        mail
q= Protocol:        
bh=                 g3zLYH4xKxcPrHOD18z9YfpQcnk/GaJedfustWU5uGs=
h= Signed Headers:  Date:From:To:Subject:From
b= Data:            CScyX9ZvWCDL6FGLroXZi/8dFiWmgPbKwcTuSZqPuCHBOR4tv4QdGzxgZ3acWf6AP
     AwAt3Y2h+9IHeayu8mT2rl2Bz3E3XbMC6waEHoc645sAOq1nV9l8hAuw73hm6YsvXU
     QEAgcDIaD8b5fAXoX99rGkSfD6Rx5ygeuJOs0MzZcxnOzaJM+6mvOzusep4PRv0XvG
     eEJYYwL2sNd0qEJSLJ666fhvE781qtwnWaUewlceSgek5bnJ1DVEOsLkcl3uwTabau
     PsLZm9SPuqsc+aDRTTNNRKuI2noO1/w3M6XWfZxpYPIeoxwNnflWxP0s9O6+UbhsCJ
     PJbZeYVATVFKYKjFJlbwAqPMMmJAiqSWzsXvT06/P/Qw70nT5Q9qK1FI8Uu9NRFhWe
     g+35wx03zNG5OMgKzKsv9qH06qccBsbfhHXKm63YkxLDhO+2AtdicdWqrMlZQap7V0
     CC4VyTCNLZdOASWdLJdh8JDsY2TXNU/Pcpxw0uSf0BigY/0q3qj5O7GRzzSLG1rKz0
     +HpvDql/PpsscXt16URaOtO7/rZ6H3EsS1ZkutO5udiwJvoZulraMbI8sQQghR3Yyw
     OZqDardodYdVo1tHzTPQ4MJTEKI+2IO4ulCj7/kJ109xpTYo8+8x3I7Z5Bhmnyui7j
     TIxRT8MCD1sRUOoP7mD/7Pb0=
Public Key DNS Lookup

Building DNS Query for mail._domainkey.mywebsite.fr
Retrieved this publickey from DNS: v=DKIM1; k=rsa;p=MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAomnPCDLufwn5YnIxZ+4veAqdQiTNyk3OsqxTXddGXstKjYefjeJZ/Wgd4vFRheS9DSRjtqLvc66KyM3Ubk37G3S2tXU6dpIPh/poiQuDhdZMWlp829YyR47sYtSSJqFrzd+dKDGfPwrlJb6iIeYksfXOXSHej6s9z1mDobl+fDhORKaB5JySZyPhh/FqCIVMHJffr8tod0Q55MAfRpl38WIJjRjjTXHS2OTNUSQq53kIqSZkx3iFdlxxZh5Tj1DU1bzIGfB4tQaJAGqGhSz4pyzkdc+uVuvXr6NbIrEQ/YnueDHWrbbPoMq77QcToMGqfypgB2CcEU2rlcDYq9aPqYAalv22zY6S0M5FUjlpiHDIR3Hb/ID2ZC2Q/XtCKgaOxr2C4T7Ad0CdcjjQMLnFkOY337U7/P0FgaSQaykiUvSkXDvURgunBv0GLqXfjfwK2Ge8fl+dhYN5bZ/59/GFPcyB/sLHB/cMFWEUyp63RXHBRm+q+c6PMdGIgmoTHYH/0FbYI+/9NHhYOLWhBrgds3x54vStQk0jqYKAipd2494v2dr3p5XlhXU4NEOSEH4FnBfiqoHiYDgjPEIm0ddqH2kBEiuymIoGtWPuBCmY993/1wevOMVjrQlysw2Gf1DZnlbnaytgcSAR0fHgIlLPPoRqGXodvgtW6Zj8ocy71qsCAwEAAQ==
Validating Signature

result = pass
Details: 

SPF Information:

Using this information that I obtained from the headers

Helo Address = mywebsite.fr
From Address = contact@mywebsite.fr
From IP      = 91.121.166.194
SPF Record Lookup

Looking up TXT SPF record for mywebsite.fr
Found the following namesevers for mywebsite.fr: ns.kimsufi.com nsXXXXXX.ip-91-XXX-166.eu
Retrieved this SPF Record: zone updated 20170408 (TTL = 46739)
using authoritative server (ns.kimsufi.com) directly for SPF Check
Result: pass (Mechanism 'a' matched)

Result code: pass
Local Explanation: mywebsite.fr: 91.121.166.194 is authorized to use 'contact@mywebsite.fr' in 'mfrom' identity (mechanism 'a' matched)
spf_header = Received-SPF: pass (mywebsite.fr: 91.121.166.194 is authorized to use 'contact@mywebsite.fr' in 'mfrom' identity (mechanism 'a' matched)) receiver=ip-172-31-3-128.us-west-1.compute.internal; identity=mailfrom; envelope-from="contact@mywebsite.fr"; helo=mywebsite.fr; client-ip=91.121.166.194

Etc等等。

一切似乎都很好,我发送电子邮件的所有邮件测试人员都在说" 10/10,你很高兴去找好友"。

问题是,我收到了dmarc报告并且它们并不好。 例如,雅虎的最后日期:

<?xml version="1.0"?>   
<feedback>  
  <report_metadata> 
    <org_name>Yahoo! Inc.</org_name>    
    <email>postmaster@dmarc.yahoo.com</email>   
    <report_id>1491615950.716847</report_id>    
    <date_range>    
      <begin>1491523200</begin> 
      <end>1491609599 </end>    
    </date_range>   
  </report_metadata>    
  <policy_published>    
    <domain>mywebsite.fr</domain>   
    <adkim>r</adkim>    
    <aspf>r</aspf>  
    <p>none</p> 
    <pct>100</pct>  
  </policy_published>   
  <record>  
    <row>   
      <source_ip>91.121.166.194</source_ip> 
      <count>1</count>  
      <policy_evaluated>    
        <disposition>none</disposition> 
        <dkim>fail</dkim>   
        <spf>fail</spf> 
      </policy_evaluated>   
    </row>  
    <identifiers>   
      <header_from>mywebsite.fr</header_from>   
    </identifiers>  
    <auth_results>  
      <dkim>    
        <domain>mywebsite.fr</domain>   
        <result>permerror</result>  
      </dkim>   
      <spf> 
        <domain>mywebsite.fr</domain>   
        <result>pass</result>   
      </spf>    
    </auth_results> 
  </record> 
</feedback> 

最后一次来自google.com:

<?xml version="1.0" encoding="UTF-8" ?>
<feedback>
  <report_metadata>
    <org_name>google.com</org_name>
    <email>noreply-dmarc-support@google.com</email>
    <extra_contact_info>https://support.google.com/a/answer/2466580</extra_contact_info>
    <report_id>14868783784049997701</report_id>
    <date_range>
      <begin>1491523200</begin>
      <end>1491609599</end>
    </date_range>
  </report_metadata>
  <policy_published>
    <domain>mywebsite.fr</domain>
    <adkim>r</adkim>
    <aspf>r</aspf>
    <p>none</p>
    <sp>none</sp>
    <pct>100</pct>
  </policy_published>
  <record>
    <row>
      <source_ip>2001:41d0:1:e7c2::1</source_ip>
      <count>1</count>
      <policy_evaluated>
        <disposition>none</disposition>
        <dkim>fail</dkim>
        <spf>fail</spf>
      </policy_evaluated>
    </row>
    <identifiers>
      <header_from>mywebsite.fr</header_from>
    </identifiers>
    <auth_results>
      <dkim>
        <domain>mywebsite.fr</domain>
        <result>fail</result>
        <selector>mail</selector>
      </dkim>
      <spf>
        <domain>mywebsite.fr</domain>
        <result>softfail</result>
      </spf>
    </auth_results>
  </record>
  <record>
    <row>
      <source_ip>2001:41d0:1:e7c2::1</source_ip>
      <count>1</count>
      <policy_evaluated>
        <disposition>none</disposition>
        <dkim>pass</dkim>
        <spf>fail</spf>
      </policy_evaluated>
    </row>
    <identifiers>
      <header_from>mywebsite.fr</header_from>
    </identifiers>
    <auth_results>
      <dkim>
        <domain>mywebsite.fr</domain>
        <result>pass</result>
        <selector>mail</selector>
      </dkim>
      <spf>
        <domain>mywebsite.fr</domain>
        <result>pass</result>
      </spf>
    </auth_results>
  </record>
</feedback>

我迷路了,我不知道该怎么做比已经设定的更多。如果可以提供帮助,请不要犹豫,向我询问更多信息。 THX ...

2 个答案:

答案 0 :(得分:2)

无论如何,查看其他测试人员的结果,看起来您正在使用4096 DKIM,它产生超过512字节的密钥大小。将您的DKIM大小降低到2048,我认为您的问题将随着DKIM失败而消失。我看到很多大密钥大小会导致DKIM失败的情况。

此外,谷歌的结果显示ipv6地址作为源IP,我有一种感觉Google可能会被窃听,可能没有正确执行有关aaaaa记录的SPF查找,您应该将ip6:2001:41d0:1:e7c2::1添加到您的SPF,看看是否能解决Google的SPF失败问题。

理论上,当ESP接收到ipv6 IP时,如果指定aaaa作为机制,则应查找SPF的a记录;如果指定了IPv4,则应a&#34;

答案 1 :(得分:1)

您看到的SPF问题是对齐问题。当Return-Path域和Header From域位于同一组织域时,SPF仅计入DMARC。在某些过于简单的术语中,它们必须相同或具有不是TLD的共同父域。

从报告中,您可以看到您的Return-Path域(用于SPF)是vaeserveur.fr,而域的头是calendridel.fr。在这种情况下,SPF产生传递并不重要 - 该传递值不会用于DMARC。请参阅此处的讨论 - https://tools.ietf.org/html/rfc7489#section-3.1

至于DKIM,另一个答案是关键。验证程序通常不支持4096位密钥,它们实际上不必根据RFC - https://tools.ietf.org/html/rfc6376#section-3.3.3