Re: MIME headers in Procmail
"David W. Tamkin" <[email protected]>
| Newsgroups | gmane.mail.procmail |
|---|---|
| Message-ID | <[email protected]> |
Ruud H.G. van Tol wrote: > On 2011-07-10 01:58, John Levine wrote: >> 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. 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. So we're down from firing up formail, a shell, and perl for each desired header to firing up perl once for each message that needs the work.