procmail
[Top] [All Lists]

Re: Auto-forwarding recipe problem

2010-09-01 18:00:47
Hello Greg Trounson,

Am 2010-08-31 13:01:33, hacktest Du folgendes herunter:
I am wanting any mail to "user1" that originates from within
my.domain.com
and doesn't contain the phrase "confidential" in the subject to be
copied
to "user2".  I have written a .procmailrc as below and it looks to work
most of the time.

The problem is that occasionally a message will be copied to "user2"
that
originates from a completely different domain.  This looks to happen
with
I can't see any obvious pattern in which messages are copied - the From
address originate from many different domains.  These messages all have
X-Original-To and X-Loop set to "user1(_at_)my(_dot_)domain(_dot_)com", so I 
know
procmail
is the culprit.

The user1 account is subscribed to several mailing lists and is
consequently rather high volume.  Is there perhaps some issue with file
locking?

thanks,
Greg

PATH=$HOME/bin:/usr/bin:/usr/local/bin:.
MAILDIR=$HOME/Maildir      # Need to make sure it exists
DEFAULT=$MAILDIR/
LOGFILE=$MAILDIR/procmailLog
LOCKFILE=$HOME/.lockmail

# Discard potential mail loops
:0
* ^X-Loop: user1(_at_)my\(_dot_)domain\(_dot_)com

Use:
        * ^X-Loop:(_dot_)*user1(_at_)my\(_dot_)domain\(_dot_)com

since you never know, what other MTAs do with the headers.

/dev/null

:0
* ^FROM(_dot_)*[\(_dot_)(_at_)]my\(_dot_)domain\(_dot_)com

Looks a little bit weird...
Use:
        * ^From:(_dot_)*(_at_)my\(_dot_)domain\(_dot_)com

...

Hi, and thanks for your reply,

I implemented both of your suggested changes above, and so far at least
they appear to have worked.  That's great, though a little troubling, as
I'm still at a loss as to what was causing some messages to slip through
before.

I will need to do further tweaking, as the FROM line had the [\(_dot_)(_at_)]
directive there to match for example both sender1(_at_)my(_dot_)domain and
sender2(_at_)division(_dot_)my(_dot_)domain(_dot_)  That could have been what 
was tripping it up,
though it still looks to be a valid egrep expression.

thanks again for your help,
Greg



____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)de
http://mailman.rwth-aachen.de/mailman/listinfo/procmail

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