procmail
[Top] [All Lists]

Site Wide Procmail, Redirect & capturing info for headers....

2002-10-16 22:07:11
Hi all,

Hopefully someone can help me here.

I want to use postfix/procmail/spamassassin to filter out spam mail.

What I want to do is put a header in the mail which has a listing of all the recpients which then I can later parse later on for more indepth eval.

So basically I want to say if Spam, forward the mail to another address, but put a header in which has a listing of all the recipients. Otherwise deliver as normal. Everything seems to work other then the receipients part. What happens is it either ends up with no receipients listed or just the last one listed. It won't store them all. It looks like when Procmail calls formail, it's adding commas where there would be spaces.

In my Postfix Master.cf I have procmail defined this way:

procmail unix - n n - - pipe flags=R user=filter argv=/usr/bin/procmail -m /etc/mail/procmail/procmailrc $sender $recipient

This is my procmailrc file which i have pieced together from what I've been reading in the archives and this list:

# Load variables and environment settings
LOGDIR=/var/log
SPAMTRAP=/home/filter
SPOOLDIR=/var/spool/procmail
BINDIR=/etc/mail/procmail
DROPPRIVS=No
LOGFILE=/var/log/procmail/procmail.log
NL="
"
SENDER="$1"
SHIFT=1
RECPT="$@"
LOGABSTRACT=all
VERBOSE=yes

# Call Spamassassin
:0fw
| spamassassin


# Check and see if mail is Spam
# If mail is Spam add header X-Origional-Sender: and fill in sender
# information Also add header with a list of all those it was destined
# to on my domain as provided by postfix
# Make a backup of the mail after making new headers for later eval
# to see who is getting the most spam.

:0
* ^X-Spam-Status: Yes
{
        :0f
        * !^X-Origional-Sender:
        | formail -a"X-Origional-Sender:$SENDER"

        :0f
        * !^X-Origional-To:
        | formail -a"X-Origional-To:$RECPT"
        
        :0c
        /home/filter/spam
        
        :0
        ! -f $SENDER <spamtrap(_at_)spamtrapdomain(_dot_)spam>

}

:0
! -f "$SENDER" "$@"


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>
  • Site Wide Procmail, Redirect & capturing info for headers...., Tim Bergen <=