OpenDKIM icon indicating copy to clipboard operation
OpenDKIM copied to clipboard

Body with specified length doesn't end with CRLF will trigger 'CRLF at end of body missing'

Open mars90226 opened this issue 6 years ago • 2 comments

OpenDKIM will only receive message body with length specified in DKIM signature (l=), and reply SMFIS_SKIP to MTA. Thus, the body does not have to be ended with CRLF and should not trigger CRLF at end of body missing if CRLF is not exist.

According to the section 3.7 of RFC6376,

the Signer/Verifier MUST hash the message body,
   canonicalized using the body canonicalization algorithm specified in
   the "c=" tag and then truncated to the length specified in the "l="
   tag.

In addition to that, the "simple" and "relaxed" body canonicalization algorithm both suggest that if body is not empty and have no trailing CRLF, a CRLF is added. So, OpenDKIM should just append a CRLF to the body if body doesn't end with CRLF.

I suggest that this if-else block should be replaced by the if block.

mars90226 avatar Jul 11 '19 08:07 mars90226

You're mostly right. This should still be an error when "l=" wasn't used in the signature.

mskucherawy avatar Jul 24 '19 19:07 mskucherawy

Ah, yes. When the whole body is not actually ended with CRLF and there isn't l= in signature, OpenDKIM should throw syntax error. Otherwise, OpenDKIM should not care about CRLF at the end of body.

mars90226 avatar Jul 31 '19 07:07 mars90226