[ic] [interchange-core] Encoding of mail headers
Stefan Hornburg
racke at linuxia.de
Wed Mar 4 17:24:15 UTC 2009
David Christensen wrote:
> On Mar 4, 2009, at 9:27 AM, Stefan Hornburg wrote:
>
>> David Christensen wrote:
>>> On Mar 4, 2009, at 2:52 AM, Stefan Hornburg (Racke) wrote:
>>>
>>>> According to RFC 2047 mail headers with characters other than US-
>>>> ASCII needs
>>>> to be escaped. Interchange fails to do so, resulting in emails
>>>> delivered
>>>> which will be tagged by Spamassassin with SUBJECT_NEEDS_ENCODING and
>>>> SUBJ_ILLEGAL_CHARS.
>>>>
>>>> I wrote a simple filter which addresses this problem:
>>>>
>>>> CodeDef mime_encode_words Filter
>>>> CodeDef mime_encode_words Description Find MIME type of filename
>>>> CodeDef mime_encode_words Routine <<EOR
>>>>
>>>> use MIME::EncWords;
>>>>
>>>> sub {
>>>> return MIME::EncWords::encode_mimewords(shift);
>>>> }
>>>> EOR
>>>>
>>>> Of course the whole IC email infrastructure needs to be adjusted to
>>>> use
>>>> this.
>>> The Encode module also offers this capability, and has the benefit of
>>> being core. While we're doing this, we should revisit the body
>>> encoding as well. I definitely agree that this should be done.
>>>
>> How would this work with Encode?
>>
>> Regards
>> Racke
>
>
> use Encode qw(encode);
>
> sub mime_encode_header {
> return encode('MIME-Header',shift);
> }
>
In addition to Mike's concern, it doesn't emit a header which Thunderbird
displays correctly:
MIME:EncWords:
Subject: =?ISO-8859-1?Q?Bestellbest=C3=A4tigung?= F-Shop
Encode:
Subject: =?UTF-8?B?QmVzdGVsbGJlc3TDg8KkdGlndW5nIEYtU2hvcA==?=
Even with UTF-8 the ASCII characters should be legible.
Regards
Racke
--
LinuXia Systems => http://www.linuxia.de/
Expert Interchange Consulting and System Administration
ICDEVGROUP => http://www.icdevgroup.org/
Interchange Development Team
More information about the interchange-users
mailing list