Strip 8th bit in all headers

From: Alexey Lobanov (
Date: Tue 25 Feb 2003 - 14:14:00 GMT

  • Next message: Pavol Luptak: "Sanifilter - live or dead project?"


    I am trying to implement another paranoid header sanitizing: assuming valid RFC2822
    headers may not contain any non-ascii symbols except properly mime-2 wrapped in
    accordance with RFC2231.

    The obvious operator is something like

            $line =~ tr [\240-\377] [\040-\177];
            $line =~ s/[\000-\010][\014-\037][\200-\237]/\?/g;

    before any other header processing.

    The problem is place. I could not find in what point of MIMEStream (?) should it be done.
    For ALL headers, no exclusions. And not damaging [properly defined in Content-transfer-
    encoding: 8BIT] 8-bit message body.

    Any suggests?

    from very 8-bit Russia

    hosted by