go-dkim
go-dkim copied to clipboard
Relaxed body and empty message doesn't validate
Best I can tell from reading the RFC and your code, you're processing relaxed bodies correctly. But I have verified with three different services, including Gmail and Yahoo Mail, that messages sent by them with empty bodies do not verify. The fix is easy (I don't have a PR because I've modified the code a bunch for other reasons). In dkim.go, line 361, wrap that append line with a "if len(body) > 0" conditional.
It's easy to test. In Gmail, send yourself a blank message. Then validate its DKIM sig.