Skip to content

Commit

Permalink
Add msmtp (#10, #9)
Browse files Browse the repository at this point in the history
Co-authored-by: Kai Ren <tyranron@gmail.com>
  • Loading branch information
schildbach and tyranron authored Mar 12, 2024
1 parent 3405b9a commit fe6183c
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 3 deletions.
14 changes: 11 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,22 @@ All user visible changes to this project will be documented in this file. This p



## [1.4.2-r35] · 2024-??-?? (unreleased)
[1.4.2-r35]: /../../tree/1.4.2-r35
## [1.4.2-r36] · 2024-03-12
[1.4.2-r36]: /../../tree/1.4.2-r36

[Diff](/../../compare/1.4.2-r35...1.4.2-r36)

[Diff](/../../compare/1.4.2-r35...)
### Added

- Sending reports support via [`msmtp`]. ([#10], [#9])

### Security updated

- [Debian Linux] "bookworm" 20240311 (12.5): <https://github.com/docker-library/official-images/commit/c67fd26a4cbfe0f59d8013bc1e87a84c5621faf0>

[#9]: /../../issues/9
[#10]: /../../pull/10




Expand Down Expand Up @@ -653,6 +660,7 @@ All user visible changes to this project will be documented in this file. This p


[`libspf2`]: https://www.libspf2.org
[`msmtp`]: https://marlam.de/msmtp
[Alpine Linux]: https://www.alpinelinux.org
[Debian Linux]: https://www.debian.org
[OpenDMARC]: https://github.com/trusteddomainproject/OpenDMARC
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile.tmpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@
<? if ($isAlpineImage) { ?>
&& apk add --no-cache \
libmilter libspf2 \
msmtp \
<? } else { ?>
&& apt-get install -y --no-install-recommends --no-install-suggests \
libmilter1.0.1 libspf2-2 \
msmtp-mta \
<? } ?>
\
# Install tools for building
Expand Down
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,25 @@ To see default OpenDMARC configuration of this Docker image just run:
docker run --rm instrumentisto/opendmarc cat /etc/opendmarc/opendmarc.conf
```
#### Sending reports
This image comes with [`msmtp` MTA][30] preinstalled, which can be used to send reports when requested via the [`ruf` tag inside a DMARC record][32].
For this to happen, in `opendmarc.conf` set `FailureReports true` and `FailureReportsSentBy` to your (probably `noreply`) sender address. Then, put 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][31] for details.

Make sure to avoid mail loops, which can happen if processing a report mails violates its own [DMARC][11] rules, causing more reports.




Expand Down Expand Up @@ -168,6 +187,9 @@ If you have any problems with or questions about this image, please contact us t
[20]: http://skarnet.org/software/s6/overview.html
[21]: https://github.com/just-containers/s6-overlay
[22]: https://github.com/just-containers/s6-overlay#usage
[30]: https://marlam.de/msmtp
[31]: https://marlam.de/msmtp/msmtp.html
[32]: https://dmarc.org/overview#odd_row
[90]: https://github.com/instrumentisto/opendmarc-docker-image
[91]: https://github.com/instrumentisto/opendmarc-docker-image/blob/main/LICENSE.md
[92]: https://sourceforge.net/p/opendmarc/code/ci/master/tree/LICENSE
Expand Down
1 change: 1 addition & 0 deletions alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ RUN apk update \
# Install OpenDMARC dependencies
&& apk add --no-cache \
libmilter libspf2 \
msmtp \
\
# Install tools for building
&& apk add --no-cache --virtual .tool-deps \
Expand Down
1 change: 1 addition & 0 deletions debian/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ RUN apt-get update \
# Install OpenDMARC dependencies
&& apt-get install -y --no-install-recommends --no-install-suggests \
libmilter1.0.1 libspf2-2 \
msmtp-mta \
\
# Install tools for building
&& toolDeps=" \
Expand Down
13 changes: 13 additions & 0 deletions tests/main.bats
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,16 @@
'/sbin/syslogd --help'
[ "$status" -eq 0 ]
}


@test "sendmail: is present" {
run docker run --rm --pull never --entrypoint sh $IMAGE -c \
'which sendmail'
[ "$status" -eq 0 ]
}

@test "sendmail: runs ok" {
run docker run --rm --pull never --entrypoint sh $IMAGE -c \
'sendmail --help'
[ "$status" -eq 0 ]
}

0 comments on commit fe6183c

Please sign in to comment.