dotfile cruft

After nearly 10 years of personal UNIX use, my dotfiles have accumulated a lot of cruft.  Most of it is stuff that’s just plain no longer needed.  In an effort to improve usability and reduce the dread I feel at the prospect of editing my dotfiles for trivial changes, I’ve started an effort to clean them up.  Today, I’m doing my .procmailrc, which is the control file for the procmail single-drop local mail delivery agent.  Here’s my current .procmailrc:

#MAILDIR=$HOME/.maildir/
#DEAULT=$MAILDIR
LOGFILE=/var/log/procmail

# db_maintenance messages
:0
* ^Subject:.*db_maintenance\ drupal*
mail/db_maintenance

# cron messages
:0
* ^Subject:.Cron*
mail/cron-jobs

# MORI users group
:0
* ^Subject:.\[WI MORI Users\]*
mail/MORI

# US-CERT
:0
* ^From:.*info\@us-cert\.gov*
mail/cert

# Gentoo Mailing Lists
:0
* ^List-Id:.*gentoo-announce\.gentoo\.org
/dev/null

:0
* ^List-Id:.*gentoo-gwn\.gentoo\.org
/dev/null

:0
* ^List-Id:.*gentoo-user\.gentoo\.org
/dev/null

:0
* ^List-Id:.*gentoo-server\.gentoo\.org
/dev/null

:0
* ^List-Id:.*fedora-test-list\.redhat\.com
/dev/null

:0
* ^List-Id:.*fedora-devel-list\.redhat\.com
/dev/null

:0
* ^List-Id:.*fedoraproject\.org.*
/dev/null

# Lake Area Furry Friends mailing list
:0
* ^List-Id:.*laff\.catbox\.com
mail/LAFF

# Blackhole some idiot who keeps mailing me
:0
* ^From:.*lmjrhino@gmail\.com.*
/dev/null

# other Gentoo stuff
:0
* ^From:.*gentoo\.org
/dev/null

# JoAnn Fabrics ads
:0
* ^From:.*joann\.com
! mom@lakemasoniccenter.org

# Christian Pipe Smokers forums
:0
* ^From:.*christianpipesmokers\.net
mail/CPS

# Alterra Coffee
:0
* ^From:.*alterracoffee\.com
mail/Alterra

# Culver's
:0
* ^From:.*culvers\.fishbowl\.com
mail/Culvers

# Office Depot
:0
* ^From:.*email\.officedepot\.com
mail/Office\ Depot

# Sun
:0
* ^From:.*mail\.communications\.sun\.com
mail/Sun

# ThinkGeek
:0
* ^From:.*thinkgeek\.com
mail/ThinkGeek

# Tracfone
:0
* ^From:.*email\.tracfone\.com
mail/Tracfone

# Around Teh Table
:0
* ^Subject:.\[Around Teh Table\].*
mail/Teh\ Table

# Alienware
:0
* ^From:.*alienware\.com
mail/alienware

# LinkedIn
:0
* ^From:.*linkedin\.com
mail/linkedin

# Netbeans
:0
* ^From:.*netbeans\.org
mail/netbeans

# Facebook
:0
* ^From:.*facebook.*\.com
mail/facebook

# Postmaster notices
:0
* ^To:.postmaster\@.*\.org
mail/postmaster

# Spotcrime alerts
:0
* ^Subject:.*spotcrime\.com.*
/dev/null

:0
* ^From:.*spotcrime\.com.*
/dev/null

# WITI
:0
* ^From:.WITI.*
mail/witi

# SANS ISC
:0
* ^From:.*SANS\ Internet\ Storm\ Center.*
mail/sans

# CNN
:0
* ^From:.CNN*
mail/cnn

# discard mail from villanova
:0
* ^From:.*info@villanovau\.com.*
/dev/null

# Mailman notices
:0
* ^To:.mailman-.*\@.*\....
mail/mailman

# news notices
:0
* ^From:.*news\@lakemasoniccenter\.org.*
mail/news

# root's mail
:0
* ^To:.root\@.*lakemasoniccenter\.org
mail/root

