procmail
[Top] [All Lists]

Re: Filter mail based on a text file list?

2006-06-12 03:05:12
On 11 Jun 2006, at 20:23 , Dave Patterson wrote:
I have one mutt mailbox, Family-Friends, that recieves mail from a  
lot of
people (big family, a lot of friends!).  Is it possible to have a  
single
procmail recipe reference a simple text list or addressbook  
category to
place incoming in this box?

Everything is possible...

FRIENDLIST=$HOME/.friends

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

# 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 ?? ^[^ ]+[   ]+\/[^  ]+
$MATCH

%cat .friends
fred(_at_)doamin(_dot_)tld Friends/Fred
mom(_at_)domain(_dot_)tld Family
Bro(_at_)domain(_dot_)tld Family
bob(_at_)domain(_dot_)tld Business/Bob

etc etc

(If you specify "Friends/Fred" then Friends MUST exist ahead of time)

I didn't write this, but someone on this list did, Sean, iirc.  been  
using it for years.

CLEANFROM is set in my /etc/procmailrc

:0 h
CLEANFROM=|formail -IReply-To: -rtzxTo:


-- 
My biggest problem is that Steve insists on serving PURPLE Kool Aid,  
and I don't like PURPLE <sip sip> Kool Aid.




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