On Sat, 5 Jul 2003, Chris I wrote:

>I used this to filter to. The problem is that if somebody cc's you a 
>message, it still gets sorted to gentoo-user (which defeats the 
>purpose).

Not really, I want my gentoo-user e-mail to goto my Gentoo-user account.  
If they reply to the list and cc me directly I now I have multiple copies 
of the e-mail.

That is why I use the following recipe:

DEFAULT=/home/chrisf/mail/.mbox
MAILDIR=/home/chrisf/mail
FORMAIL=/usr/bin/formail

# Rebuild messages to verify the From address is valid
:0 fhw
| $FORMAIL -I "From " -a "From "

# Copy the message to a backp directory before doing anything 
# with it.  .backup should be a directory under $MAILDIR
:0 c
.backup

# This keeps your .backup directory clean, making sure that you
# only hold the last 100 messages in backup
:0 ic
| cd $MAILDIR/.backup && rm -f dummy `ls -t msg.* | sed -e 1,100d`

# This keeps a list or messageid's, as well as deletes any
# messages that were sent to a mailing list and were also CC/BCC'd
# to you.  Will also keep you from getting other duplicates.
:0 Wh: msgid.lock
| $FORMAIL -D 8192 .msgid.cache

:0
* ^(To|Cc):[EMAIL PROTECTED]
gentoo-user

:0
* ^(To|Cc):[EMAIL PROTECTED]
gentoo-security

:0
* ^(To|Cc):[EMAIL PROTECTED]
gentoo-announce

# This recipe stops messages that are text/html without a
# charset.  This is an invalid method of e-mail transmission
# and is only known to be used by spam mailers.
# Besides, it's not readable for me in pine and you damn
# well better send me plain text e-mail =)
:0 fhw
*       ^Content-type: text/html
* !     html; charset=
* !     from hotmail
| ${FORMAIL} -A "X-Spammers: text/html only message"

# The Following 3 Recipes check to see if someone claiming to
# Be from yahoo, netscape and hotmail are really sending through
# hotmail/netscape/yahoo servers.  If not we can assume it is
# spoofed.  you will want to whitelist any people you know
# who send their messages from thier local ISP with a hotmail
# netscape or yahoo return address.

# hotmail-specific
:0 fhw
*       ^(From|Return-Path):[EMAIL PROTECTED]
{
       :0
        *       ^From: ".+" <[EMAIL PROTECTED]>
        *       ^X-OriginalArrivalTime:
        *       ^X-Originating-IP: \[[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+]
        *       ^Received: from hotmail.com \(\/...
        * $     ^Message-ID: <[EMAIL PROTECTED]>
        { }

        :0 Efhw
        | formail -A "X-Spammers: fake hotmail"
}

# yahoo-specific
:0 fhw
*       ^(From|Return-Path):[EMAIL PROTECTED]
{
       :0
        *       ^Message-ID: <([0-9.]+\.qmail|[0-9]+\.[0-9A-Z]+)@\/[a-z0-9-]+\. 
yahoo\.[a-z.]+
        * $     ^Received: from .+by $MATCH
        { }

        :0 Efhw
        | formail -A "X-Spammers: fake yahoo"
}

# netscape-specific
:0 fhw
*       ^(From|Return-Path):[EMAIL PROTECTED]
{
       :0
        *       ^X-Mailer: Atlas
        *       ^Received: from +netscape.*MAILIN
        *       ^Return-Path: <\/[EMAIL PROTECTED]
        * $     ^From:.*$MATCH
        * $     ^Received: from $MATCH.*by [a-z0-9.-]+\.aol\.com
        *       ^Message-ID: <[EMAIL PROTECTED]

        :0 Efhw
        | formail -A "X-Spammers: fake netscape"
}

:0
* ^(X-Spammers):.*
procmail-spammers


>the "proper" way is with list-id, as I see dozens of people have 
>pointed out. For fun, heres my (very verbose) rule:

I've found the "proper" way to do things is the way that works the best 
for you.  Personally I hate being CC'd on list mail because I'm already 
getting one of the messages already.  If you reply just to me and not to 
the list I will still get the message.  Which is fine.



Christopher Fisk
--
Where is Bart, anyway?  His dinner's getting all cold and eaten.
                -- Homer Simpson
                   Bart After Dark

--
[EMAIL PROTECTED] mailing list

Reply via email to