procmail
[Top] [All Lists]

Re: procmail works at command line but .procmailrc is not filtering - RESEND

2000-01-21 13:17:23
On Fri, Jan 21, 2000 at 11:13:24AM -0500, Antoinette Green wrote:
Mail was down for a couple of days so any responses to my plea for help never 
made it so I'm resending.



problem ( I think ) is:

filters in rcfile aren't working.

I can run procmail from the command line and the message I pipe in goes to 
the 
default file.  I have set up 3 different receipes to redirect mail and none 
work.  To test whether or not my expression in the rcfile is valid I'm using 
egrep at the bourne shell command line, ie, egrep "^From:.A" 
/var/mail/agreen. 

If you write ^From:.A, you'll match anything that at the beginning of a
line (^) has From: followed by any *ONE* letter, followed by an A.  So

From: Alexander
From: Antoinette
From:pAhemm

will match your recipe, whereas

From:  Alexander
From: kAntoinetta
From: Green, Antoinette
From:                       Alex
BlaBlaBla

won't match.  If you want to match any amount of occurances you have to
use *, which will match any occurance of the preceding "letter".  So,
to match any amount of hits of anything, you have to use .* (dot star). 
If you want to match any mail sent from yourself, something like this
should do the trick:

^From:(_dot_)*green(_dot_)*(_at_)(_dot_)*xerox\(_dot_)com(_dot_)*

See man grep, section "REGULAR EXPRESSIONS".

Alexander Skwar

Attachment: pgpWivzrEK4Td.pgp
Description: PGP signature

<Prev in Thread] Current Thread [Next in Thread>