Subject: [ietf-822] Mail headers on crack....

From: [email-masked]
Date: Thu, 14 Feb 2019 23:45:19 -0500

(Not sure if this list is still active, trying anyhow...)

So I'm updating my "List of things that the exmh MUA gets wrong", and I
have this in an item in the folder I use as a rogue's gallery of test cases...

MIME-Version: =?UTF-8?B?MS4w?=
Content-Transfer-Encoding: =?UTF-8?B?OGJpdA==?=
Content-Type: =?UTF-8?B?dGV4dC9wbGFpbjsgY2hhcnNldD1VVEYtOA==?=
Content-Disposition: =?UTF-8?B?aW5saW5l?=

Ugly as it is, I can't find where in the RFCs it says this is a no-no. Or
is this actually wonky-but-legal?

(I have to fix it in exmh whether this case is legal or not - its decoder
for UTF-8 in headers in general gets the length wrong and occasionally sticks 2
extra corrupt bytes onto the end of the decoded string)

---

From: Tony Finch <[email-masked]>
Date: Fri, 15 Feb 2019 12:10:33 +0000

> is this actually wonky-but-legal?

Invalid, because ...

RFC 2047 section 5:

(1) An 'encoded-word' may replace a 'text' token (as defined by RFC 822)
    in any Subject or Comments header field, any extension message
    header field, or any MIME body part field for which the field body
    is defined as '*text'.  An 'encoded-word' may also appear in any
    user-defined ("X-") message or body part header field.

RFC 2045 section 4:

     version := "MIME-Version" ":" 1*DIGIT "." 1*DIGIT

RFC 2045 section 6.1:

     encoding := "Content-Transfer-Encoding" ":" mechanism

     mechanism := "7bit" / "8bit" / "binary" /
                  "quoted-printable" / "base64" /
                  ietf-token / x-token

RFC 2045 section 5.1:

     content := "Content-Type" ":" type "/" subtype
                *(";" parameter)
                ; Matching of media type and subtype
                ; is ALWAYS case-insensitive.

RFC 2183 section 2:

     disposition := "Content-Disposition" ":"
                    disposition-type
                    *(";" disposition-parm)

Tony.
-- 
f.anthony.n.finch  <[email-masked]>  http://dotat.at/
Great Orme Head to the Mull of Galloway: South or southeast 5 or 6, veering
south or southwest 6 or 7, decreasing 4 or 5 later. Moderate, occasionally
rough. Occasional drizzle. Moderate or good, occasionally poor.