Fixing DKIM #1495

Merged
merged 4 commits into from Jun 4, 2016

Conversation

Projects
None yet
2 participants
@zllovesuki
Contributor

zllovesuki commented Jun 4, 2016

Changes proposed in this pull request:

  • Uses "UTF-8" in all toString
  • Remove whitespaces where Sig is broken into multi lines
  • Add CRLF to the end of body regardless of bodycanon (as described in http://dkimcore.org/specification.html)

zllovesuki added some commits Jun 4, 2016

fix dkim implentation where toString() encoding messes up body; where…
… multipart body has trailing CRLF will mess up body; add CRLF if there's no trailing CRLF (both bodycanon)

@baudehlo baudehlo merged commit 4ebdee7 into haraka:master Jun 4, 2016

2 checks passed

codecov/project 36.25% compared to d97fa4f
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@zllovesuki

This comment has been minimized.

Show comment
Hide comment
@zllovesuki

zllovesuki Jun 7, 2016

Contributor

In case people look back and question why CRLF is added regardless:

https://tools.ietf.org/html/rfc6376

For simple body:

The "simple" body canonicalization algorithm ignores all empty lines
   at the end of the message body.  An empty line is a line of zero
   length after removal of the line terminator.  If there is no body or
   no trailing CRLF on the message body, a CRLF is added.  It makes no
   other changes to the message body.  In more formal terms, the
   "simple" body canonicalization algorithm converts "*CRLF" at the end
   of the body to a single "CRLF".

   Note that a completely empty or missing body is canonicalized as a
   single "CRLF"; that is, the canonicalized length will be 2 octets.

For relaxed body:

Ignore all empty lines at the end of the message body.  "Empty
       line" is defined in Section 3.4.3.  If the body is non-empty but
       does not end with a CRLF, a CRLF is added.  (For email, this is
       only possible when using extensions to SMTP or non-SMTP transport
       mechanisms.)
Contributor

zllovesuki commented Jun 7, 2016

In case people look back and question why CRLF is added regardless:

https://tools.ietf.org/html/rfc6376

For simple body:

The "simple" body canonicalization algorithm ignores all empty lines
   at the end of the message body.  An empty line is a line of zero
   length after removal of the line terminator.  If there is no body or
   no trailing CRLF on the message body, a CRLF is added.  It makes no
   other changes to the message body.  In more formal terms, the
   "simple" body canonicalization algorithm converts "*CRLF" at the end
   of the body to a single "CRLF".

   Note that a completely empty or missing body is canonicalized as a
   single "CRLF"; that is, the canonicalized length will be 2 octets.

For relaxed body:

Ignore all empty lines at the end of the message body.  "Empty
       line" is defined in Section 3.4.3.  If the body is non-empty but
       does not end with a CRLF, a CRLF is added.  (For email, this is
       only possible when using extensions to SMTP or non-SMTP transport
       mechanisms.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment