Launchpad encodes eMail Subject wrong
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
New
|
Undecided
|
Unassigned |
Bug Description
I just got an eMail with:
Subject: =?utf-8?
This obviously violates the usual RFCs. I suspect the underlying cause is https:/
For reference, here is how I encode the Subject header from a shell script (git post-receive hook):
' 2>/dev/null) || error-handling
This is for the Korn shell; for nōn-Korn shells, replace “print -nr -- "Subject: $subj"” with “printf 'Subject: %s' "$subj"”. For Python/py3k, you’d obviously just write the header to encode into the subprocess’ stdin.
Oh, and the “"\012"” is so the output has Unix line endings, for consistency with the rest; these are converted to CRLF later in my script, by the MSA. Use “"\015\012"” if you need it with CRLF right there.
----
cjwatson asked:
> In your Debian bug report you say that this is obviously broken and mention RFC822 in support of this, but I can't find any such limit in RFC822. Would you mind being more specific about the standard that is violated by this long header line?
Response:
Ah, right, in 822 itself it’s only alluded to; it’s a SHOULD in 2822 (but I generally say 822 when I mean 822/2822/5322/… because that’s the number I can remember).
RFC 2047 §2 does contain the relevant limitation:
While there is no limit to the length of a multiple-line header
field, each line of a header field that contains one or more
'encoded-word's is limited to 76 characters.
Sorry about that.