1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
#! /bin/sh
#
# $Id: metamutt,v 1.4 1998/01/20 11:04:25 roland Exp $
#
# This should become a replacement of metamail, using the mail reader
# mutt. The options of metamail are not yet implemented, but it should
# work as a filter without any problems.
#
# (c) 1997,98 Roland Rosenfeld <roland@spinnaker.rhein.de>
#
# Most recent version can be found at http://www.rhein.de/~roland/mutt/metamutt
#
TMP=/tmp/metamutt.$$
trap "rm -f $TMP*; exit" 0 1 2 15
# ignore options:
for parameter
do
case $1 in
-- ) shift; break;;
-e|-p ) shift;;
-m ) shift 2;;
* ) break;;
esac
done
# create special muttrc for metamutt:
cat > $TMP-rc<<EOF
source ~/.muttrc
set pager_index_lines=0
bind pager i quit
bind pager q quit
bind pager x quit
bind index q quit
push "\n"
EOF
# create a mbox message:
echo "From PIPE `date`" > $TMP-mbox
cat $* - | sed 's/^From />From /' >> $TMP-mbox
# run mutt on mbox message with special muttrc:
mutt -F $TMP-rc -R -f $TMP-mbox </dev/tty >/dev/tty
|