/   \         Server: marzen.de
    |     |        Datum:  20.10.2017
    |     |        Zeit:   03:32:24
[Startseite] [Holger] [fixqp]

Fixing broken QP-encodings in mail headers

Holger Marzen 

Some old email clients (e.g. Apple Mail 2.753.1) and some web
applications send e-mails with headers containing spaces in Quoted
Printable encoded sections. This is a violation of RFC 2047:

RFC 2047:

   IMPORTANT: 'encoded-word's are designed to be recognized as 'atom's
   by an RFC 822 parser. As a consequence, unencoded white space
   characters (such as SPACE and HTAB) are FORBIDDEN within an
   'encoded-word'. For example, the character sequence

      =?iso-8859-1?q?this is some text?=

   would be parsed as four 'atom's, rather than as a single 'atom' (by
   an RFC 822 parser) or 'encoded-word' (by a parser which understands
   'encoded-words'). The correct way to encode the string "this is some
   text" is to encode the SPACE characters as well, e.g.


   The characters which may appear in 'encoded-text' are further
   restricted by the rules in section 5.

Such e-mails can be fixed with procmail and a Perl script.

[Startseite] [Holger] [fixqp]