[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Where to ask: Can procmail modify a header field? Add a header field?



On Tue, May 28, 2002 at 10:40:39PM -0400, Daniel Barclay wrote:
> Can someone point me to a good mailing list for asking the following 
> question?

Nope.  Sorry.  This one is as good as any.

> Can procmail modify a message header field (e.g., prepend "spam:" to
> the subject field value)?  Can it add a header field?

No, but the formail program, which comes with procmail, can.  Here's an
example from my .procmailrc:

ABUSE=`$HOME/bin/blacklist.pl`
:0 f
* ? [ -n "$ABUSE" ] && [ "$ABUSE" != "127.0.0.1" ]
| formail -A"X-SPAM-FROM-HELL: $ABUSE"

The important thing is the 'f' switch to the :0 line, which tells
procmail to treat this recipe as a filter.  Then the message is piped to
formail, which is told via the '-A' flag to add the given header.

noah

-- 
 _______________________________________________________
| Web: http://web.morgul.net/~frodo/
| PGP Public Key: http://web.morgul.net/~frodo/mail.html 

Attachment: pgpcDAlyZdp3u.pgp
Description: PGP signature


Reply to: