Re: MIME headers in Procmail

"Ruud H.G. van Tol" <[email protected]>
Newsgroups gmane.mail.procmail
Message-ID <[email protected]>
On 2011-07-10 01:58, John Levine wrote:
 > attribution dammit! wrote:

>> Then wouldn't the foillowing do the job?  (Sorry, not sure how my mailer
>> will wrap this, so I have to break the line in a way to get sane results.)
>>
>> :0
>> SUBJ=| formail -xsubject |perl -Mencode -ne \
>>   'print encode("UTF8",decode("MIME-Header",$_))'
>>
>>> and then do matches like
>>>
>>> * SUBJ ?? pattern
>>
>> as you said?
>
> You're right, that works. (Nobody ever said the procmail documentation
> was any good.)  But it still fires up a shell, formail, and a copy of
> perl, rather a lot of work, and you'd have to do it separately for
> each header line you'd want to match.

Too obvious: only call it if the message header contains non-ASCII, and 
make it do the full header in one call.

-- 
Ruud
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.