procmail
[Top] [All Lists]

Re: Auto-forwarding recipe problem

2010-08-30 20:25:51
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

* ! ^SUBJECT.*confidential

Use:
        * ! ^Subject:.*confidential

{
 :0 fwh
 # Write loop header by piping through formail, to avoid mail loops
 | formail -A "X-Loop: user1(_at_)my(_dot_)domain(_dot_)com"

 :0 c
 # Send a copy, then (c)ontinue processing actions
 ! user2(_at_)my(_dot_)domain(_dot_)com

 :0:
 # Send to default location (with a lockfile)
 ${DEFAULT}
}

Thanks, Greetings and nice Day/Evening
    Michelle Konzack

-- 
##################### Debian GNU/Linux Consultant ######################
   Development of Intranet and Embedded Systems with Debian GNU/Linux

itsystems(_at_)tdnet France EURL       itsystems(_at_)tdnet UG (limited 
liability)
Owner Michelle Konzack            Owner Michelle Konzack

Apt. 917 (homeoffice)
50, rue de Soultz                 Kinzigstraße 17
67100 Strasbourg/France           77694 Kehl/Germany
Tel: +33-6-61925193 mobil         Tel: +49-177-9351947 mobil
Tel: +33-9-52705884 fix

<http://www.itsystems.tamay-dogan.net/>  <http://www.flexray4linux.org/>
<http://www.debian.tamay-dogan.net/>         <http://www.can4linux.org/>

Jabber linux4michelle(_at_)jabber(_dot_)ccc(_dot_)de
ICQ    #328449886

Linux-User #280138 with the Linux Counter, http://counter.li.org/
____________________________________________________________
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>