jhawthorn / dkim

:envelope: Pure Ruby DKIM signature library with Rails integration
93 stars 18 forks source link

Signing too early #12

Closed janithp closed 10 years ago

janithp commented 10 years ago

Hi,

we're using the gem with ActionMailer 3.2.13 and Rails 3.2. Interceptor seems to be able to sign the message. But Using port25 verifier it fails saying "fail (wrong body hash: expected n9hw0s6A+39X2zHc07dPuzj1783GTadt3NHjLpqyZ/g=)".

I tried different lengths of html body in the email and it passes for small email body but fail for large ones. Is it possible that register_interceptor(Dkim::Interceptor) binds too early?

I have dkim initializer that calls register_interceptor. I'm also using html and text templates with ActionMailer.

Any ideas?

carsonreinke commented 10 years ago

Is it possible your MTA is modifying the message? Try manually signing without the interceptor. Though, unless you have another interceptor, it is unlikely that the signed message is being modified via Mail gem.

jhawthorn commented 10 years ago

@janithp is it possible for you to provide the exact signed message which had an incorrect body hash? (value of mail.to_s after delivery would provide this)

janithp commented 10 years ago

Thank for the support! Actually it seemed to just start working all of a sudden. This was a strange one. But this is not an issue anymore, I will close it.