Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 812370e8e4f8ac698e01b21e53db774d > files > 61

maildrop-1.7.0-17mdv2010.0.i586.rpm

# This is a slightly shortened version of my operational .mailfilter file.

logfile "mailfilter-log.txt"


log "========"

# The above line is written to the log file whenever a message comes in.
#
# Then, for each successful match, a long log line is writen as well, before 
# what is typically two log entries:
#
# 1 - For the cc operation.
# 2 - For the to final delivery to Inbox.
#
# These long log lines serve to make the log file easier to read, and they
# also function as prominent labels in this file.
#
# Note that "." in the filter terms matches anything, from 0 to any number of
# characters, so it doesn't just match ".".
#
# The search terms are copied from email headers.
# Generally, for mailing lists I find that the "Return-Path: " header
# is the most distinctive and stable for all the ways that messages can 
# be sent to a mailing list.
#
# Yahoo Groups lists are different - the "Return-Path: " is customised for
# every message.  So the "Reply-To: " seems to be the best header.

                                                    
                                                    # If I get sick of seeing the crap
                                                    # this person puts on various music 
                                                    # DSP lists, in my Inbox then I will 
                                                    # comment out the "to " line.
                                                    #
                                                    # Filtering here means that the
                                                    # messages get no further.
                                                    # 
                                                    # Note backslashes to make the whole
                                                    # if ( ) statement be on one logical
                                                    # line.  Be sure not to have a blank
                                                    # line before the {  }!     

if (    ( /.m9ndfukc/ )            \
     || ( /.www.god-emil.dk/ )     \
   )
{
    log "------------------------------------------------------------- Antiorp etc. "    
    cc "Maildir/.0-SPAM-etc.Antiorp-crap"
    DELTAG=1
    xfilter "subjadd [Antiorp]"
    to "Maildir"
}
 


                                                    # The next two are for one of the
                                                    # Yahoo Groups I run.  I am a
                                                    # moderator and owner and have 
                                                    # configured Yahoo Groups to send
                                                    # me notifications of people joining
                                                    # leaving.  These are the subject of
                                                    # the second set of rules - and the
                                                    # messages are found by the first set.
                        
if ( /^Reply-To: 1HDChat/ )
{
    log "------------------------------------------------------------- 1HDChat "
    cc "Maildir/.Lists.1HDChat"
    DELTAG=1
    to "Maildir"
}



if (    (/^Subject: New 1HDChat member/ )                     \
     || (/^Subject: Unsubscription by New 1HDChat member/ )   \
   )
{
    log "-------------------------------------------------------------  1HDChat membership"

    cc "Maildir/.Lists.1HDChat-membership"
    DELTAG=1
    to "Maildir"
}




                                                    
if ( /^Resent-Sender: akai-request@midicase.com/ )
{
    log "------------------------------------------------------------- Akai-sampler "
    cc "Maildir/.Lists.Akai-sampler"
    DELTAG=1
    to "Maildir"
}


                                                    # This is from Hyperreal.org - and
                                                    # has a natty X-Mailing-List header
        
 
if ( /^Mailing-List: contact analogue-help/ )
{
    log "------------------------------------------------------------- Analogue-Heaven "
    cc "Maildir/.Lists.Analogue-Heaven"
    DELTAG=1
    to "Maildir"
}



if ( /^From: bugzilla-daemon@mozilla.org/ )
{
    log "------------------------------------------------------------- Bugzilla-Mozilla "
    cc "Maildir/.Lists.Bugzilla-Mozilla"
    DELTAG=1
    to "Maildir"
}




if ( /^Delivered-To: cryptography-outgoing@wasabisystems.com/ )
{
    log "------------------------------------------------------------- Crypto-wasabisystems "
    cc "Maildir/.Lists.Crypto-wasabisystems"
    DELTAG=1
    xfilter "subjadd [CyrptoW]"
    to "Maildir"
}




if ( /^Reply-To: csound@lists.bath.ac.uk/ )
{
    log "------------------------------------------------------------- Csound "
    cc "Maildir/.Lists.Csound"
    DELTAG=1
    to "Maildir"
}