# ditch compusa.com
:0
* ^From:.*compusaonline\.com
/dev/null

# ditch Glucerna
:0
* ^From:.*glucerna\.com
/dev/null

# ditch Climber.com
:0
* ^From:.*climber\.com
/dev/null

# ditch Runner's World
:0
* ^From:.*\@runnersworld\.delivery\.net
/dev/null

# other wordpress stuff
:0
* ^From:.*no-reply\@wordpress\.com
mail/Teh\ Table

# facebook
:0
* ^From:.*\@facebookmail\.com
mail/facebook

# alienware
:0
* ^From:.*Alienware\@dellhome\.usa\.dell\.com
mail/alienware

# milwaukeejobs.com
:0
* ^From:.*info\@milwaukeejobs\.com
mail/milwaukeejobs

# different sun sender
:0
* ^From:.*sun\@communications2\.sun\.com
mail/Sun

# tiger direct
:0
* ^From:.*TigerDirect\@tigeronline\.com
mail/tigerdirect

# catch spam
:0
* ^X-Spam-Status: Yes
mail/spam

#set up a Spam maildir where all the spam goes for teaching SA spam vs. non-spam
 #and to be sure that no mail - even if detected as spam - gets lost (like when you pipe it to /dev/null)

 SPAM_FOLDER=~/mail/spam

 #pipe mails through SA (this is basically from the example files
 #but I use a higher limit, every mail up to 512 kB is filtered)
 #spamc is the client programm for the daemonized
 #version of SA (designed to keep load and overhead down)
 #If you don't run SA as a daemon change "spamc" to "/usr/bin/spamassassin"
 #If you do use spamc here you must add spamd to your runlevel
 #like this: rc-update add spamd default

 :0fw: spamassassin.lock
 * < 524288
 | spamc

 #All mail tagged as spam (eg. with a score higher than the set threshold)
 #is moved to ".spam".

 :0:
 * ^X-Spam-Status: Yes
 $SPAM_FOLDER

 #Work around procmail bug: any output on stderr will cause the "F" in
 #"From" to be dropped.  This will re-add it.
 #(This is taken directly from the SA example file)

 :0
 * ^^rom[ ]
 {
   LOG="*** Dropped F off From_ header! Fixing up. "

   :0 fhw
   | sed -e '1s/^/F/'
 }

Here’s the leaner .procmailrc:

#MAILDIR=$HOME/.maildir/
#DEAULT=$MAILDIR
LOGFILE=/var/log/procmail

#========== ADMIN MAIL ===========

# db_maintenance messages
:0:
* ^Subject:.*db_maintenance\ drupal*
mail/db_maintenance

# cron messages
:0:
* ^Subject:.Cron*
mail/cron-jobs

# Postmaster notices
# Note that this will only route my 3 .org domains.
# Anything addressed to the postmaster@flippingcoinsband.com
# address will still be delivered to the inbox.
# That domain is dead anyway and any postmaster messages
# definitely constitute anomalous activity.
:0:
* ^To:.postmaster\@.*\.org
mail/postmaster

# Mailman notices
:0:
* ^To:.mailman-.*\@.*\....
mail/mailman

# news notices
:0:
* ^From:.*news\@lakemasoniccenter\.org.*
mail/news

# root's mail
:0:
* ^To:.root\@.*lakemasoniccenter\.org
mail/root

# ========== GROUPS ==========

# MORI users group
:0:
* ^Subject:.\[WI MORI Users\]*
mail/MORI

# Around Teh Table
:0:
* (^Subject:.\[Around Teh Table\].*) | (^From:.*no-reply\@wordpress\.com)
mail/Teh\ Table

# LinkedIn
:0:
* ^From:.*linkedin\.com
mail/linkedin

# Facebook
:0:
* ^From:.*facebook(mail)?.*\.com
mail/facebook

# milwaukeejobs.com
:0:
* ^From:.*info\@milwaukeejobs\.com
mail/milwaukeejobs

# Christian Pipe Smokers forums
:0:
* ^From:.*christianpipesmokers\.net
mail/CPS

