anyone knowing procmail very good?

Todd Zullinger tmz at pobox.com
Tue Jan 27 19:16:05 UTC 2009


Christoph Höger wrote:
> Hi,
>
> I have the following in .procmailrc:
> (on a pretty bad administrated solaris box running procmail v3.22
> 2001/09/10)
>
> #fedora-devel
> :0
> * ^Sender:.*fedora-devel-list-bounces at redhat.com
> * ^TO_fedora-devel-list at redhat.com
> fedora-devel
>
>
> This works well in nearly all cases except for some announcements (e.g.
> the "The fonts SIG irregular status report" mail from today)
>
> Somehow those messages (although they contain Sender:
> fedora-devel-list-bounces at redhat.com) slip through that rule.
>
> Why?

Without directly answering that question, I have found that using the
List-Id header is much nicer.  And, it can be used to automatically
filter a lot of lists with one rule, rather than having separate rules
for each list.  Here's an example to illustrate:

# automagically handle nice standards conforming mailing lists.
# taken from http://spacepants.org/conf/dot.procmailrc,
# where it was attributed to Jeff Waugh
:0
* ^List-Id: +\/.*
{
    LISTID=$MATCH

    :0
    * LISTID ?? ^.*[<]\/[^@>\.]*
    lists/$MATCH/

    # the ^ * seems ineffective at removing spaces, best to be sure
    # the initial pattern does this (e.g.: ^List-Id: +\/.*)
    :0
    * LISTID ?? ^ *\/[^@\.]*
    lists/$MATCH/
}

# try to match List-Post headers
:0
* ^List-Post: *[<]mailto:\/.*
{
    LISTPOST=$MATCH

    :0
    * LISTPOST ?? ^ *\/[^@]*
    lists/$MATCH/
}

This handles most of my lists.  Only a few that I want filtered into
mailboxes that don't match the name used in the List-Id or that don't
use a List-{Id,Post} header need explicit rules.

-- 
Todd        OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The Internet treats censorship as a malfunction and routes around it.
    -- John Perry Barlow

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 542 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20090127/af58d0f7/attachment-0001.sig>


More information about the fedora-list mailing list