Wed, 01 Oct 2008

Transparent compression with FuseCompress

I proudly remain among a decreasing percentage of people who prefer to deal with all of their email themselves, as opposed to letting google store and datamine it. I've been using my current email stack for about 6 years; since I was a freshman in college. I pop all email from a variety of servers with fetchmail, process it with procmail, filter spam with spamassassin/pyzor/razor, and slay mail with mutt (with the sidebar patch, of course). There are a few modifications that I'd eventually like to make to this stack (fetchmail->getmail, esmtp->mutt, and if I'm really crazy, mutt->nmh), and aside from the fact that you pretty much need a CS degree to understand most of the filters -- overall, it has been a pleasure to work with.

After every Fedora release, I try to give evolution/tbird another shot, but I'm usually back to using mutt within hours ;) (I may give tbird another shot at some point, considering I was just introduced to muttator).

Anyway... Since I now use a ThinkPad x300 as a primary workstation, I'm limited to only 64G of disk space. After doing a fresh install over the weekend, I figured I might as well setup a virtual FuseCompress filesystem that I can use to store all of my mail and code in. FuseCompress supports a variety of compression libraries, but out of the box uses lzo, which is optimized for real-time data compression. As it turns out, getting everything setup is extremely easy.

Compressing your existing data.
Here I move my email to ~/.Mail, and compress it.

  # yum -y install fusecompress
  $ mv ~/{,.}Mail
  $ fusecompress_offline ~/.Mail

Mounting the compressed filesystem.
Now, all you need to do is throw the mountpoint in your /etc/fstab, and you're good to go.

  fusecompress#/home/lmacken/.Mail    /home/lmacken/Mail  fuse allow_other   0 0

I've been using this setup for a few days now, and haven't noticed any issues whatsoever. The lzo compression is pretty decent, for a library that prefers speed over size.

[lmacken@x300 Mail]$ du -sh
1.6G	.
1.6G	total
[lmacken@x300 Mail]$ du -sh --apparent-size
3.4G	.
3.4G	total

For better compression, you can easily set it to use bzip2. I'd be interested to hear about other people's email tips/tricks/tweaks/hacks!


posted at: 05:48 | link | Tags: , , , | 1 comments

Sat, 19 May 2007

Dealing with multiple email addresses in mutt

I recently watched Bram Moolenaar's "7 Habits for Effective Text Editing 2.0" Google Tech Talk presentation, which inspired me to dust off the old vimrc and poke around for a bit. I tend to live most of my life inside of vim, which is actually a pretty kickass place to live (I even started working on a life.vim script to replace my [excessive] tomboy usage, and add a bit of GTD sauce).

I use mutt for my email accounts, and recently made some modifications to my vimrc to help automate a task that utilizes far too many of my keystrokes each day: changing the From field of outgoing messages.

let g:addresses = ['lewk csh rit edu', 'lmacken redhat com', 'lmacken fedoraproject org']
function NextEmailAddress()
    if !exists("g:email_idx")
        let g:email_idx = 0
    endif
    s@^\(From:.*<\).*>@\=submatch(1) . g:addresses[g:email_idx % len(g:addresses)] . ">"@
    let g:email_idx += 1
endfunction
map <silent> @ :call NextEmailAddress()<CR>

This lets you cycle through your email addresses by pressing '@' when composing a new mail. From here, my messages go through esmtp, which ships them off to the proper SMTP server based on the identity of the mail.

I'd be curious to hear of any other tweaks people have made to their vimrc's to help improve their mutt usage, or of any life-changing hack that saves you tons of keystrokes every day.


posted at: 19:15 | link | Tags: , , , | 1 comments