-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid (wrong body hash) due to no line breaks #20
Comments
I think you forgot the link. Mind attaching? |
Oops! Here you go: https://www.osso.nl/blog/thunderbird-postfix-dkim-invalid-body-hash/ I've logged into my spamdrain account and they say there's a problem as well. "Computed body hash is different from the expected one" |
The first header shown here is generated whenever I send emails from my email client (Thunderbird):
However this is an example of one sent from my rails app:
I modified the string so don't worry about its validity, I only illustrate the fact that the one sent from my email client has new lines and the one sent via the rails app is all on one line. |
I see what you mean. A lot of the clients wrap the header too. Let me see what I can find.
|
Related Perl lib for the wrapping: http://search.cpan.org/~jaslong/Mail-DKIM/lib/Mail/DKIM/TextWrap.pm |
I'm not sure that this Perl lib is what I need as I'm using RoR/ActionMailer to generate my emails. This gem hooks into ActionMailer during the delivery process which happens outside of the scope of my app. I tried forking your repo and figuring out at what point the headers are generated but I can't make heads or tails of how things come together. The wrapping would need to be done somewhere in this gem. |
Sorry for not clarifying, I just noted that as a reference to the Perl library which wraps the DKIM header. A new feature would be have to be added to provide the wrapping. If you are using the interceptor, the header is actually added here: https://github.com/jhawthorn/dkim/blob/master/lib/dkim/interceptor.rb#L18 |
I have a partial implementation of this feature at https://github.com/cg2v/dkim/tree/interceptor_wrap_dkim_header It has no new tests, and fails the Dkim::InterceptorTest#test_same_output_as_direct_usage because I implemented the change in mail/dkim_field.rb and the output no longer matches. |
@cg2v Definitely throw that over to a PR and lets get that going!!! The test failure is probably just because of assertion is against an unwrapped header. |
It doesn't assert against a fixed result that includes an unwrapped header, but against a call to Dkim.sign that generates one. If most people use Dkim.sign, then you need a solution that works there too. I didn't touch that part because the mixture of data and presentation in the Dkim::Header classes makes this harder. |
🆙 Hey! I know that time is a finite and precious resource, but can I get someone to look at this PR some time, or maybe the issue is a won't fix ? |
i.e., look here to see the issue. The error warning only appears in the Thunderbird dkim extension but I can't imagine this would be too hard a fix to implement the appropriate line breaks instead of having the entire DKIM key on one line in the email source.
The text was updated successfully, but these errors were encountered: