Search code examples
wordpressamazon-web-servicesamazon-sesspfdmarc

Amazon SES IP Fails SPF Check in DMARC


I use Amazon SES for transactional emails and use the WP SES Plugin to integrate with my WordPress.

SPF fails for some of my emails which has the IP starting with 54.240.27. This seems to be Amazon SES IP.

I have the following SPF txt added to my DNS: v=spf1 include:_spf.google.com include:ofpad.com include:amazonses.com ~all

Any help is greatly appreciated.

Update: I added the MAIL FROM Domain in AWS as instructed by architjn, but the issue persists.

enter image description here

Below is the DMARC sent by Gmail after the implementation of Mail From Domain in AWS. Here is a human-readable version of the report: https://us.dmarcian.com/dmarc-xml/details/VANOJ4S6b8QGCinq/

<?xml version="1.0" encoding="UTF-8" ?>
<feedback>
  <report_metadata>
    <org_name>google.com</org_name>
    <email>[email protected]</email>
    <extra_contact_info>https://support.google.com/a/answer/2466580</extra_contact_info>
    <report_id>4375352491574064416</report_id>
    <date_range>
      <begin>1601078400</begin>
      <end>1601164799</end>
    </date_range>
  </report_metadata>
  <policy_published>
    <domain>ofpad.com</domain>
    <adkim>r</adkim>
    <aspf>r</aspf>
    <p>none</p>
    <sp>none</sp>
    <pct>100</pct>
  </policy_published>
  <record>
    <row>
      <source_ip>54.240.27.115</source_ip>
      <count>9</count>
      <policy_evaluated>
        <disposition>none</disposition>
        <dkim>pass</dkim>
        <spf>fail</spf>
      </policy_evaluated>
    </row>
    <identifiers>
      <header_from>ofpad.com</header_from>
    </identifiers>
    <auth_results>
      <dkim>
        <domain>ofpad.com</domain>
        <result>pass</result>
        <selector>ukez6fkocbm5wtdd7aqfx754ngfzaqs3</selector>
      </dkim>
      <dkim>
        <domain>amazonses.com</domain>
        <result>pass</result>
        <selector>hsbnp7p3ensaochzwyq5wwmceodymuwv</selector>
      </dkim>
      <spf>
        <domain>us-west-2.amazonses.com</domain>
        <result>pass</result>
      </spf>
    </auth_results>
  </record>
  <record>
    <row>
      <source_ip>54.240.27.35</source_ip>
      <count>8</count>
      <policy_evaluated>
        <disposition>none</disposition>
        <dkim>pass</dkim>
        <spf>fail</spf>
      </policy_evaluated>
    </row>
    <identifiers>
      <header_from>ofpad.com</header_from>
    </identifiers>
    <auth_results>
      <dkim>
        <domain>ofpad.com</domain>
        <result>pass</result>
        <selector>ukez6fkocbm5wtdd7aqfx754ngfzaqs3</selector>
      </dkim>
      <dkim>
        <domain>amazonses.com</domain>
        <result>pass</result>
        <selector>hsbnp7p3ensaochzwyq5wwmceodymuwv</selector>
      </dkim>
      <spf>
        <domain>us-west-2.amazonses.com</domain>
        <result>pass</result>
      </spf>
    </auth_results>
  </record>
  <record>
    <row>
      <source_ip>209.85.220.41</source_ip>
      <count>39</count>
      <policy_evaluated>
        <disposition>none</disposition>
        <dkim>pass</dkim>
        <spf>pass</spf>
      </policy_evaluated>
    </row>
    <identifiers>
      <header_from>ofpad.com</header_from>
    </identifiers>
    <auth_results>
      <dkim>
        <domain>ofpad.com</domain>
        <result>pass</result>
        <selector>ukez6fkocbm5wtdd7aqfx754ngfzaqs3</selector>
      </dkim>
      <dkim>
        <domain>amazonses.com</domain>
        <result>pass</result>
        <selector>hsbnp7p3ensaochzwyq5wwmceodymuwv</selector>
      </dkim>
      <spf>
        <domain>ofpad.com</domain>
        <result>pass</result>
      </spf>
    </auth_results>
  </record>
  <record>
    <row>
      <source_ip>54.240.27.34</source_ip>
      <count>10</count>
      <policy_evaluated>
        <disposition>none</disposition>
        <dkim>pass</dkim>
        <spf>fail</spf>
      </policy_evaluated>
    </row>
    <identifiers>
      <header_from>ofpad.com</header_from>
    </identifiers>
    <auth_results>
      <dkim>
        <domain>ofpad.com</domain>
        <result>pass</result>
        <selector>ukez6fkocbm5wtdd7aqfx754ngfzaqs3</selector>
      </dkim>
      <dkim>
        <domain>amazonses.com</domain>
        <result>pass</result>
        <selector>hsbnp7p3ensaochzwyq5wwmceodymuwv</selector>
      </dkim>
      <spf>
        <domain>us-west-2.amazonses.com</domain>
        <result>pass</result>
      </spf>
    </auth_results>
  </record>
  <record>
    <row>
      <source_ip>209.85.220.41</source_ip>
      <count>87</count>
      <policy_evaluated>
        <disposition>none</disposition>
        <dkim>pass</dkim>
        <spf>fail</spf>
      </policy_evaluated>
    </row>
    <identifiers>
      <header_from>ofpad.com</header_from>
    </identifiers>
    <auth_results>
      <dkim>
        <domain>ofpad.com</domain>
        <result>pass</result>
        <selector>ukez6fkocbm5wtdd7aqfx754ngfzaqs3</selector>
      </dkim>
      <dkim>
        <domain>amazonses.com</domain>
        <result>pass</result>
        <selector>hsbnp7p3ensaochzwyq5wwmceodymuwv</selector>
      </dkim>
      <spf>
        <domain>gmail.com</domain>
        <result>pass</result>
      </spf>
    </auth_results>
  </record>
  <record>
    <row>
      <source_ip>54.240.27.38</source_ip>
      <count>3</count>
      <policy_evaluated>
        <disposition>none</disposition>
        <dkim>pass</dkim>
        <spf>fail</spf>
      </policy_evaluated>
    </row>
    <identifiers>
      <header_from>ofpad.com</header_from>
    </identifiers>
    <auth_results>
      <dkim>
        <domain>ofpad.com</domain>
        <result>pass</result>
        <selector>ukez6fkocbm5wtdd7aqfx754ngfzaqs3</selector>
      </dkim>
      <dkim>
        <domain>amazonses.com</domain>
        <result>pass</result>
        <selector>hsbnp7p3ensaochzwyq5wwmceodymuwv</selector>
      </dkim>
      <spf>
        <domain>us-west-2.amazonses.com</domain>
        <result>pass</result>
      </spf>
    </auth_results>
  </record>
  <record>
    <row>
      <source_ip>54.240.27.116</source_ip>
      <count>11</count>
      <policy_evaluated>
        <disposition>none</disposition>
        <dkim>pass</dkim>
        <spf>fail</spf>
      </policy_evaluated>
    </row>
    <identifiers>
      <header_from>ofpad.com</header_from>
    </identifiers>
    <auth_results>
      <dkim>
        <domain>ofpad.com</domain>
        <result>pass</result>
        <selector>ukez6fkocbm5wtdd7aqfx754ngfzaqs3</selector>
      </dkim>
      <dkim>
        <domain>amazonses.com</domain>
        <result>pass</result>
        <selector>hsbnp7p3ensaochzwyq5wwmceodymuwv</selector>
      </dkim>
      <spf>
        <domain>us-west-2.amazonses.com</domain>
        <result>pass</result>
      </spf>
    </auth_results>
  </record>
  <record>
    <row>
      <source_ip>54.240.27.123</source_ip>
      <count>6</count>
      <policy_evaluated>
        <disposition>none</disposition>
        <dkim>pass</dkim>
        <spf>fail</spf>
      </policy_evaluated>
    </row>
    <identifiers>
      <header_from>ofpad.com</header_from>
    </identifiers>
    <auth_results>
      <dkim>
        <domain>ofpad.com</domain>
        <result>pass</result>
        <selector>ukez6fkocbm5wtdd7aqfx754ngfzaqs3</selector>
      </dkim>
      <dkim>
        <domain>amazonses.com</domain>
        <result>pass</result>
        <selector>hsbnp7p3ensaochzwyq5wwmceodymuwv</selector>
      </dkim>
      <spf>
        <domain>us-west-2.amazonses.com</domain>
        <result>pass</result>
      </spf>
    </auth_results>
  </record>
</feedback>

Solution

  • SPF is always considered of From Domain. Header From and From Domain are 2 different things. Header From is the part after @ in email address. In your case it's ofpad.com. But what happens is that it checks SPF from From Domain. In this case it is us-west-2.amazonses.com. And In DMARC it also checks the mail is being sent should have same domains in Header From and From Domain. Which is different in this case. That is the main reason of it's being failed. It is known as SPF Alignment in DMARC.

    To solve this issue you will have to head over to your SES Console and after selecting your domain you will see at the bottom a section named From Domain. You should configure it on a subdomain of ofpad.com and it will start passing the SPF afterwards. This will make your SPF relaxed Aligned.