#!/bin/sh
# $Id: startmutt,v 1.3 2008/05/24 07:59:12 grog Exp $
# Use from firefox to start an MUA.
#
# firefox passes this funny "URL" mail address, which we need to parse.
# It doesn't seem to be possible to have more than one destination address.
#
# To set up (thanks to Callum Gibson):
#
# 1) Go to about:config page. Right click in the preferences and select New -> String.			
# 2) Add a preference called "network.protocol-handler.app.mailto"
# 3) give it the name of this script, which must be in the PATH and be executable.
DEST=`echo $1 | sed 's/mailto://; s/\?.*//'`
SUBJECT=`echo $* | sed 's/.*\?subject=//; s/%20/ /g'`
xterm -e mutt -s "$SUBJECT" $DEST
