procmail
[Top] [All Lists]

Re: MIME headers in Procmail

2011-07-09 17:14:05
John Levine wrote:

I could do something like this:

:0 c
| formail -xsubject |perl -Mencode -ne 'print 
encode("UTF8",decode("MIME-Header",$_))'>  /tmp/junk$$

SUBJ=`cat /tmp/junk$$`

but, uh, bletch.

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?

At least you wouldn't have that nasty temp file.
____________________________________________________________
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>