if ( /^Delivered-To: csound-unix-dev-list/ )
{
    log "------------------------------------------------------------- Csound-linux-dev "
    cc "Maildir/.Lists.Csound-linux-dev"
    DELTAG=1
    to "Maildir"
}



if ( /^Return-Path: <netreg-request@gospel.iinet.net.au>/ )
{
    log "------------------------------------------------------------- EFA-Netreg "
    cc "Maildir/.Lists.EFA-Netreg"
    DELTAG=1
    to "Maildir"
}



if ( /^Return-Path: <owner-ica@nsw.cmis.CSIRO.AU>/ )
{
    log "------------------------------------------------------------- Internet-commerce-ICA "
    cc "Maildir/.Lists.Internet-commerce-ICA"
    DELTAG=1
    to "Maildir"
}
                                    

if ( /^Return-Path: <link-owner@web.anu.edu.au>/ )
{
    log "------------------------------------------------------------- Link "
    cc "Maildir/.Lists.Link"
    DELTAG=1
    to "Maildir"
}


if ( /^Return-Path: <bugtraq-return/ )
{
    log "------------------------------------------------------------- Linux-bugtraq "
    cc "Maildir/.Lists.Linux-bugtraq"
    DELTAG=1
    xfilter "subjadd [BugTraq]"
    to "Maildir"
}



if ( /^Return-Path: <linux-raid-owner/ )
{
    log "------------------------------------------------------------- Linux-RAID "
    cc "Maildir/.Lists.Linux-RAID"
    DELTAG=1
    xfilter "subjadd [RAID]"
    to "Maildir"
}



if ( /^Return-Path: <redhat-announce-list-admin/ )
{
    log "------------------------------------------------------------- Linux-Redhat-Announce "
    cc "Maildir/.Lists.Linux-Redhat-Announce"
    DELTAG=1
    xfilter "subjadd [RH-Ann]"
    to "Maildir"
}



if ( /^Return-Path: <redhat-ppp-list-admin/ )
{
    log "-------------------------------------------------------------  Linux-RedHat-PPP "
    cc "Maildir/.Lists.Linux-RedHat-PPP"
    DELTAG=1
    xfilter "subjadd [RH-PPP]"
    to "Maildir"
}
                                    


if ( /^Return-Path: <cert-advisory-owner/ )
{
    log "------------------------------------------------------------- Linux-security-CERT "
    cc "Maildir/.Lists.Linux-security-CERT"
    DELTAG=1
    xfilter "subjadd [CERT]"
    to "Maildir"
}
   



if ( /^Return-Path: <courier-users-admin/ )
{
    log "------------------------------------------------------------- Mail-Courier-users "
    cc "Maildir/.Lists.Mail-Courier-users"
    DELTAG=1
    to "Maildir"
}


                                                    # I could do this with a single test 
                                                    # for just "owner-postfix", but have
                                                    # chosen to keep both terms separate
                                                    # for the users and announce lists.  

if  (    ( /^Return-Path: <owner-postfix-users/ ) \
      || ( /^Return-Path: <owner-postfix-announce/ ) \ 
    )
{
    log "------------------------------------------------------------- Mail-Postfix "
    cc "Maildir/.Lists.Mail-Postfix"
    DELTAG=1
    xfilter "subjadd [Postfix]"
    to "Maildir"
}




if ( /^Return-Path: <owner-acma-l/ )
{
    log "------------------------------------------------------------- Music-Aust-computer-music "
    cc "Maildir/.Lists.Music-Aust-computer-music"
    DELTAG=1
    to "Maildir"
}




if ( /^Return-Path: <owner-music-dsp/ )
{
    log "------------------------------------------------------------- Music-dsp"
    cc "Maildir/.Lists.Music-dsp"
    DELTAG=1
    to "Maildir"
}


                                                    # I noticed messages coming in via
                                                    # both of the aliases of what I assume
                                                    # is the majordomo sender.

