From 33eae16ea291305c75aeb1bc45f424e202244572 Mon Sep 17 00:00:00 2001 From: Dan Mahoney Date: Fri, 5 Jun 2026 23:18:43 -0700 Subject: [PATCH 01/14] fix: declare opendmarc_policy_fetch_fo() in dmarc.h.in (#407) The function was implemented and documented but never declared in the public header, causing a build failure on Clang 15+ where implicit function declarations are an error rather than a warning. --- libopendmarc/dmarc.h.in | 1 + 1 file changed, 1 insertion(+) diff --git a/libopendmarc/dmarc.h.in b/libopendmarc/dmarc.h.in index 814b508..2c47f9b 100644 --- a/libopendmarc/dmarc.h.in +++ b/libopendmarc/dmarc.h.in @@ -142,6 +142,7 @@ OPENDMARC_STATUS_T opendmarc_policy_fetch_adkim(DMARC_POLICY_T *pctx, int *adkim OPENDMARC_STATUS_T opendmarc_policy_fetch_aspf(DMARC_POLICY_T *pctx, int *aspf); OPENDMARC_STATUS_T opendmarc_policy_fetch_p(DMARC_POLICY_T *pctx, int *p); OPENDMARC_STATUS_T opendmarc_policy_fetch_sp(DMARC_POLICY_T *pctx, int *sp); +OPENDMARC_STATUS_T opendmarc_policy_fetch_fo(DMARC_POLICY_T *pctx, int *fo); u_char ** opendmarc_policy_fetch_rua(DMARC_POLICY_T *pctx, u_char *list_buf, size_t size_of_buf, int constant); u_char ** opendmarc_policy_fetch_ruf(DMARC_POLICY_T *pctx, u_char *list_buf, size_t size_of_buf, int constant); OPENDMARC_STATUS_T opendmarc_policy_fetch_utilized_domain(DMARC_POLICY_T *pctx, u_char *buf, size_t buflen); From cedc8eb6ed53d9fea57b3f5097fee1bc2a0e1606 Mon Sep 17 00:00:00 2001 From: Dan Mahoney Date: Fri, 5 Jun 2026 23:21:59 -0700 Subject: [PATCH 02/14] ci: add macOS build and test job Catches Clang-strict build failures (like the missing opendmarc_policy_fetch_fo declaration in issue #407) that go undetected on the Linux/GCC job. --- .github/workflows/ci.yml | 51 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a3dfd92..a1a7fa0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,3 +62,54 @@ jobs: - name: Test run: make check + + build-test-macos: + runs-on: macos-latest + + steps: + - uses: actions/checkout@v4 + + - name: Install dependencies + run: | + brew install \ + autoconf automake libtool pkg-config \ + openssl libmilter \ + lua \ + cpanminus + cpanm --notest DBI LWP IO::Compress JSON Net::DNS + + - name: Build miltertest + run: | + git clone --depth=1 https://github.com/thegushi/miltertest.git /tmp/miltertest + cd /tmp/miltertest + autoreconf -fvi + ./configure \ + CFLAGS='-g -O2 -Wno-pointer-sign' \ + CPPFLAGS="-I$(brew --prefix openssl)/include -I$(brew --prefix libmilter)/include" \ + LDFLAGS="-L$(brew --prefix openssl)/lib -L$(brew --prefix libmilter)/lib" + make -j$(sysctl -n hw.logicalcpu) + sudo make install + + - name: Bootstrap build system + run: autoreconf -fvi + + - name: Configure + run: | + ./configure --enable-live-tests \ + CFLAGS='-g -O2 -Wno-pointer-sign' \ + CPPFLAGS="-I$(brew --prefix openssl)/include -I$(brew --prefix libmilter)/include" \ + LDFLAGS="-L$(brew --prefix openssl)/lib -L$(brew --prefix libmilter)/lib" + + - name: Build + run: make -j$(sysctl -n hw.logicalcpu) + + - name: Check Perl syntax + run: | + perl -c reports/opendmarc-expire + perl -c reports/opendmarc-import + perl -c reports/opendmarc-importstats + perl -c reports/opendmarc-params + perl -c reports/opendmarc-reports + + - name: Test + run: make check From b1dd8d3b5ebb7f908a5381e54dcecbfe9928d602 Mon Sep 17 00:00:00 2001 From: Dan Mahoney Date: Fri, 5 Jun 2026 23:23:53 -0700 Subject: [PATCH 03/14] ci: fix macOS libmilter install -- use sendmail formula libmilter is not a standalone Homebrew formula; it comes from sendmail. --- .github/workflows/ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a1a7fa0..257a442 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,7 +73,7 @@ jobs: run: | brew install \ autoconf automake libtool pkg-config \ - openssl libmilter \ + openssl sendmail \ lua \ cpanminus cpanm --notest DBI LWP IO::Compress JSON Net::DNS @@ -85,8 +85,8 @@ jobs: autoreconf -fvi ./configure \ CFLAGS='-g -O2 -Wno-pointer-sign' \ - CPPFLAGS="-I$(brew --prefix openssl)/include -I$(brew --prefix libmilter)/include" \ - LDFLAGS="-L$(brew --prefix openssl)/lib -L$(brew --prefix libmilter)/lib" + CPPFLAGS="-I$(brew --prefix openssl)/include -I$(brew --prefix sendmail)/include" \ + LDFLAGS="-L$(brew --prefix openssl)/lib -L$(brew --prefix sendmail)/lib" make -j$(sysctl -n hw.logicalcpu) sudo make install @@ -97,8 +97,8 @@ jobs: run: | ./configure --enable-live-tests \ CFLAGS='-g -O2 -Wno-pointer-sign' \ - CPPFLAGS="-I$(brew --prefix openssl)/include -I$(brew --prefix libmilter)/include" \ - LDFLAGS="-L$(brew --prefix openssl)/lib -L$(brew --prefix libmilter)/lib" + CPPFLAGS="-I$(brew --prefix openssl)/include -I$(brew --prefix sendmail)/include" \ + LDFLAGS="-L$(brew --prefix openssl)/lib -L$(brew --prefix sendmail)/lib" - name: Build run: make -j$(sysctl -n hw.logicalcpu) From 26bfcfceed078cf88c689dba4dd722a9cd2de59f Mon Sep 17 00:00:00 2001 From: Dan Mahoney Date: Fri, 5 Jun 2026 23:26:01 -0700 Subject: [PATCH 04/14] ci: build libmilter from sendmail source on macOS Neither libmilter nor sendmail exist as Homebrew formulae; build from the sendmail source tarball instead. --- .github/workflows/ci.yml | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 257a442..451235a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,11 +73,23 @@ jobs: run: | brew install \ autoconf automake libtool pkg-config \ - openssl sendmail \ + openssl \ lua \ cpanminus cpanm --notest DBI LWP IO::Compress JSON Net::DNS + - name: Build and install libmilter from source + run: | + SENDMAIL_VER=8.18.1 + curl -fsSL "https://ftp.sendmail.org/pub/sendmail/sendmail.${SENDMAIL_VER}.tar.gz" | tar xz -C /tmp + cd /tmp/sendmail-${SENDMAIL_VER}/libmilter + ./Build + OBJDIR=$(echo obj.*) + sudo mkdir -p /usr/local/include/libmilter /usr/local/lib + sudo cp ../include/sendmail.h /usr/local/include/ + sudo cp mfapi.h mfdef.h /usr/local/include/libmilter/ + sudo cp ${OBJDIR}/libmilter.a /usr/local/lib/ + - name: Build miltertest run: | git clone --depth=1 https://github.com/thegushi/miltertest.git /tmp/miltertest @@ -85,8 +97,8 @@ jobs: autoreconf -fvi ./configure \ CFLAGS='-g -O2 -Wno-pointer-sign' \ - CPPFLAGS="-I$(brew --prefix openssl)/include -I$(brew --prefix sendmail)/include" \ - LDFLAGS="-L$(brew --prefix openssl)/lib -L$(brew --prefix sendmail)/lib" + CPPFLAGS="-I$(brew --prefix openssl)/include -I/usr/local/include" \ + LDFLAGS="-L$(brew --prefix openssl)/lib -L/usr/local/lib" make -j$(sysctl -n hw.logicalcpu) sudo make install @@ -97,8 +109,8 @@ jobs: run: | ./configure --enable-live-tests \ CFLAGS='-g -O2 -Wno-pointer-sign' \ - CPPFLAGS="-I$(brew --prefix openssl)/include -I$(brew --prefix sendmail)/include" \ - LDFLAGS="-L$(brew --prefix openssl)/lib -L$(brew --prefix sendmail)/lib" + CPPFLAGS="-I$(brew --prefix openssl)/include -I/usr/local/include" \ + LDFLAGS="-L$(brew --prefix openssl)/lib -L/usr/local/lib" - name: Build run: make -j$(sysctl -n hw.logicalcpu) From 8485b11b2af673f9f4b4caa99f70a40ebe17e59b Mon Sep 17 00:00:00 2001 From: Dan Mahoney Date: Fri, 5 Jun 2026 23:30:49 -0700 Subject: [PATCH 05/14] ci: fix sendmail version to 8.18.2; add debug output for build paths --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 451235a..c70d944 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,10 +80,12 @@ jobs: - name: Build and install libmilter from source run: | - SENDMAIL_VER=8.18.1 + SENDMAIL_VER=8.18.2 curl -fsSL "https://ftp.sendmail.org/pub/sendmail/sendmail.${SENDMAIL_VER}.tar.gz" | tar xz -C /tmp cd /tmp/sendmail-${SENDMAIL_VER}/libmilter + ls /tmp/sendmail-${SENDMAIL_VER}/ # debug: confirm extraction layout ./Build + find . -name "libmilter.a" # debug: show actual output path OBJDIR=$(echo obj.*) sudo mkdir -p /usr/local/include/libmilter /usr/local/lib sudo cp ../include/sendmail.h /usr/local/include/ From 19d180585f89676c36d37f4e9db97aa98c3765bc Mon Sep 17 00:00:00 2001 From: Dan Mahoney Date: Fri, 5 Jun 2026 23:31:43 -0700 Subject: [PATCH 06/14] ci: use ftp:// URL for sendmail source tarball --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c70d944..2ecdf2a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -81,7 +81,7 @@ jobs: - name: Build and install libmilter from source run: | SENDMAIL_VER=8.18.2 - curl -fsSL "https://ftp.sendmail.org/pub/sendmail/sendmail.${SENDMAIL_VER}.tar.gz" | tar xz -C /tmp + curl -fsSL "ftp://ftp.sendmail.org/pub/sendmail/sendmail.${SENDMAIL_VER}.tar.gz" | tar xz -C /tmp cd /tmp/sendmail-${SENDMAIL_VER}/libmilter ls /tmp/sendmail-${SENDMAIL_VER}/ # debug: confirm extraction layout ./Build From 6da1d1061d12766169122d95996ed7f499c3fea3 Mon Sep 17 00:00:00 2001 From: Dan Mahoney Date: Fri, 5 Jun 2026 23:33:17 -0700 Subject: [PATCH 07/14] ci: fix libmilter install paths on macOS libmilter.a builds in the current directory, not obj.*/; only mfapi.h and mfdef.h need to be installed, not the internal sendmail.h. --- .github/workflows/ci.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2ecdf2a..a4145ac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -83,14 +83,10 @@ jobs: SENDMAIL_VER=8.18.2 curl -fsSL "ftp://ftp.sendmail.org/pub/sendmail/sendmail.${SENDMAIL_VER}.tar.gz" | tar xz -C /tmp cd /tmp/sendmail-${SENDMAIL_VER}/libmilter - ls /tmp/sendmail-${SENDMAIL_VER}/ # debug: confirm extraction layout ./Build - find . -name "libmilter.a" # debug: show actual output path - OBJDIR=$(echo obj.*) sudo mkdir -p /usr/local/include/libmilter /usr/local/lib - sudo cp ../include/sendmail.h /usr/local/include/ sudo cp mfapi.h mfdef.h /usr/local/include/libmilter/ - sudo cp ${OBJDIR}/libmilter.a /usr/local/lib/ + sudo cp libmilter.a /usr/local/lib/ - name: Build miltertest run: | From 9a4b5db7af971434c2dedb8852952d32cb4de28e Mon Sep 17 00:00:00 2001 From: Dan Mahoney Date: Fri, 5 Jun 2026 23:35:20 -0700 Subject: [PATCH 08/14] ci: fix libmilter header source path -- headers are in ../include/libmilter/ --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a4145ac..38a99c4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -85,7 +85,7 @@ jobs: cd /tmp/sendmail-${SENDMAIL_VER}/libmilter ./Build sudo mkdir -p /usr/local/include/libmilter /usr/local/lib - sudo cp mfapi.h mfdef.h /usr/local/include/libmilter/ + sudo cp ../include/libmilter/mfapi.h ../include/libmilter/mfdef.h /usr/local/include/libmilter/ sudo cp libmilter.a /usr/local/lib/ - name: Build miltertest From 061411611f246aab304690c828e2714f068cad53 Mon Sep 17 00:00:00 2001 From: Dan Mahoney Date: Fri, 5 Jun 2026 23:37:00 -0700 Subject: [PATCH 09/14] ci: fix libmilter.a path -- lives in obj.*/libmilter/libmilter.a --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 38a99c4..10e106e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -86,7 +86,7 @@ jobs: ./Build sudo mkdir -p /usr/local/include/libmilter /usr/local/lib sudo cp ../include/libmilter/mfapi.h ../include/libmilter/mfdef.h /usr/local/include/libmilter/ - sudo cp libmilter.a /usr/local/lib/ + sudo cp obj.*/libmilter/libmilter.a /usr/local/lib/ - name: Build miltertest run: | From 7b607c841545149eb4df6e32f96cb0c04bd4b9d0 Mon Sep 17 00:00:00 2001 From: Dan Mahoney Date: Fri, 5 Jun 2026 23:40:38 -0700 Subject: [PATCH 10/14] ci: fix libmilter.a path -- use find instead of glob --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 10e106e..70dca3b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -86,7 +86,7 @@ jobs: ./Build sudo mkdir -p /usr/local/include/libmilter /usr/local/lib sudo cp ../include/libmilter/mfapi.h ../include/libmilter/mfdef.h /usr/local/include/libmilter/ - sudo cp obj.*/libmilter/libmilter.a /usr/local/lib/ + sudo cp "$(find . -name 'libmilter.a' | head -1)" /usr/local/lib/ - name: Build miltertest run: | From c51cc8a8a6ef811e3b7583f5c21cf4da6f407eb4 Mon Sep 17 00:00:00 2001 From: Dan Mahoney Date: Fri, 5 Jun 2026 23:44:54 -0700 Subject: [PATCH 11/14] ci: search parent dir for libmilter.a -- Build outputs to ../obj.*/ --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 70dca3b..e8f84c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -86,7 +86,7 @@ jobs: ./Build sudo mkdir -p /usr/local/include/libmilter /usr/local/lib sudo cp ../include/libmilter/mfapi.h ../include/libmilter/mfdef.h /usr/local/include/libmilter/ - sudo cp "$(find . -name 'libmilter.a' | head -1)" /usr/local/lib/ + sudo cp "$(find .. -name 'libmilter.a' | head -1)" /usr/local/lib/ - name: Build miltertest run: | From 7a88d62a9c28a27a9adb810b95b9f74ad4e888b3 Mon Sep 17 00:00:00 2001 From: Dan Mahoney Date: Fri, 5 Jun 2026 23:46:23 -0700 Subject: [PATCH 12/14] ci: build miltertest with -std=gnu11 on macOS mfapi.h typedef's bool which conflicts with C23 where bool is a keyword. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e8f84c3..4c9aa06 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -94,7 +94,7 @@ jobs: cd /tmp/miltertest autoreconf -fvi ./configure \ - CFLAGS='-g -O2 -Wno-pointer-sign' \ + CFLAGS='-g -O2 -Wno-pointer-sign -std=gnu11' \ CPPFLAGS="-I$(brew --prefix openssl)/include -I/usr/local/include" \ LDFLAGS="-L$(brew --prefix openssl)/lib -L/usr/local/lib" make -j$(sysctl -n hw.logicalcpu) From db445a54041d791dceae55cde5dc04b9ef27da3e Mon Sep 17 00:00:00 2001 From: Dan Mahoney Date: Fri, 5 Jun 2026 23:48:15 -0700 Subject: [PATCH 13/14] ci: build OpenDMARC with -std=gnu11 on macOS Same mfapi.h bool conflict as miltertest; gcc defaults to gnu23 on this runner. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4c9aa06..5a4e7e2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -106,7 +106,7 @@ jobs: - name: Configure run: | ./configure --enable-live-tests \ - CFLAGS='-g -O2 -Wno-pointer-sign' \ + CFLAGS='-g -O2 -Wno-pointer-sign -std=gnu11' \ CPPFLAGS="-I$(brew --prefix openssl)/include -I/usr/local/include" \ LDFLAGS="-L$(brew --prefix openssl)/lib -L/usr/local/lib" From 48a6ef01161f3c8d5d8ac109f2f0667a6ab5e322 Mon Sep 17 00:00:00 2001 From: Dan Mahoney Date: Sat, 6 Jun 2026 00:00:55 -0700 Subject: [PATCH 14/14] docs: add CHANGES entries for #407 (missing header) and macOS CI --- CHANGES-202605.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES-202605.md b/CHANGES-202605.md index 7b11d3a..5d31d03 100644 --- a/CHANGES-202605.md +++ b/CHANGES-202605.md @@ -167,6 +167,9 @@ CREATE TABLE IF NOT EXISTS suppressions ( ## Build system and portability +- **`opendmarc_policy_fetch_fo()` missing from public header**: The function was implemented and documented but never declared in `dmarc.h.in`, causing a build failure on Clang 15+ (including Apple Clang 21 on macOS) where implicit function declarations are a hard error rather than a warning. (#408, issue #407) +- **macOS CI job added**: GitHub Actions now builds and tests on `macos-latest` in addition to `ubuntu-latest`, catching Clang-strict build failures that go undetected on the Linux/GCC job. libmilter is built from the sendmail source tarball; `-std=gnu11` is required because sendmail's `mfapi.h` typedef's `bool`, which conflicts with C23 where `bool` is a keyword. + - **`opendmarc-spf-parse.c` missing from `Makefile.am`**: The Received-SPF parser source file added in the crash fixes was not listed in `opendmarc_SOURCES`, causing a link failure on clean builds. (#335, issue #334) - **Perl path hardcoded in report scripts**: `#!/usr/bin/perl` was hardcoded in `opendmarc-reports`, `opendmarc-import`, and related scripts. The path is now detected by `configure` and substituted as `@PERL@`. (#318) - **`Switch` module dependency removed**: The report scripts used `Switch`, which was removed from core Perl in 5.36 and requires a separate CPAN install on modern systems. All `switch`/`case` blocks have been converted to `if`/`elsif`/`else`. (#336)