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/
Posted in Howto |
Poor Man's Tagging
an adventure in triple nested hashes.
PMT is a ruby script which can help you sort your data in a manner which has been heretofore unavailable in Windows NT/2k/XP. Lets say you have a lot of files of a limited set of types (source code, docs, TRM's, manuals, etc...) which are used in a limited set of projects that you work on, all which can be grouped together under some sort of name. Lets say for exmaple we have a few sets of these.
- Your custom Rails App in source code for some project
- This ruby script and it's docs
- Your library of PDF's about programming
- A few year's tax returns
PMT allows you to "tag" your data, in a exceptionally crude and gross scale, and then sorts it into a tagging heirarchy in your file system using "junctions" in Windows (or softlinks in other OS's) to point back to the original data.
First, arrange your data in the "raw" folder with the following naming template: name_type_project
raw/
MyCustomApp_src_Programming/
pmt_src_Programming/
pmt_doc_Programming/
Books_pdf_Programming/
taxes2006_doc_Finances/
taxes2005_doc_Finances/
And then run the script to auto-generate this tree (all peers to "raw"):
by project/
Finances/
doc/
taxes2006/
taxes2005/
Programming/
doc/
pmt/
src/
MyCustomApp/
pmt/
pdf/
Books/
by type/
doc/
Programming/
pmt/
Finances/
taxes2006/
taxes2005/
src/
Programming/
MyCustomApp/
pmt/
pdf/
Programming/
Books/
by name/
taxes2005/
doc/
Finances/
taxes2006/
doc/
Finances/
pmt/
doc/
Programming/
src/
Programming/
MyCustomApp/
src/
Programming/
Books/
pdf/
Programming/
These are just examples. You can develop your own Project names, types, group names. You might find that only one type of organization appeals to you. I found that I tend to use multiple approaches to find information. Using this system, you can find it anyway you need to.
Dependencies
This project is dependent on the "junction.exe" program provided by http://www.sysinternals.com. It's a really neat little utility that takes all the headache out of making junctions in Windows (the ruby implementation would be quite nasty).
Usage
Simply call the scripts with -c for create, -d for delete, or -r to delete, then create the structure. It will assume that you'll want to have the folder structure defined from where you call it.
by name by type by project raw [emrainey@macbookpro ~/Data]$ pmt.rb -c
Incidently this should also work in *nixes too like Mac OSX, but it uses "ln -s" instead of junctions.
A preface to Gurgitate-Mail on Dreamhost
When I got my iPhone, I decided to go back to using my Dreamhost account through IMAP so that I could have a single account with a persistent state. While this is nice, I didn't want to have to wade through a ton of spam on my iPhone. Since I wasn't neccesarily have Mail.app or Thunderbird open all the time at home running mail filters, and you can't do that on the iPhone, I was in a bind. How do I filter my mail easily and still use IMAP across multiple devices?
I came across Gurgitate-Mail, a great little filter which is launched by procmail or whatever you use to receive email. You can write some pretty concise email rules or make it even more complex. The point is that you can write rules in a proper programming language instead of cobbling together something in your favorite Mail program. In the coming days I will be posting more about what I've done.
Posted in Journal, Howto | no comments |
Music Rental Services
Auf Ruby Bitte!
>> AvgLifeSpan = {"male" => 74, "female" => 78}
=> {"female"=>78, "male"=>74}
>> serviceFee=5
=> 5
>> CurrentAge=28
=> 28
>> YearsRemaining = AvgLifeSpan["male"] - CurrentAge
=> 46
>> MonthsRemaining = YearsRemaining * 12
=> 552
>> EstimatedServiceCost = MonthsRemaining * serviceFee
=> 2760
>> CurrentSongCount=2872
=> 2872
>> CostPerSong=0.99
=> 0.99
>> TotalCurrentInvestment=CurrentSongCount * CostPerSong
=> 2843.28
So given a flat service fee for life (impossible given inflation), I'm just about to hit the tipping point. But then I remembered...
>> AbilityToPlayMyMusicAnywhereOrAnyhow="Priceless"
=> "Priceless"
Posted in Reviews | no comments |
2 New T-Shirts
Posted in Journal | no comments |
