procmail
[Top] [All Lists]

Deliver to multiple mailboxes

2003-02-11 02:37:12
 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I'm trying to perform some Procmail gymnastics on my mail messages.  What I'm 
trying to do is easier explained via a picture.  If you wouldn't mind, just 
take a look at this http://66.149.179.167/Graphic.gif

I hope you can understand what I'm trying to accomplish!  Basically, all mail 
should be filtered and delievered as normal, but *copies* of everyone's spam 
and nonspam messages should be deleievred into the spam and nonspam mailboxes 
in another directory.

I have everything working right now except for the copying of all user's spam 
and nonspam into the mailboxes in /dir2 (yellow/greenish shaded box in diagram).


This is my procmailrc file:

#Basic variables
PATH="/usr/bin:$PATH:/usr/local/bin"
SHELL = /bin/sh

LOGFILE=/var/log/procmail.log
LOGABSTRACT = "all"
VERBOSE=yes

#Sanitizer Variables
MANGLE_EXTENSIONS='exe|com|cmd|bat|pif|sc[rt]|lnk|dll|ocx|dot|xl[wt]|p[po]t|rtf|vb[se]?|hta|p[lm]|sh[bs]|hlp|chm|eml|ws[cfh]|ad[ep]|jse?|md[abew]|ms[ip]|reg|as[dfx]|c[ip]l|pps|asx|wm[avszd]|vcf|nws|wsz|\{[-0-9a-f]+\}'
POISONED_EXECUTABLES=/etc/procmail/poisoned-files
SECURITY_POISON_WINEXE=YES
DISABLE_MACRO_CHECK=YES
POISONED_SCORE=25
SCORE_HISTORY=/var/log/macro-scanner-scores
SCORE_DETAILS=YES
SECURITY_QUARANTINE=/var/mail/quarantine
SECURITY_QUARANTINE_OPTIONAL=YES
SECURITY_NOTIFY_VERBOSE="root"
SECURITY_NOTIFY_SENDER="/etc/procmail/policy"
SECURITY_NOTIFY_SENDER_POSTMASTER=YES
SECURITY_NOTIFY_SENDER_ABUSE=YES
SECURITY_NOTIFY_RECIPIENT="/etc/procmail/policy_recipient"
SECURITY_STRIP_MSTNEF=YES
DEFANG_WEBBUGS=YES
SECURITY_NONOTIFY_LONGSUBJECT=YES
SECRET="zgsfd973c9j5g3ro25dgbl"

#Main stuff
DROPPRIVS=YES

:0
{
#/dev/null some spam type stuff
INCLUDERC=/etc/procmail/presort.procmail
#strip some x-header stuff
INCLUDERC=/etc/procmail/xmessage.procmail
#Sanitizer rules
INCLUDERC=/etc/procmail/local-rules.procmail
INCLUDERC=/etc/procmail/html-trap.procmail
#Tag for spam and deliever
INCLUDERC=/etc/procmail/spam.procmail
}

#Reset sanitizer variables
POISONED_EXECUTABLES=
SECURITY_NOTIFY=
SECURITY_NOTIFY_VERBOSE=
SECURITY_NOTIFY_SENDER=
SECURITY_QUARANTINE=
SECRET= 

This is spam.procmail:


:0fw
| spamc

:0fw
* ^X-Spam-Status: Yes, \/.*required=...
| formail -I "X-message-flag: $MATCH"

:0fw
* ^Message-ID: *\/[^    ].*
{ MEID=$MATCH }

:0fw
* ^X-Spam-Status: *\/[^    ].*
{ SSTAT=$MATCH }
SSTAT=`echo "$SSTAT" | cut -d' ' -f2 | tr -dc "0-9.-"`
DATE=`date +"%m/%d/%y %H:%M"`
nada=`echo $DATE $SSTAT $MEID >> /home/mike/email-scores`


So my plan is to add this into either spam.procmail or another *.procmail file:


MAILDIR=/NEWDIRECTORY

:0
* ^Subject:.*SPAM
Spam
Nonspam

The only thing I don't understand is how or where to specify that only the 
*copies* be sent to the other directories mailboxes.  The initial message 
should go to their intended recipients.


- -------------------------------------------
Mike Loiterman
PGP Key 0xD1B9D18E
http://www.ascendency.net



-----BEGIN PGP SIGNATURE-----
Version: PGP 8.0
Comment: This message has been digitally signed by Mike Loiterman

iQA/AwUBPkixVmjZbUnRudGOEQIA5wCfeUiffIlldugBCIFHhL5mb/25G1IAoOrM
EeqvwW8qF+O/IXDuvu6O07LR
=u1w5
-----END PGP SIGNATURE-----


_______________________________________________
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>