[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: procmail and Unicode header lines (RFC 2047)



On 2010-10-29 21:35, Bob Proulx wrote:
> Stanisław Findeisen wrote:
>> Is there any support in Debian for Unicode e-mail header lines
>> processing, e.g. with procmail?
>> Subject: =?ISO-2022-JP?B?GyRCNEE7eiROJTUlViU4JSclLyVIGyhC?=
>>
>> so they need to be decoded before doing anything useful with them. (See:
>> http://www.debian.org/doc/manuals/intro-i18n/ch-internet.en.html)
> 
> As far as I know there is no support in procmail for decoding those
> fields.  I have always needed to create rules working with the encoded
> data.
> 
> Example from some localized mailman filtering:
>   * 1^0 ^Subject: [^ ]+ post from
>   * 1^0 ^Subject: .*El_envio_a_
>   * 1^0 ^Subject: .*Un_envoi_sur_la_liste_
>   * 1^0 ^Subject: .*_taraf=FDndan_g=F6nderilen_
> 
> Using wildcards for the interesting characters has worked fairly well
> with the European languages.  But I have no experience and no
> suggestion for your example JP locale though.

Hm I wrote this little script:

http://people.eisenbits.com/~stf/software/conv2047/

It is easy to use it in .procmailrc along with formail (you decode
encoded subject (or any other field) and *then* you search for your
patterns of interest). Then you can, for instance, modify the subject
and encode it back.

It works for me, at least.

-- 
http://people.eisenbits.com/~stf/
OpenPGP: DFD9 0146 3794 9CF6 17EA  D63F DBF5 8AA8 3B31 FE8A

Like hardship, risk & challenge?  --- Follow Jesus!!


Reply to: