Virtual Folders in Mutt

2007-01-08 One-minute read

Just found a great how to on implementing virtual mail folders in Mutt. The problem: I want to be able to search for a message and have it find messages across multiple mailboxes.

The fix came from a really useful site that I had to use google cache to view. Sigh. Maybe they want to remain anonymous. Not sure. In any event, here’s the info:

First install mairix:

apt-get install mairix

Next download mailplex (a python script). I found it here. It’s attached to this blog if it disappears. Don’t forget to chmod 775 it (and you can remove the .txt extension - I only did that to outsmart Drupal).

Next: create a mailbox called .results:

cd ~/Maildir
maildirmake .results

Now, edit your .muttrc file:

~/.muttrc
# Mairix bindings
macro browser z "<shell-escape>mailplex\n"
macro index z "<shell-escape>mailplex\n<change-folder>=.results\n"
macro pager  z "<shell-escape>mailplex\n<change-folder>=.results\n"

Create a mailplex config file

~/.mailplex
# mailplex config (uses mairix)

mairix_confs = [
'~/.config/mutt/mairix-conf'
]
output_dir = '~/Maildir/.results'

Create a mairix-mutt config file:

~/.config/mutt/mairix-conf
# mairix config file for jamie's archived mail

base=/home/jamie/Maildir

# recursively scan Maildirs
maildir=.:.Trash:.saved:.Sent

And finally create a cron job:

30 * * * * mairix -f $HOME/.config/mutt/mairix-conf