Skip to content

Commit

Permalink
Enable SPF via libspf2 (#8)
Browse files Browse the repository at this point in the history
Co-authored-by: Kai Ren <tyranron@gmail.com>
  • Loading branch information
ignisf and tyranron authored Feb 22, 2024
1 parent 48fbcd4 commit 57aead9
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 15 deletions.
14 changes: 11 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,21 @@ All user visible changes to this project will be documented in this file. This p



## [1.4.2-r34] · 2024-??-?? (unreleased)
[1.4.2-r34]: /../../tree/1.4.2-r34
## [1.4.2-r35] · 2024-02-22
[1.4.2-r35]: /../../tree/1.4.2-r35

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

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

- [SPF] support via [`libspf2`]. ([#8])

### Security updated

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

[#8]: /../../pull/8




Expand Down Expand Up @@ -634,8 +640,10 @@ All user visible changes to this project will be documented in this file. This p



[`libspf2`]: https://www.libspf2.org
[Alpine Linux]: https://www.alpinelinux.org
[Debian Linux]: https://www.debian.org
[OpenDMARC]: https://github.com/trusteddomainproject/OpenDMARC
[s6-overlay]: https://github.com/just-containers/s6-overlay
[Semantic Versioning 2.0.0]: https://semver.org
[SPF]: https://en.wikipedia.org/wiki/Sender_Policy_Framework
11 changes: 7 additions & 4 deletions Dockerfile.tmpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
# Install OpenDMARC dependencies
<? if ($isAlpineImage) { ?>
&& apk add --no-cache \
libmilter \
libmilter libspf2 \
<? } else { ?>
&& apt-get install -y --no-install-recommends --no-install-suggests \
libmilter1.0.1 \
libmilter1.0.1 libspf2-2 \
<? } ?>
\
# Install tools for building
Expand All @@ -55,10 +55,10 @@
# Install OpenDMARC build dependencies
<? if ($isAlpineImage) { ?>
&& apk add --no-cache --virtual .build-deps \
libmilter-dev \
libmilter-dev libspf2-dev \
<? } else { ?>
&& buildDeps=" \
libmilter-dev \
libmilter-dev libspf2-dev \
" \
&& apt-get install -y --no-install-recommends --no-install-suggests \
$buildDeps \
Expand All @@ -81,6 +81,9 @@
&& ./configure \
--prefix=/usr \
--sysconfdir=/etc/opendmarc \
--with-spf \
--with-spf2-lib=/usr/lib \
--with-spf2-include=/usr/include/spf2 \
# No documentation included to keep image size smaller
--docdir=/tmp/opendmarc/doc \
--infodir=/tmp/opendmarc/info \
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ REGISTRIES := $(strip $(subst $(comma), ,\
$(shell grep -m1 'registry: \["' .github/workflows/ci.yml \
| cut -d':' -f2 | tr -d '"][')))
ALL_IMAGES := \
debian:1.4.2-r34,1.4.2,1.4,1,latest \
alpine:1.4.2-r34-alpine,1.4.2-alpine,1.4-alpine,1-alpine,alpine
debian:1.4.2-r35,1.4.2,1.4,1,latest \
alpine:1.4.2-r35-alpine,1.4.2-alpine,1.4-alpine,1-alpine,alpine
# <Dockerfile>:<version>,<tag1>,<tag2>,...

# Default is first image from ALL_IMAGES list.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ OpenDMARC Docker image

## Supported tags and respective `Dockerfile` links

- [`1.4.2-r34`, `1.4.2`, `1.4`, `1`, `latest`][101]
- [`1.4.2-r34-alpine`, `1.4.2-alpine`, `1.4-alpine`, `1-alpine`, `alpine`][102]
- [`1.4.2-r35`, `1.4.2`, `1.4`, `1`, `latest`][101]
- [`1.4.2-r35-alpine`, `1.4.2-alpine`, `1.4-alpine`, `1-alpine`, `alpine`][102]



Expand Down
7 changes: 5 additions & 2 deletions alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ RUN apk update \
\
# Install OpenDMARC dependencies
&& apk add --no-cache \
libmilter \
libmilter libspf2 \
\
# Install tools for building
&& apk add --no-cache --virtual .tool-deps \
autoconf automake coreutils curl g++ libtool make \
\
# Install OpenDMARC build dependencies
&& apk add --no-cache --virtual .build-deps \
libmilter-dev \
libmilter-dev libspf2-dev \
\
# Download and prepare OpenDMARC sources
&& curl -fL -o /tmp/opendmarc.tar.gz \
Expand All @@ -41,6 +41,9 @@ RUN apk update \
&& ./configure \
--prefix=/usr \
--sysconfdir=/etc/opendmarc \
--with-spf \
--with-spf2-lib=/usr/lib \
--with-spf2-include=/usr/include/spf2 \
# No documentation included to keep image size smaller
--docdir=/tmp/opendmarc/doc \
--infodir=/tmp/opendmarc/info \
Expand Down
7 changes: 5 additions & 2 deletions debian/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ RUN apt-get update \
\
# Install OpenDMARC dependencies
&& apt-get install -y --no-install-recommends --no-install-suggests \
libmilter1.0.1 \
libmilter1.0.1 libspf2-2 \
\
# Install tools for building
&& toolDeps=" \
Expand All @@ -28,7 +28,7 @@ RUN apt-get update \
\
# Install OpenDMARC build dependencies
&& buildDeps=" \
libmilter-dev \
libmilter-dev libspf2-dev \
" \
&& apt-get install -y --no-install-recommends --no-install-suggests \
$buildDeps \
Expand All @@ -44,6 +44,9 @@ RUN apt-get update \
&& ./configure \
--prefix=/usr \
--sysconfdir=/etc/opendmarc \
--with-spf \
--with-spf2-lib=/usr/lib \
--with-spf2-include=/usr/include/spf2 \
# No documentation included to keep image size smaller
--docdir=/tmp/opendmarc/doc \
--infodir=/tmp/opendmarc/info \
Expand Down
12 changes: 12 additions & 0 deletions tests/main.bats
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@
[ "$actual" == "$expected" ]
}

@test "opendmarc: with SPF" {
run docker run --rm --pull never --entrypoint sh $IMAGE -c \
"opendmarc -V | grep -w 'WITH_SPF'"
[ "$status" -eq 0 ]
}

@test "opendmarc: with SPF2" {
run docker run --rm --pull never --entrypoint sh $IMAGE -c \
"opendmarc -V | grep -w 'WITH_SPF2'"
[ "$status" -eq 0 ]
}


@test "drop-in: opendmarc listens on 8890 port" {
run docker rm -f test-opendmarc
Expand Down

0 comments on commit 57aead9

Please sign in to comment.