Skip to content
/ dmarc Public

Scripts for managing and displaying dmarc delivery reports

License

Notifications You must be signed in to change notification settings

au-ts/dmarc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DMARC handling

By adding a _dmarc record to your DNS you can receive deliverability reports on your email Outlook.com and Google, and possibly other email providers, email a daily report to the address in the rua field of the _dmarc record.

The capture_dmarc script is designed to be the recipient of such reports. It takes them on standard input, decodes the MIMEtext in the email, extracts the actual report (some providers just provide a gzipped XML file, others encapsulate it in a ZIP file), and dumps it in a file.

Use by adding an alias in /etc/aliases like:

dmarc: |/usr/bin/python3 /usr/local/sbin/capture_dmarc.py

or similar; or you can use a procmail recipe.

The serve_dmarc script sets up a simple webserver on port 5002 using Flask, and serves the reports. It has no security; but provides a simple visualisation of the reports so far.

You probably need a cron job to clean up old reports too. Suggest something like:

10 12 * * * Debian-exim find /var/cache/dmarc -name '*xml' -mtime +60 -print0 | xargs -0 rm -f

in /etc/cron.d/dmarc to remove all reports over 60 days old. (Use the user who creates the files, not necessarily Debian-exim) in /etc/cron.d/dmarc to remove all reports over 60 days old.

About

Scripts for managing and displaying dmarc delivery reports

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages