Skip to content

Commit

Permalink
Dockerfile: preinstall msmtp
Browse files Browse the repository at this point in the history
This implements `/usr/sbin/sendmail` which is needed by `FailureReports true`.

Also adds a new section about sending reports to the README.md.
  • Loading branch information
schildbach committed Mar 12, 2024
1 parent 57aead9 commit c6bdac3
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Dockerfile.tmpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@
&& apk upgrade \
&& apk add --no-cache \
ca-certificates \
msmtp \
<? } else { ?>
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y --no-install-recommends --no-install-suggests \
inetutils-syslogd \
ca-certificates \
msmtp-mta \
<? } ?>
&& update-ca-certificates \
\
Expand Down
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,26 @@ To see default OpenDMARC configuration of this Docker image just run:
docker run --rm instrumentisto/opendmarc cat /etc/opendmarc/opendmarc.conf
```
#### Sending reports
The Docker images come with msmtp MTA preinstalled which you can use to send reports when requested via the `ruf` tag inside a DMARC record.
For this to happen, in `opendmarc.conf` set `FailureReports true` and `FailureReportsSentBy` to your (probably noreply) sender address.
Then, map an `/etc/msmtprc` configuration file that looks like this:
```
defaults
logfile -
account default
host <SMTP host>
port <SMTP port>
from <sender address>
```
Apart from substituting your MTA hostname/port and your sender address (again), consider adding TLS and authentication if you're
touching untrusted network. See the msmtp man page for details.

Make sure to avoid mail loops, which can happen if processing your report mails violate your own DMARC rules, causing more reports.


## Important tips
Expand Down
1 change: 1 addition & 0 deletions alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ RUN apk update \
&& apk upgrade \
&& apk add --no-cache \
ca-certificates \
msmtp \
&& update-ca-certificates \
\
# Install OpenDMARC dependencies
Expand Down
1 change: 1 addition & 0 deletions debian/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ RUN apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
inetutils-syslogd \
ca-certificates \
msmtp-mta \
&& update-ca-certificates \
\
# Install OpenDMARC dependencies
Expand Down

0 comments on commit c6bdac3

Please sign in to comment.