/usr/share/doc/tin/examples/metamutt is in tin 1:2.4.1-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
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 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | #! /bin/sh
#
# $ Id: metamutt,v 1.17 2000/02/23 12:50:41 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.
#
# This script was written to use it in combination with the tin news
# reader, where you have to set the envionment variable
# METAMAIL=metamutt, but it should work with other programs, too.
#
# You need formail (from the procmail package) to use this script. If
# you don't want to install formail, you will find an alternative
# solution (commented out) below.
#
# Pressing "g" allows you to post a Followup to a newsgroup.
#
# Options:
# -D allows splits a digest into separate mails by using formail
# (Feature added by Martin Ramsch <m.ramsch@computer.org>)
#
# This script tries to find a working muttrc (which is sourced first)
# at the following places (descending priority):
# 1) ~/.mutt/metamuttrc
# 2) ~/.mutt/muttrc
# 3) ~/.muttrc
#
# Most recent version can be found at http://www.spinnaker.de/mutt/metamutt
#
# Many thanks for reporting bugs and introducing new features to
# Moritz Barsnick, Ulli Horlacher, Urs Janßen, and Martin Ramsch.
#
##########################################################################
#
# Copyright (C) 1997-2000 Roland Rosenfeld <roland@spinnaker.de>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
##########################################################################
umask 077
tmpdir=${TMPDIR-/tmp}/metamutt.$$
mkdir $tmpdir || exit 1
trap "rm -rf $tmpdir; exit" 0 1 2 3 15
# formail options:
fmopt=''
# do we read a digest?
digest='no'
# handle options (ignore most of them at the moment):
for parameter
do
case $1 in
-- ) shift; break;;
-e|-p ) shift;;
-m ) shift 2;;
-D ) fmopt='-ds cat'
digest='yes'
shift;;
* ) break;;
esac
done
# create mbox message using formail (from procmail package):
cat "$@" | formail $fmopt > $tmpdir/mbox
# If you don't have formail installed, try this:
#echo "From PIPE `env LC_ALL=C date`" > $tmpdir/mbox
#cat $* - | sed 's/^From />From /' >> $tmpdir/mbox
# create special muttrc for metamutt:
for rcsuggestion in $HOME/.mutt/metamuttrc $HOME/.mutt/muttrc $HOME/.muttrc
do
if [ -f $rcsuggestion ]
then
echo "source $rcsuggestion" > $tmpdir/muttrc
break
fi
done
cat >> $tmpdir/muttrc <<EOF
macro pager g ":set sendmail=$tmpdir/inews dsn_notify='' dsn_return=''<return>:my_hdr `formail -X Newsgroups < $tmpdir/mbox`<return>r"
EOF
# some additions, if we read exactly one article.
if [ "$digest" = "no" ]
then
cat >> $tmpdir/muttrc <<EOF
set pager_index_lines=0
set quit=yes
bind pager \t next-page
bind pager i quit
bind pager q quit
bind pager x quit
bind index q quit
push "<return>"
EOF
fi
# create special inews which removes mail only headers:
cat > $tmpdir/inews<<EOF
#! /bin/sh
formail -I To -I Cc -I Bcc -I Fcc -I From\ -I In-Reply-To \
-R X-Mailer User-Agent | inews -h
EOF
chmod 700 $tmpdir/inews
# run mutt on mbox message with special muttrc:
mutt -F $tmpdir/muttrc -f $tmpdir/mbox </dev/tty >/dev/tty
|