Skip Menu |

This queue is for tickets about the Mail-DKIM CPAN distribution.

Report information
The Basics
Id: 54808
Status: resolved
Priority: 0/
Queue: Mail-DKIM

People
Owner: jason [...] long.name
Requestors: yyang [...] proofpoint.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.37
Fixed in: (no value)



Subject: Mail::DKIM::Signer::headers() should add space around ":" to avoid header encoding due to line-length limits
According to RFC 4871: h= Signed header fields (plain-text, but see description; REQUIRED). A colon-separated list of header field names that identify the header fields presented to the signing algorithm. The field MUST contain the complete list of header fields in the order presented to the signing algorithm. The field MAY contain names of header fields that do not exist when signed; nonexistent header fields do not contribute to the signature computation (that is, they are treated as the null input, including the header field name, the separating colon, the header field value, and any CRLF terminator). The field MUST NOT include the DKIM-Signature header field that is being created or verified, but may include others. Folding whitespace (FWS) MAY be included on either side of the colon separator. Header field names MUST be compared against actual header field names in a case-insensitive manner. This list MUST NOT be empty. See Section 5.4 for a discussion of choosing header fields to sign. "olding whitespace (FWS) MAY be included on either side of the colon separator. " --- lib/Mail/DKIM/Signer.pm 2010-02-19 11:51:50.000000000 -0800 +++ lib/Mail/DKIM/Signer.pm.new 2010-02-19 11:52:53.000000000 -0800 @@ -436,7 +436,7 @@ grep { my $a = $_; scalar grep { lc($a) eq lc($_) } @wanted_headers } @found_headers; - return join(":", @headers); + return join(" : ", @headers); }
On Fri Feb 19 15:22:03 2010, yyang wrote: Show quoted text
>... >to avoid header encoding due to line-length limits
Yes, well, it may not be properly documented, but the solution to avoiding line-length limits is to add the following line to the code that uses the Mail::DKIM module. use Mail::DKIM::TextWrap; When that module is imported, then the Signer object will insert linebreaks in the signature so that its lines will be each less than 80 characters. In version 0.38 (just released), I have included the `use Mail::DKIM::TextWrap;' line in my example codes. Jason