procmail filter for mailinglist

Derek Broughton derek at pointerstop.ca
Wed Jul 15 18:39:30 UTC 2009


Jay Daniels wrote:

> On Tue, 2009-07-14 at 08:24 +0200, Siggy Brentrup wrote:
>> On Tue, Jul 14, 2009 at 01:42 -0400, Jay Daniels wrote:

>> > :0                                    # Majordomo lists
>> > * ^Sender: owner-\/[-a-zA-Z0-9_.]*
>> > list.$MATCH/

>> * ^Sender: ubuntu-security-announce-bounces at lists\.ubuntu\.com$
>> ubuntu/security-announce/
>> :0E
>> * ^Sender: ubuntu-de-bounces at lists.ubuntu.com$
>> ubuntu/de/
>> :0E
>> * ^Sender: ubuntu-motu-bounces at lists.ubuntu.com$
>> ubuntu/motu/
>> :0E
> 
> There's got to be an easier way to use procmail with a variable with
> list from mailman like the Majordomo filter above.

Of course.  Siggy's creating a hierarchical structure (though there's 
probably a better way to do that, too), but it's clear from his examples 
that you just need to extract out the part before "-bounces".  So to be like 
your Majordomo example:

* ^Sender: [-a-zA-Z0-9_.]*-bounces
list.$MATCH/

(and I don't even know procmail).

As for your other comment:
> I ran into a problem with this pipe to IFS line.  It seems fetchmail
> does not use .forward at all.

It certainly doesn't.  Fetchmail shouldn't be doing mail delivery (I'm not 
sure it even can).  Fetchmail is intended to put mail into either your local 
SMTP queue, or hand it off to an MDA (in your case procmail).  procmail 
should handle the .forward.

-- 
derek






More information about the ubuntu-users mailing list