procmail
[Top] [All Lists]

Re: MIME headers in Procmail

2011-07-10 09:01:55
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,

Then I have to do two versions of everything else in the procmail
file, one to match the plain subject (or whatever) line and one to
match the flattened variable.

and make it do the full header in one call.

Keeping in mind that the goal is to have something that I can match
in subsequent recipes, please show sample code.  This doesn't do anything
useful, since you can't predict which order the headers will be in (it's
whatever order they are in the incoming message), and the perl module
won't pick up the MIME cruft unless it's the first thing on the first line:

:0 H
SUBJ=| formail -xsubject -xfrom |perl -MEncode -ne 'print 
encode("UTF8",decode("MIME-Header",$_))'



R's,
John
____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)de
http://mailman.rwth-aachen.de/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>