# ========== MAILING LISTS ===========
# Gentoo Mailing Lists
:0
* ^(List-Id|From):.*gentoo\.org
/dev/null

# Fedora Mailing Lists
:0
* ^List-Id:.*(fedora.*\.redhat\.com|fedoraproject\.org)
/dev/null

# Lake Area Furry Friends mailing list
:0:
* ^List-Id:.*laff\.catbox\.com
mail/LAFF

# =========== WEBSITES ===========

# JoAnn Fabrics ads
:0
* ^From:.*joann\.com
! mom@lakemasoniccenter.org

# Alterra Coffee
:0:
* ^From:.*alterracoffee\.com
mail/Alterra

# Office Depot
:0:
* ^From:.*email\.officedepot\.com
mail/Office\ Depot

# Sun
:0:
* ^From:.*(mail\.communications|sun\@communications2)\.sun\.com)
mail/Sun

# Culver's
:0:
* ^From:.*culvers\.fishbowl\.com
mail/Culvers

# ThinkGeek
:0:
* ^From:.*thinkgeek\.com
mail/ThinkGeek

# Tracfone
:0:
* ^From:.*email\.tracfone\.com
mail/Tracfone

# Alienware
:0:
* ^From:.*(alienware|Alienware\@dellhome\.usa\.dell)\.com
mail/alienware

# Netbeans
:0:
* ^From:.*netbeans\.org
mail/netbeans

# tiger direct
:0:
* ^From:.*TigerDirect\@tigeronline\.com
mail/tigerdirect

# ========== BLACKHOLES ==========

# Spotcrime alerts
:0
* ^(Subject|From):.*spotcrime\.com.*
/dev/null

# Blackhole some idiot who keeps mailing me
:0
* ^From:.*lmjrhino@gmail\.com.*
/dev/null

# discard mail from villanova
:0
* ^From:.*info@villanovau\.com.*
/dev/null

# ditch compusa.com
:0
* ^From:.*compusaonline\.com
/dev/null

# ditch Glucerna
:0
* ^From:.*glucerna\.com
/dev/null

# ditch Climber.com
:0
* ^From:.*climber\.com
/dev/null

# ditch Runner's World
:0
* ^From:.*\@runnersworld\.delivery\.net
/dev/null

# =========== SPAMFILTERING ===========

# catch spam
:0:
* ^X-Spam-Status: Yes
mail/spam

#set up a Spam maildir where all the spam goes for teaching SA spam vs. non-spam
 #and to be sure that no mail - even if detected as spam - gets lost (like when you pipe it to /dev/null)

 SPAM_FOLDER=~/mail/spam

 #pipe mails through SA (this is basically from the example files
 #but I use a higher limit, every mail up to 512 kB is filtered)
 #spamc is the client program for the daemonized
 #version of SA (designed to keep load and overhead down)
 #If you don't run SA as a daemon change "spamc" to "/usr/bin/spamassassin"
 #If you do use spamc here you must add spamd to your runlevel
 #like this: rc-update add spamd default

 :0fw: spamassassin.lock
 * < 524288
 | spamc

 #All mail tagged as spam (eg. with a score higher than the set threshold)
 #is moved to ".spam".

 :0:
 * ^X-Spam-Status: Yes
 $SPAM_FOLDER

 #Work around procmail bug: any output on stderr will cause the "F" in
 #"From" to be dropped.  This will re-add it.
 #(This is taken directly from the SA example file)

 :0
 * ^^rom[ ]
 {
   LOG="*** Dropped F off From_ header! Fixing up. "

   :0 fhw
   | sed -e '1s/^/F/'
 }

Advertisements

  1. #1 by Joshua on January 10, 2011 - 6:58 PM

    The ^X-Spam-status: Yes test is there twice because the first one catches spam that was tagged as it passed through Sendmail. Internal mail that bypasses gateway filtering should still get passed through SpamAssassin so it misses the first rule, gets passed through SpamAssassin, then catches the second instance of the ^X-Spam-status: Yes rule.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: