procmail
[Top] [All Lists]

Re: Associating "good guys" with their maildirs in a whitelist

2003-07-07 21:39:02
At 22:57 2003-07-07 -0400, Lee Hoffner wrote:
If anyone's done this, I'd be grateful for a push in the right direction. It's going to be a lot quicker to add a new entry to this whitelist than to add another recipe for new individuals or groups.

No, I haven't actually done this. However, it's virtually identical to a method I've offered up many times for setting per-recipient filtering options and the like.


See my sandbox config (.sig) for a partial list of standard variable extractions I perform, and how they're performed (and, you might pick up some other useful info from there). $CLEANFROM is the one you need. Then:


#
# whitefolder.rc
#
# 20030707 SBS
#
# combines a simple whitelist check (based on the From:)
# with defining a destination folder
#

# If necessary, specify a path (preferrably using a variable, such as
# those defined in the sandbox example, to keep things portable).
WHITELIST=mylist.dat

# we require a trailing space or tab after the address match, whether an
# mbox is specified or not.
ISLISTED=`grep -i "^$CLEANFROM " $WHITELIST`

# This recipe will set VARIABLEFOLDERNAME ONLY if there is a mailbox
# defined in the whitelist data file.  You can set a default above here, or
# check for a blank VARIABLEFOLDERNAME elsewhere.
:0
* ISLISTED ?? ^[^ ]+[   ]+\/[^  ]+
{
        VARIABLEFOLDERNAME=$MATCH
}


---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.


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