procmail
[Top] [All Lists]

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

2000-01-20 23:20:04
Antoinette Green <agreen(_at_)eng(_dot_)mc(_dot_)xerox(_dot_)com> writes:
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.

That seems a non-optimal condition.  Match if and only if the second
character in the value of the From: header field is an A?  Why not search for
the actual address anywhere in the From: header field?


This works some of the time.  If a mail note is from the NT platform my test 
fails but if it's from sendmailit works.  I think it has to do with how NT 
writes the From: section ,ie,  

      From: "Green, Antoinette" 
<Antoinette(_dot_)Green(_at_)usa(_dot_)xerox(_dot_)com>
vs.
      From: Antoinette Green <agreen(_at_)eng(_dot_)mc(_dot_)xerox(_dot_)com>

...and this is why you want to look for 
agreen(_at_)eng(_dot_)mc(_dot_)xerox(_dot_)com, instead
of just that leading 'A'.


VERBOSE=on
PATH=$HOME/bin:/usr/bin:/usr/ucb:/bin:/usr/local/bin:.

Unless you have a specific reason to change the default value of PATH,
you probably shouldn't.


...
:0:                            # Anything from thf
* ^From:.A
test                           # will go to $MAILDIR/test

That should be
        :0:
        * ^From:(.*\<)?agreen(_at_)eng\(_dot_)mc\(_dot_)xerox\(_dot_)com
        test

The same goes for all the other recipes: match on addresses, not the
placement of specific characters in field value.


Philip Guenther

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