Hi, i'm having a rather strange problem with postfix+opendkim that I struggle with:
I have 2 milter stages in postfix, the first one is opendkim for dkim verification and the second one is rspamd (which also does dkim verification for spam detection).
Only on a very specific email, I have this behaviour:
When going through the milter:
opendkim fails the signature verification with "bad signature data".
rspamd successfully validates the dkim signature.
BUT
When I throw the message into "opendkim -t" it successfully validates the signature. But when I throw the message into "opendkim-testmsg", it returns "Bad signature".
I have no idea why this is inconsistent and what to do about it.
The email in question is attached.
RFC 6376 DomainKeys Identified Mail (DKIM) Signatures, Section 3.4.2. The "relaxed" Header Canonicalization Algorithm (https://tools.ietf.org/html/rfc6376#section-3.4.2) mandates:
-- unfold all header field continuation lines
-- delete any WSP characters remaining before and after the colon
So the header:
ABC:
def
is canonicalized as "abc:def".
The implementation of libopendkim however, first eats all WSP after the colon and then converts all isspace() characters to a single space character. So the above header is canonicalized with space after the colon as "abc: def".
Duplicate of [#226].
Related
Bugs:
#226