Re: MIME headers in Procmail
John Levine <[email protected]>
| Newsgroups | gmane.mail.procmail |
|---|---|
| Message-ID | <[email protected]> |
>And then, since the headerfield names are still there (formail -X would
>have kept them as well, but if you're not calling formail at all in order
>to save the formail and shell calls, they'll certainly be there), you can
>use procmail's internal parsing to extract SUBJ, TO, FROM, or whatever
>other variables you want, and then use them in subsequent conditions.
Hm, this more or less seems to work. Ugh.
:0 H
SUBJ=| formail -fXsubject -Xfrom |perl -MEncode -ne 'print encode("UTF8",decode("MIME-Header",$_))'
:0 ci
* SUBJ ?? Subject:\/.*
| echo "subject is $MATCH"
:0 ci
* SUBJ ?? From:\/.*
| echo "from is $MATCH"