You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Vicki Brown <vl...@cfcl.com> on 2005/03/24 23:22:22 UTC

Re: How do I whitelist this list? (*nix procmail recipe)

At 09:37 -0600 03/22/2005, Bob McClure Jr wrote:
>I don't even allow mail from this list to go through SA.  In my
>~/.procmailrc, I have a recipe prior to the call to spamc like this:


I do something similar but different. All of my white lists are outside of my
procmailrc  so I can edit them more easily.  One address per line, e.g.
users@spamassassin.apache.org

I do blacklisting the same way.

I keep a separate whitemlists file for mailing lists vs. people because some
lists put the list address in the From: field, but many put the list name in
the To: field. My human correspondents whitelist only checks From.

Here's an excerpt from my procmailrc. Whenever I bypass SA, I add an X header
to tell me that I bypassed and why.


GREP="egrep -iqsf"            # ignore case, quiet, suppress errors,
FGREP="fgrep -iwf"            # ignore case (whole words? -w)

# mail from the following bypasses all other filtering
WHITELIST=$PMDIR/whitelist          # people
WHITEMLISTS=$PMDIR/whitemlists      # mailing lists
WHITEDOMAINS=$PMDIR/whitedomains    # domains
# mail from these is deleted
BLACKLIST=$PMDIR/blacklist          # people
BLACKDOMAINS=$PMDIR/blackdomains    # domains
BLACKSUBJECTS=$PMDIR/blacksubjects  # subject lines

SUBJECT="`formail -zxSubject:`"
SENTFROM="`formail -zxFrom: -zxReply-To:`"
SENTTO="`formail -zxTo: -zxCc:`"

...
#       White Listing

# mailing lists (To)

:0 H
* ? (echo ${SENTFROM} | $FGREP ${WHITEMLISTS})
{
        :0f
        * ^Subject:
           | formail -A 'X-Bypass: [MLIST-OK]'
        :0
        ${DEFAULT}
}

:0 H
* ? (echo ${SENTTO} | $FGREP ${WHITEMLISTS})
{
        :0f
        * ^Subject:
           | formail -A 'X-Bypass: [MLIST-OK]'
        :0
        ${DEFAULT}
}


-- 
Vicki Brown          ZZZ
Journeyman Sourceror:  zz  |\     _,,,---,,_     Code, Docs, Process,
Scripts & Philtres      zz /,`.-'`'    -.  ;-;;,_   Perl, WWW, Mac OS X
http://cfcl.com/vlb       |,4-  ) )-,_. ,\ ( `'-'   SF Bay Area, CA  USA
_______________________  '---''(_/--'  `-'\_)  ___________________________