On Wed, 20 May 1998, Matt Cortes wrote:
exact same machine. The problem though is how do I make a filter that
will account for host names sometimes showing and sometimes not showing.
First, you've used the ^TO token wrong. It's a token for a big regexp that
includes the colon and leading text, so you don't need ":.*". I like to
add () to it for a visual seperator. They do nothing to the regexp in this
The regexp I've added to allow zero or more unknown hostnames is
I've also added a \ to escpe the regexp meaning of ".", and added the
procmail token " \> " to match the end of a word, so that the expression
won't match "pulsar.netcom.com".
One other thing too is I know there is a ^TO macro which covers the To:,
Cc:, and Bcc: fields.. but is there a macro for the entire header? Like
what if I want to filter mail that has a maillist address ANYWHERE in the
header? I have some maillists which sometimes has its address in the
From: field, and sometimes its in the To: field (And yet it gets to me
somehow. heh). Or is that where I need to start using muliple
conditions? If so an example would be great.
By default, procmail feeds the entire head to the condition line. The
exception is when the recipe has the B or HB flags on the start of the
recipe. This condition line will match "foo(_at_)bar" anywhere in the head:
or better still: ( in this example the () actuallly does something! )
Most of this is covered pretty well in the procmailrc manpage and the
egrep manpage, with examples in the procmailex manpage.