if (    ( /^Return-Path: <owner-linux-audio-dev/ ) \
     || ( /^Return-Path: <linux-audio-dev-owner/ ) \
   )     
{
    log "------------------------------------------------------------- Music-Linux-audio-dev "
    cc "Maildir/.Lists.Music-Linux-audio-dev"
    DELTAG=1
    to "Maildir"
}





if ( /^Return-Path: <quasimodo-devel-admin/ )
{
    log "------------------------------------------------------------- Music-Quasimodo "
    cc "Maildir/.Lists.Music-Quasimodo"
    DELTAG=1
    to "Maildir"
}




                                    # Music-SAOL
                                    # There's no obvious Return-path
                                    # or single To address
if ( /for <saol-dev@media.mit.edu/ )
{
    log "------------------------------------------------------------- Music-SAOL "
    cc "Maildir/.Lists.Music-SAOL"
    DELTAG=1
    xfilter "subjadd [SAOL]"
    to "Maildir"
}




if ( /^Return-Path: <padvocacy-admin/ )
{
    log "------------------------------------------------------------- Privacy-advocacy "
    cc "Maildir/.Lists.Privacy-advocacy"
    DELTAG=1
    xfilter "subjadd [PrivAdv]"
    to "Maildir"
}






if ( /^Return-Path: <rre/ )
{
    log "------------------------------------------------------------- Privacy-RRE "
    cc "Maildir/.Lists.Privacy-RRE"
    DELTAG=1
    to "Maildir"
}

                                    # EPIC
                                    # <jw@bway.net> Censorware proj. http://www.spectacle.org/freespch/slaclist.html
                                    # <privacy@vortex.com> Privacy Forum


if (     ( /^Return-Path: <epic-news/ )           \
      || ( /^Return-Path: <jw@bway/ )             \ 
      || ( /^Return-Path: <privacy@vortex/ )      \  
   )    
{
    log "------------------------------------------------------------- Privacy-various-lists"
    cc "Maildir/.Lists.Privacy-various-lists"
    DELTAG=1
    to "Maildir"
}


if ( /^Return-Path: <owner-sara/ )
{
    log "------------------------------------------------------------- SARA "
    cc "Maildir/.Lists.SARA"
    DELTAG=1
    to "Maildir"
}


if ( /^X-Apparently-To: Silent-PC@yahoogroups.com/ )
{
    log "------------------------------------------------------------- Silent-PC "
    cc "Maildir/.Lists.Silent-PC"
    DELTAG=1
    to "Maildir"
}




if ( /^Return-Path: <nobody@mail.kragware.com>/ )
{
    log "------------------------------------------------------------- Telco-Broadband-Bob "
    cc "Maildir/.Lists.Telco-Broadband-Bob"
    DELTAG=1
    to "Maildir"
}



if ( /^Return-Path: <snapshot@Webnoize.COM>/ )
{
    log "------------------------------------------------------------- Telco-Webnoize  "
    cc "Maildir/.Lists.Telco-Webnoize"
    DELTAG=1
    xfilter "subjadd [WebNoize]"
    to "Maildir"
}



if ( /^Return-Path: <root@tbruce.telstra.net>/ )
{
    log "------------------------------------------------------------- Telstra-Internet-outages "
    cc "Maildir/.Internet-and-phones.Telstra-Internet-outages"
    DELTAG=1
    to "Maildir"
}


if ( /^Return-Path: <root@tom.telstra.net>/ )
{
    log "------------------------------------------------------------- Telstra-Internet-stats "
    cc "Maildir/.Internet-and-phones.Telstra-Internet-stats"
    DELTAG=1
    to "Maildir"
}



                                                    # Arrive here if the message is not matched
                                                    # by any of the above.


    log "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - No match."
    to "Maildir"






#======================================================================
#
# Template


#if ( /^/ )
#{
#    log "-------------------------------------------------------------  "
#    cc "Maildir/.Lists."
#    DELTAG=1
#    xfilter "subjadd [XXXX]"
#    to "Maildir"
#}