modoboa / modoboa-dmarc

A set of tools to use DMARC through Modoboa.
MIT License
15 stars 11 forks source link

ARC results are not supported when showing DMARC reports #50

Closed tschuettler closed 3 years ago

tschuettler commented 3 years ago

Google is using Authenticated Received Chain (ARC) for their Google Apps to support (internal) forwarding of mails without loosing DMARC authentification results. Since it will use a new MAIL FROM and creates a new DKIM Signature for forwarded mails the DMARC alignment will fail and the corresponding records will appear as Untrusted sources / Threats.

An excerpt of a report may look like this, where example.net is the domain that is receiving this DMARC report:

<record>
    <row>
      <source_ip>209.85.220.69</source_ip>
      <count>6</count>
      <policy_evaluated>
        <disposition>none</disposition>
        <dkim>fail</dkim>
        <spf>fail</spf>
        <reason>
          <type>local_policy</type>
          <comment>arc=pass</comment>
        </reason>
      </policy_evaluated>
    </row>
    <identifiers>
      <header_from>example.net</header_from>
    </identifiers>
    <auth_results>
      <dkim>
        <domain>example.test.gappssmtp.com</domain>
        <result>pass</result>
        <selector>test</selector>
      </dkim>
      <spf>
        <domain>example.com</domain>
        <result>pass</result>
      </spf>
    </auth_results>
  </record>

As defined in https://datatracker.ietf.org/doc/html/rfc8617#section-7.2.1 the reason type along with the reason comment arc=pass indicate, that the mails actually did pass the DMARC alignment in a previous part of the ARC. The reports that I have seen so far to not contain any additional informations besides the arc=pass, although the (currently experimental) RFC suggests to do so.

This ARC information allows us to filter those records and list them as a separate category when viewing a DMARC report in modoboa.

I'm going to put up a PR to provide an enhancement supporting the ARC results.