DirectAdmin: Adding a DMARC record to help lower your spam score

What is DMARC?

DMARC, which stands for “Domain-based Message Authentication, Reporting & Conformance”, is an email authentication, policy, and reporting protocol. It builds on the widely deployed SPF and DKIM protocols, adding linkage to the author (“From:”) domain name, published policies for recipient handling of authentication failures, and reporting from receivers to senders, to improve and monitor protection of the domain from fraudulent email.

Who Can Use DMARC?

DMARC policies are published in the public Domain Name System (DNS), and available to everyone. Because the specification is available with no licensing or similar restriction, any interested party is free to implement it.

To add a DMARC record, go to your domain’s DNS Management, and add the following TXT record:

_dmarc    TXT    "v=DMARC1; p=reject; sp=none; rua=mailto:[email protected]"

Be sure to include the whole thing in “quotes”.

The E-Mail Address [email protected] will sometimes be sent reported spam messages by larger providers.  Not all services will email this address, but it’s handy if a a client in large email provider clicks “this is spam” for a given message, and you’ll be sent that message, so you can determine if someone on your domain is spamming or spoofing, or if the client incorrectly clicked that message (at which point, you’d probably want to remove that client from your mail-out, as they likely don’t want it).

The rua=mailto:email portion is not mandatory if you don’t want to get these emails.

You can change the values as desired, as per the DMARC specifications:

Google’s DMARC guide:

I wish to automate new DMARC records for all new domains

If you like the above setup, and you want to automate it’s addition to all new dns zones, you can run the following:

cd /usr/local/directadmin/data/templates/custom
cp ../dns_txt.conf .

and then add the record you want to the bottom of the custom/dns_txt.conf by running this command:

echo '_dmarc="v=DMARC1; p=reject; sp=none; rua=mailto:spam-reports@|DOMAIN|"' >> dns_txt.conf

keeping in mind that this assumes you’ve got a spam-reports account created already.

Spam report example:

<?xml version="1.0" encoding="UTF-8" ?>
    <email>[email protected]</email>

Leave a Reply

Your email address will not be published. Required fields are marked *