procmail
[Top] [All Lists]

Re: Recipe problem

2004-08-29 23:08:11
On Wed, 25 Aug 2004 14:35:30 -0500, Chuck Campbell
<campbell(_at_)accelinc(_dot_)com> wrote:
I'm trying to make a recipe to catch my mailing list emails and filter them
to the correct place, instead of having one recipe for each mailing list
and having to search headers for something unique in each individual list.

Sean wrote this, and it works very very well:

# [  ] contains chr(9) and chr(32) (tab and space)
LISTNAME
:0
* 9876543210^0 ^(List-Post:[    ]*(<mailto:)?|List-Owner:[     
]*(<mailto:)?owner-)\/[-A-Z0-9_+]+
* 9876543210^0 ^(List-Id:.*<|X-Mailing-List:[   ]*)\/[-A-z0-9_+]+
* 9876543210^0 ^(Sender:[       ]*owner-|X-BeenThere:[ 
]*|Delivered-To:[       ]*mailing list )\/[-A-Za-z0-9_+]+
* 9876543210^0 ^Sender:.* List"? <(mailto:)?\/[-A-Z0-9_+]+
{ LISTNAME=$MATCH }

:0E
* ^Sender:[     ]*\/[-A-Z0-9_+]+-owner
{ LISTNAME=`echo $MATCH | sed -e s/-owner//i` }

:0
* ! LISTNAME ?? ^^^^
{ # do what you want to do with list mail }

I think my version differs very slightly from his.

-- 
 ::::==   <http://www.kreme.com>  ==::::
 :: Don't get saucy with me, Bernaise ::

____________________________________________________________
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