toorop / go-dkim

DKIM package for golang

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Relaxed body and empty message doesn't validate

wingedpig opened this issue · comments

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.