Swallow: An Add-on to Gurgitate-Mail
I just recently got Amber setup on my swallow and gurgitate-mail system today, which turned out to be more of a bear than I thought it would. The main issues had to do with installing 0.9.5 rubygems locally on her accounts, configuring DSPAM, and setting up the MySQL database. As promised eariler, here's a run down of the features of this system:
Advantages
- "Quick-to" addresses. Don't want a million aliases? Auto-create them with quick-to's. These allow you to setup a run that says "any address with looks like xxxxxx-com, put in the Commercial folder". This means I don't have to have separate microcenter-com, amazon-com, etc, emailing aliases (which I used mainly to ferret out spammers). Now they are created automatically and always get stuffed into my Commercial folder.
- Universal "Read" Count: Since this is an IMAP account, I never have to worry about which device/client has read which email.
- Really good Spam engine, DSPAM.
Disadvantages
- DSPAM needs it's own MySQL database.
- DSPAM needs to have it's tables purged every once in a while
- Gurgitate-Mail and Swallow need a generic rules script which is part of neither.
- Swallow has to be configured for exactly what you want. This took the least amount of time out of all these.
Assumptions
This brief guide assumes:- You have your own domain.
- ...on Dreamhost.com
- ...you have webpanel access
- ...you can create users.
Installing:
- Create private domain, or subdomain.
- Create the main user account, make sure they have email.
- Create a "catch-all" email forwarder, for that subdomain.
- If you just forward the catch-all to your main, you don't need to worry about a spamfilter account, but if you want to reduce the flow to your main (add subsequently reduce the email in your suspicious folder, you can create a secondary account in domain which will receive the catch-all's and forward to your main user as needed. However, this requires that the secondary's .procmailrc has to be configured manually to coincide with your main user's ruleset.yaml (to be described later).
- Install RubyGems locally (I used $HOME/usr as my prefix)
- Install Gurgitate-Mail Gem
- Install Swallow Gem
- Download .gurgitate-rules.rb (renamed to .gurgitate-rules.rb)
- Download example .swallow-config (rename to .swallow-config)
- Download example ruleset.yaml
- Create Whitelist.yaml (a YAML array of strings which are email addresses)
- Create Aliases.yaml (another YAML array of strings which are email address)
- Install DSPAM on Dreamhost
- Create a MySQL host and table for DSPAM
- Create Folder structure in your mail client to reflect those in your ruleset. You must have a:
- Innocent - for emails which are wrongly marked as Junk (in the Junk folder)
- Junk - emails which DSPAM thinks are spam
- Suspicious - emails which weren't handled. They weren't in the whitelist, or junk, so they could be fine, but you'll have to handle them manually. Put them in Junk if they are.
- Write a .procmailrc for your account. Don't forget to create the .forward.postfix file.
- Optional: Train DSPAM
MAILDIR=$HOME/Maildir
LOGFILE=$MAILDIR/procmail.log
SHELL=/bin/sh
RUBYLIB="$HOME/usr/local/lib/site_ruby/1.8"
GEM_HOME="$HOME/.gems"
GEM_PATH="$GEM_HOME:/usr/lib/ruby/gems/1.8"
PATH="$HOME/usr/bin:$GEM_HOME/bin:${PATH}"
LINEBUF=4096
# Use Gurgitate Mail to Sort my email.
:0
| $HOME/.gems/bin/gurgitate-mail
# We've not been able to decide what to do with it, lets just stick it in the
# Suspicious Folder.
:0
$HOME/Maildir/.Suspicious/
