email-toolchain

Using email takes up a substantial part of the time I spent working with computers. I use an elaborate tool chain for managing email. In this text I document that tool chain, and some configurational tweaks that I have applied to it.

Short version:

MUA: mutt (using either local Maildir++ or a ssh-tunnel to my IMAP server) message managing: emacsclient for editing, signify for adding human readable signatures, gpg for adding machine readable signatures and encryption/decryption of messages) MTA: exim MDA: fetchmail, procmail Syncronisation: offlineimap Automatic archival/deletion: archivemail Spam-filters: greylistd, razor

On the server side I run a local IMAP-server with dovecot.

Procmail

Mailing lists:

  1. Identify the address of the list, the address you use when you post to the list.
  2. Use this address in a TO clause in .procmailrc
  3. Define a target maildir-directory for the mailing list.
  4. Create the target maildir-directory with mutt. Save a message manually, type the non-existing directory name, and mutt will create the dir (and its subdirs) for you.
  5. Update the list of mailboxes where mutt should look for new mail.
  6. rsync that updated list from the IMAP server to $HOME.

Example:

  1. Identifying the address
To: pytrainer-devel@lists.sourceforge.net
  1. Use the address in a TO clause in .procmailrc, here with the target dir .datorer.pytrainer/ (pytrainer becomes a mapp in datorer, using the maildir++ standard).
:0:
* ^TO_pytrainer-devel@lists.sourceforge.net
.datorer.pytrainer/
  1. Update the file that keeps the list of mailboxes that act as inboxes, using this script bin/make-mailboxes-list.
#!/bin/bash

# Run this file whenever .procmailrc is changed. TODO have file-alteration-monitor process automatically do this?

BYTES=`grep -E /$ .procmailrc | grep -v -E '\$' | cut -d "." -f 2- | cut -d "/" -f 1 | sort | uniq | for i in $(cat /dev/stdin); do echo '='$i' \'; done | wc -c`;

let BYTES=$BYTES-2;

grep -E /$ .procmailrc | grep -v -E '\$' | grep -v -E '^#' | cut -d "." -f 2- | cut -d "/" -f 1 | sort | uniq | for i in $(cat /dev/stdin); do echo "=$i "; done | head -c $BYTES /dev/stdin | echo $(cat /dev/stdin) | cat > ~/.mailboxes
  1. copy this file to $HOME/.muttrc
rsync -v your.imap.server:.mailboxes $HOME/.mutt/mailboxes-your.imap.server

For this to work, you need a reference to this file in .mutt/muttrc:

mailboxes = `cat ~/.mutt/mailboxes-your.imap.server`

comments powered by Disqus


Back to the index

Blog roll

R-bloggers, Debian Weekly
Valid XHTML 1.0 Strict [Valid RSS] Valid CSS! Emacs Muse Last modified: 2007-12-09