Thread View: tek.software
1 messages
1 total messages
Started by Michael Prusynski
Wed, 19 Jan 1994 23:21
friendly interface to MH mail commands
Author: Michael Prusynski
Date: Wed, 19 Jan 1994 23:21
Date: Wed, 19 Jan 1994 23:21
73 lines
3417 bytes
3417 bytes
I've been using this for years, and should have shared it long ago...
I have a program called "m" that serves as a front-end to the MH mail commands.
"m" is a short shell-script program to read, remove, re-pack mail with just
a few keystrokes, and without having to remember the respective MH commands.
"m" provides help for the other MH commands when you type: h
and allows you to type these commands and any Unix command from its prompt.
It scans your mail and pipes it thru "more" if you have more than 24 messages.
After you read a mail message, it asks if you want to remove it, and it
renumbers your mail messages after you remove one.
It also provides a "prm" command that strips the mail header garbage off
before printing the mail.
I now have the fancy X-windows Xmh, but its easier & faster to use "m".
Here it is...
----------------------------- cut here ---------------------------------
:
# friendly interface to MH mail programs
inc
CLEAR=`clear`
cd $HOME/Mail/inbox
SCAN=`ls [0-9]* | wc -l`
if test $SCAN -gt 23 ; then # page thru message list if more than 23 msgs
SCAN="scan | more"
else
SCAN=scan
fi
while :; do
echo $CLEAR' # DATE FROM SUBJECT'
eval $SCAN
echo -n 'Type a number, h for help, q to quit, or a mail command: '
read command
case $command in
q*) exit 0 ;;
[1-9]*) command="show $command" ;;
" "|"") command=show ;;
prm*) set $command
echo "printing mail $2..."
command="show $2 | sed -e '/^Return-Path:/d' -e '/^Received:/d' \
-e '/^ id/d' -e '/^Message-Id/d' -e 's/^/ /' | lpr" ;;
h*) echo '
To show a mail message on the screen, type its number and press RETURN.
Just pressing RETURN shows the mail message marked with +
Just pressing RETURN when you see "remove?" defaults to a "no" answer.
The list is automatically renumbered after you remove mail.
-- Example Mail Commands -- no number defaults to the message marked with +
rmm 1 remove mail message 1 (or whatever number you type, else + )
prm 1 print mail message 1 (or whatever number you type, else + )
comp compose a message. When you exit & see "what now?" you can type:
send to send the message, or
edit to re-edit the message before sending it, or
quit save message in Mail/draft without sending
repl 1 reply to message 1. Same as comp, but fills in the "To:" line
forw 1 forward message 1. You must fill in the "To:" line
show, prev, next are self-explanatory. It is shorter to just type the number.
'
command=: ;; # after help msg, give "do nothing" to eval
esac
eval "$command"
case $command in
show*|p*|next)
echo -n 'remove this mail? (y/n) '
read command
case $command in
y*|Y*) rmm ; folder -pack ;;
q*) exit 0 ;;
esac ;;
rmm*) folder -pack ;;
*) echo -n 'press RETURN to continue: '
read command ;;
esac
done
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads