Results 1 to 4 of 4
  1. #1
    Regular GreenReaper's Avatar
    Weasyl
    GreenReaper
    Join Date
    Jul 2012
    Location
    London, UK
    Posts
    34

    Subscription email broken due to embedded newlines in DKIM-Signature header

    When receiving a thread subscription email, I noticed that the DKIM-Signature header had doubled newlines after every line, starting after "i=@weasyl.com;"

    Double newlines in an email indicate the end of the header section, and thus all headers subsequent to this are dumped into the body of the email, including rather important ones like "From" and "Subject".

  2.   Click here to go to the next staff post in this thread.   #2
    looks like you're using a broken e-mail client. I made the forums send me an e-mail, and the DKIM-Signature is delimited with an (unusual, but valid) CRCRLF.

  3. #3
    Regular GreenReaper's Avatar
    Weasyl
    GreenReaper
    Join Date
    Jul 2012
    Location
    London, UK
    Posts
    34
    It's not valid, because CR is not a valid character by itself; it must be included as the unit CRLF if used as folding whitespace. CR is not a member of NO-WS-CTL (which defines the control characters which may be used in certain contexts), nor is it a valid part of an atom.

    Mail clients will vary as to how they handle non-conforming text, but they should all work if the excess CR is removed.

    If PHP and mail() is involved, the solution may be to use PHP_EOL rather than "\r\n", because a non-Windows transfer agent may translate the second \n into a CR LF, resulting in CR CR LF.
    Last edited by GreenReaper; 06-10-2014 at 02:55 AM.

  4.   This is the last staff post in this thread.   #4
    Quote Originally Posted by GreenReaper View Post
    It's not valid, because CR is not a valid character by itself; it must be included as the unit CRLF if used as folding whitespace. CR is not a member of NO-WS-CTL (which defines the control characters which may be used in certain contexts), nor is it a valid part of an atom.

    Mail clients will vary as to how they handle non-conforming text, but they should all work if the excess CR is removed.
    trap sprung.

    If PHP and mail() is involved, the solution may be to use PHP_EOL rather than "\r\n", because a non-Windows transfer agent may translate the second \n into a CR LF, resulting in CR CR LF.
    the only box with the DKIM key never has had/never will have php installed, so this is totally irrelevant.

    anyway, it's fixed now. dkimsign(1) is a bit funky.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •