-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mod_smtp_filter_dmarc: Add DMARC reporting support and integration.
* Facilitate aggregate DMARC reporting using the opendmarc scripts by logging DMARC results to a history file that can be consumed by the opendmarc scripts. * Send immediate, individual failure reports (ruf) upon DMARC failure, if configured. * Improve the general robustness of DMARC verification and reporting. Related fixes and improvements: * mod_smtp_filter: Fix Authentication-Results header being generated prior to DMARC verification. * net_smtp: More clearly differentiate between MAIL FROM and From header address where needed. * mail.c: Extend mailer API to allow submitting entire RFC822 messages. * mail.c: Fix missing unlock. * lock.c: Print lock error if one occurs.
- Loading branch information
1 parent
9edc33b
commit 6388e9c
Showing
19 changed files
with
989 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
; mod_smtp_filter_dmarc.conf | ||
|
||
; DMARC enforcement | ||
[enforcement] | ||
reject=yes ; Reject messages that fail DMARC if sending domain's policy says to. (Can set to 'no' for debugging) | ||
quarantine=yes ; Quarantine messages that fail DMARC if sending domain's policy says to. (Can set to 'no' for debugging) | ||
|
||
; Note: if you have specified addresses for the rua/ruf parameters of your DMARC records that belong to a different domain, | ||
; you will need to ensure you have authorized cross-domain delivery of DMARC reports for delivery to succeed. | ||
; See: https://dmarc.org/2015/08/receiving-dmarc-reports-outside-your-domain/ | ||
; | ||
; You may find it useful to your own testing to ensure that policy enforcement is as desired. | ||
; It is best to do this between servers under your control to avoid penalizing a server that "shouldn't" be sending messages. | ||
; A recommended tool for this is "swaks", which you can easily run on another server, e.g.: | ||
; $ cd /tmp && wget https://raw.githubusercontent.com/jetmore/swaks/develop/swaks && chmod +x swaks | ||
; $ ./swaks --from [email protected] --helo example.com --server smtp.example.net --to [email protected] | ||
; | ||
; Note for the privacy conscious: DMARC reports can expose information about your email infrastructure that you may not have | ||
; intended to be public. For example, suppose Alice sends Bob an email. Normally, Bob's email provider (B), will send aggregate DMARC | ||
; reports to Alice's email server (A). However, suppose Bob forwards his email to another mail provider, C, but doesn't want | ||
; people to know email sent to B will get forwarded to C's servers. However, C, if configured to send DMARC reports, will send | ||
; DMARC reports to A (likely showing an SPF fail, but a DKIM pass, assuming B did not modify the message before forwarding it). | ||
; If A has access to the DMARC reports (say she operates the mail server) and she doesn't know anyone else using mail server C, | ||
; then she can deduce the emails sent to B were forwarded there. | ||
; This is not a security vulnerability; it is by design; however, the privacy-conscious may wish to NOT enable DMARC reporting | ||
; on this server, if you do not want people to know you are forwarding mail here. | ||
|
||
; DMARC reporting configuration | ||
[reporting] | ||
;reportfailures=yes ; Report DMARC failures to the sending domain (ruf). Messages will be sent from dmarc-noreply@<SMTP hostname> | ||
; Also known as "forensic" reports. Default is no. | ||
; Most mail servers no longer send these reports, so you may not want to enable this without a good reason, see: | ||
; https://dmarcian.com/where-are-the-forensicfailure-reports/ and https://dmarcian.com/where-are-the-forensicfailure-reports/ | ||
;[email protected] ; Bcc the specified address on all failure reports (ruf) that are sent. No default. | ||
; This can be useful if you are troubleshooting delivery issues and want to receive copies of any DMARC failure reports. | ||
|
||
; History file used for aggregate (rua) DMARC reporting. | ||
; LBBS does not handle aggregate DMARC reporting itself; the provided Perl reporting scripts | ||
; in the OpenDMARC project's source tree should be used. | ||
; This file has the same functionality as the log file denoted by the HistoryFile setting | ||
; in the native OpenDMARC filter. Using OpenDMARC provided scripts, this file can be periodically | ||
; imported into a database and further scripts can thence generate the actual DMARC reports. | ||
; More details here: https://github.com/trusteddomainproject/OpenDMARC/blob/master/opendmarc/opendmarc.conf.sample#L203 | ||
; Default is 'none' (no log file is created by default). | ||
|
||
; This is the default path hardcoded into opendmarc-importstats. If you change this, make sure to update that script as well. | ||
;historyfile=/var/tmp/dmarc.dat |
Oops, something went wrong.