# 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: / ) { log "------------------------------------------------------------- EFA-Netreg " cc "Maildir/.Lists.EFA-Netreg" DELTAG=1 to "Maildir" } if ( /^Return-Path: / ) { log "------------------------------------------------------------- Internet-commerce-ICA " cc "Maildir/.Lists.Internet-commerce-ICA" DELTAG=1 to "Maildir" } if ( /^Return-Path: / ) { log "------------------------------------------------------------- Link " cc "Maildir/.Lists.Link" DELTAG=1 to "Maildir" } if ( /^Return-Path: Censorware proj. http://www.spectacle.org/freespch/slaclist.html # Privacy Forum if ( ( /^Return-Path: / ) { log "------------------------------------------------------------- Telco-Broadband-Bob " cc "Maildir/.Lists.Telco-Broadband-Bob" DELTAG=1 to "Maildir" } if ( /^Return-Path: / ) { log "------------------------------------------------------------- Telco-Webnoize " cc "Maildir/.Lists.Telco-Webnoize" DELTAG=1 xfilter "subjadd [WebNoize]" to "Maildir" } if ( /^Return-Path: / ) { log "------------------------------------------------------------- Telstra-Internet-outages " cc "Maildir/.Internet-and-phones.Telstra-Internet-outages" DELTAG=1 to "Maildir" } if ( /^Return-Path: / ) { 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" #}