File: metamutt

package info (click to toggle)
tin 980226-3
  • links: PTS
  • area: non-free
  • in suites: hamm
  • size: 2,972 kB
  • ctags: 4,932
  • sloc: ansic: 45,907; sh: 1,577; makefile: 1,130; yacc: 698; perl: 103
file content (44 lines) | stat: -rwxr-xr-x 1,011 bytes parent folder | download
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