Hi,While investigating a DKIM verification failure on my OpenBSD 7.9 amd64 mail server running opendkim-2.10.3p3, I encountered a known bug in libopendkim affecting relaxed canonicalization of headers folded immediately after the colon.
OpenDKIM reported "bad signature data", while SpamAssassin using Mail::DKIM successfully verified the signature.
References: - https://sourceforge.net/p/opendkim/bugs/226/ - https://bugs.debian.org/840015 - RFC 6376, section 3.4.2.The fix is a one-line change in libopendkim/dkim-canon.c, replacing DKIM_ISWSP with DKIM_ISLWSP when skipping whitespace before the first word.
I reproduced the bug directly against the installed libopendkim.a using a standalone regression test.
Before the fix: plain PASS [subject:Test] len=12 folded-space FAIL [subject: Test] len=13 folded-tab FAIL [subject: Test] len=13 folded-mixed FAIL [subject: Test] len=13 no-space PASS [subject:Test] len=12 Failed tests: 3 After the fix: plain PASS [subject:Test] len=12 folded-space PASS [subject:Test] len=12 folded-tab PASS [subject:Test] len=12 folded-mixed PASS [subject:Test] len=12 no-space PASS [subject:Test] len=12 Failed tests: 0 The upstream libopendkim test suite also passed all 156 tests.I rebuilt the OpenBSD 7.9 port with this fix and installed it on my production mail server. Both DKIM signing and verification are operational.
I also checked the current ports tree via AnonCVS on November 25, 2026 (Makefile revision 1.10, opendkim-2.10.3p4). The GitHub distfile still contains the affected code, and the fix is missing from the port's patchset.
The attached port diff adds the fix and bumps REVISION to 5. Both the source patch and the complete port diff have been checked against the current sources and apply cleanly.
Build and runtime testing were performed on OpenBSD 7.9 amd64, not on -current.
Since the issue is present in both OpenBSD 7.9 and -current, OpenBSD 8.0 is likely affected as well, although I have not checked that branch separately.
Please consider including this fix in the current port and backporting it to the 8.0-stable branch, if affected.
The port diff and standalone regression test are attached. -- JR +421903550345
dkim-canon-test.c
Description: Binary data
opendkim-current.patch
Description: Binary data
