Msg docs preformatted (part 1 of 2)
sources-request at panda.UUCP
sources-request at panda.UUCP
Sun Mar 16 01:14:17 AEST 1986
Mod.sources: Volume 4, Issue 36
If your site has the "mm" macro package, then you don't need this, the
formatted documentation for the Msg mail system.
#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create the files:
# Guide.fmtd
# This archive created: Sat Mar 15 10:06:24 1986
export PATH; PATH=/bin:$PATH
echo shar: extracting "'Guide.fmtd'" '(50526 characters)'
if test -f 'Guide.fmtd'
then
echo shar: will not over-write existing file "'Guide.fmtd'"
else
cat << \SHAR_EOF > 'Guide.fmtd'
Msg 3.1 Users Guide
Dave Taylor
March 15, 1986
1. Introduction
The UNIX operating system was originally written on a
small PDP machine to work with teletypewriters. Conse-
quently, all the original software for the operating system
was written with a 'tty' in mind - they were all line
oriented, rather than screen oriented.
Gradually this began to change, and, with the addition
of the Berkeley vi visual shell to the ed line editor, the
trend was brought to the attention of certain UNIX systems
designers.
This, however, seemingly hasn't been enough, as vi and
notes are still the only screen oriented software available
(other than games, which are a taboo subject with managers
and the like!). Consequently, after becoming more and more
frustrated with the existing electronic mail facilities on
the system ('mail' and 'mailx', both of which are essen-
tially line-editors) I decided to write my own!
This document discusses the msg mailer, and includes a
set of example screens and a discussion of configuration
(for systems administrators). It is broken down into the
following general sections; The .msgrc file, starting
options of msg, the main system level, responses of various
commands, the alias system, and system configuration.
Any comments or problems with either this document or
the program itself are welcome: all installed systems should
have an alias that will ensure that I receive any mail sent
to 'msg'.
Page 1
Msg Users Guide Version 3.2
2. The .msgrc File
The msg mailer has the ability to automatically read in
a configuration file at each invocation. The file must be
called ".msgrc" and reside in your home directory for it to
be read in, and can have any of the following entries in any
order (note that the first four entries replace environment
variables of the same name, and the four boolean options
supplement required starting parameters);
fullname This is the name the mailer will use when sending
mail from you. It is highly recommended that you
use your full name and nothing strange or unusual,
as that can appear extremely rude to people
receiving your mail.
maildir This is the default mail folder. It is used to
expand filenames in the mailer when specified
using the '=' metacharacter. That is, if you save
to file "=/stuff" then the '=' will be expanded to
the current value of maildir.
mailbox This is where to put incoming mail after you've
read it. When you answer 'y' to the "save to
mailbox?" prompt, this is where the messages go!
editor The editor to use when typing in message to peo-
ple.
print This indicates how to print out a message. There
are two possible formats for this string, either a
command that can have a filename affixed to (as a
suffix) and then sent to the system for execution,
or a string that contains the meta-sequence '%s'
which will be replaced by the name of the file and
then also sent to the shell. Examples of each
are;
print = print -formfeed
print = pr %s | lpr
prefix When you reply to a message or forward a message
to another person, you can optionally include the
original message. Defining the prefix value here
allows you to indicate what the prefix of each
included line should be. The default is "> " and
is fairly standard in the Unix community.
savemail This is where outgoing mail will have a copy
silently (and quickly) saved. This will only be
Page 2
Msg Users Guide Version 3.2
used if the flag 'copy' is turned on. Also note
that if the 'savename' flag is turned on then this
line is ignored since each outgoing message is
saved according to whom it's being sent to.
shell This defines the shell to use when doing '!'
escapes and such. Note that the program also
reads the $SHELL variable out of the current
environment, but that defining this in the .msgrc
file will override the environment definition.
weedout This is something new and exciting! When specify-
ing this option, you can then list as many headers
of messages that you don't want to see when you
are read mail. This list can continue for as many
lines as desired, as long as the continued lines
all have leading indentation.
alternatives This is a list of other machine/username combi-
nations that you receive mail from (forwarded).
This is used when the G)roup reply feature is
invoked to ensure that you don't send yourself a
copy of the outbound message.
autocopy This is a boolean flag, and if set will automati-
cally copy the text of each message being replied
to into the edit buffer. This is the same as the
'-a' starting parameter.
copy This, in combination with the "savemail" filename,
will allow you to have silent copies of all outgo-
ing mail made on the outbound step.
resolve This is a boolean flag that defines the behaviour
of the program for such actions as deletion, sav-
ing a message and so on.
weed This is a boolean flag that, in combination with
the "weedout" list, allows you to custom define
the set of headers you would like to not have
displayed while reading messages. The defaults
are listed further into the document.
noheader This boolean flag tells the mailer not to include
the headers of messages when copying a message
into a file buffer for replying to or forwarding.
titles This boolean flag allows you to have each page of
a message to be titled with:
Message #N from username Mailed date at time
where all the information has been previously
Page 3
Msg Users Guide Version 3.2
extracted from the message. This is especially
useful if you weed out all the headers of each
message with a large 'weedout' list...
Two more things: the format for each of the lines is;
variable = value
and for boolean variables, value can be 'ON' or 'OFF' only.
For a better idea of how this all works, here's my .msgrc
file. While looking through it, notice that you can have
lots of comments and blank lines for readability and that
you can also use 'shell variables' and the '~' metacharacter
for your home directory, and they are expanded accordingly
when read in by the mailer.
#
# .msgrc - automatic variable defines for the 'msg' mailer.
#
# Personalized for Dave Taylor
#
fullname = Dave Taylor
# where to save my mail to, default directory
maildir = ~/Mail
# where to save messages to, default file
mailbox = ~/Mail/mailbox
# what editor to use
editor = $EDITOR
# where to save mail if not specified somewhere else
savemail = ~/Mail/mail.sent
# how to print a message ('%s' is the filename)
print = /usr/local/bin/print -p lpn -f %s
# prefix sequence for including message text in other messages...
prefix = >
# what headers I DON'T want to see, ever.
weedout = "Via:" "Sent:" "Date:" "Status:" "Original"
"From" "Phase" "Subject:" "Fruit" "Sun"
"Lat" "Buzzword" "Return" "Posted" "Telephone"
"Postal-Address" "Origin" "X-Sent-By-Nmail-V"
"Resent" "X-Location" "Source" "Mood" "Neuron"
"Libido" "To:" "X-Mailer:" "Full-Name:" "X-HPMAIL"
Page 4
Msg Users Guide Version 3.2
"Cc:" "cc:" "Mmdf" "Network-"
# automatically copy message being replied to into buffer?
autocopy = OFF
# save a copy of all outbound messages?
copy = ON
# emulate the mailx message increment mode (only increment after something
# has been 'done' to a message, either saved or deleted)
resolve = ON
# enable the weedout list to be read...
weed = ON
# when messages are copied into the outbound buffer, don't include headers
noheader = ON
# display message title when displaying pages of message
titles = ON
# alternative addresses that I could receive mail from (usually a
# forwarding mailbox)
alternatives = hpcnof!dat, hpcnof!d_taylor, hpcnou!d_taylor,
hpcnou!root, hpcnou!postmaster, hpcnoe!d_taylor,
hpcnoe!dat, hpcnoa!d_taylor, hpcnoa!dat,
hpfcla!d_taylor
Along with this, there is still an environment variable that
the mailer checks for, namely "EDITOR", which can also
define what editor to use when entering messages. As with
the shell variable, having an editor specified in the .msgrc
file will override anything read in from the current
environment.
3. The Starting Parameters
There are a number of starting options to the msg pro-
gram, with only one that needs to be remembered: '-?'or '-h'
for help.
The flags are;
-d Debug. Useful for debugging the msg program. The
results of using the debug option is much less
drastic than in the previous versions of the pro-
gram - it creates a file in your home directory
Page 5
Msg Users Guide Version 3.2
called "Msg.debug.info" and creates a (verbose)
log of activity as the program is used.
-f <file> File. Read specified file rather than the
default input mailbox.
-h or -? Help. Gives a short list of all these options
and exit.
-k Keypad - This option, when used, lets the msg pro-
gram know that you're on an HP terminal, and it
can then interpret the PREV NEXT and HOME/DOWN-
HOME keys accordingly. If you are not on an HP
terminal, it is recommended that you do NOT use
this option.
-s Softkeys. The msg mailer can, to a rather limited
extent, use the HP softkeys as an alternative form
of input. If you specify this option be sure that
you're on an HP terminal that can accept the stan-
dard 2622 terminal escape sequences!
-z Zero. This causes the mailer not to be started if
you don't have any mail. This emulates the
behaviour of programs like 'mailx'.
-S <subject> In batch mode, this is how to indicate the
subject of the resulting message. Please see the
section on "Non-Interactive Uses of Msg" for
further information.
All the above flags default to reasonable options, so
there is usually no need to use them.
4. Non-Interactive Uses of Msg
Before we discuss the main mail system, it's worth not-
ing that there are a couple of other ways to use the msg
mail system, namely to 'send only' and to send files (batch-
mail).
To send a message to someone without any of the associ-
ated overhead of the main system being loaded, you can
invoke the mailer with the name(s) of the people to send to.
The mailer will then prompt for Subject, Copies, and then
drop you in your (defined in the ".msgrc" file) editor to
compose the message. When composition is complete, the
program verifies transmission then terminates. For example;
Page 6
Msg Users Guide Version 3.2
$ msg dat
To: ihnp4!hpfcla!d_taylor
Subject: this is a test
Copies To: <return>
<invokes editor, message composed, then>
Are you sure you want to send this? (y/n) y
mail sent.
$
Note that the user input is in bold face, so you can see
that the mailer verified the alias expansion too!
The mailer also supports batch type mailing, of files
and so on, by using the following starting sequence;
$ msg -S "File help.c" dat < help.c
which will read in the file and transmit it to the specified
user with the specified subject. Note that the program is
intelligent enough to check to see what the stdin is from
this invocation, so a command of the form
$ msg -S "file help.c" dat
would result in the following sequence (since the program is
reading the "standard in" for information;
$ msg -S "file help.c" dat
To: ihnp4!hpfcla!d_taylor
Subject: file help.c
Enter your message, ending with ^D
this is the message
Please don't ask me why I used this wierd mode!
^D
<end-of-message>
$
which is reasonable behaviour!! (not only that, but this is
almost exactly what /bin/mail does in the same situation!!)
Page 7
Msg Users Guide Version 3.2
Enough of this foolishness, however, let's get onto the
real stuff;
5. The Main System
Upon entry to the program, the main screen will be
displayed as below;
-----------------------------------------------------------------
Mailbox is '/usr/mail/mymail' with 13 messages. [Version 3.0]
1<- Apr 3 rob Doing anything tonight?
2 Apr 5 hplabs!joe bug in gammon game
3 Apr 5 root
4 Apr 6 root (continuation of previous message)
U 5 Apr 8 decvax!mouse Re: net.music article decvax:495
6 Apr 13 John Jacobs How can you hate RUSH?
7 Apr 15 kevin More software requests
N 8 Apr 18 games Hi there
N 9 Apr 18 Dave Taylor EditFile.c source...
N 10 Apr 23 veeger!carl More silly stuff
|=pipe, !=shell, ?=help, <n>=set current to n, /=search pattern
A)lias, C)hange mailbox, D)elete, F)orward, G)roup reply, M)ail,
N)ext, P)rint, R)eply, S)ave to file, Q)uit, U)ndelete, or eX)it
Mail :@
-----------------------------------------------------------------
There are a number of things to notice about this
screen;
o The top line always displays the current mail file, the
number of messages in the file, and the current msg
version number.
o On the left side of each message is the message number
which is unique for each message in the file.
o The arrow ('<-') always points to the current message.
This is the message that the commands having default
message numbers (such as D)elete, and N)ext) will work
with.
Page 8
Msg Users Guide Version 3.2
o The date associated with each message is the date the
person sent the message. This is obtained by either
the oldest of the ">From" line dates, or, if possible,
by parsing the "Date:" line.
o The third field displayed is a truncated 'from'
address, and will indicate whom the message is from.
Note that on the sixth and ninth messages full names
appear instead of the usual machine!login format. This
is because these messages have a From line of the form:
From: fullname <address>
or From: address (fullname)
which the mailer reads and displays if possible. The
msg mailer (version 2.1 and beyond) also generates this
header line on outgoing mail.
o The final field is the (optional) subject of the mes-
sage. Note that message 3 has no subject.
o Message five is an 'Urgent' message (it contains the
header
Priority: Urgent
to make it urgent) that should be read immediately.
o Messages 8 thru 10 are new since the last time the user
read their mail - the "N" in the leftmost margin indi-
cates this.
o A maximum of ten messages are displayed at one time*.
Further into the document we'll learn how to change
'pages' in the mailbox.
o The three line mini-menu will always indicate what com-
mands are available at the current moment.
o Finally, the '@' character indicates where the cursor
would be, awaiting your input.
The typical action at this point is to use the <return>
key to read the current message. This particular option
__________
0. On terminals with greater than 25 lines, more messages
will be displayed automatically.
Page 9
Msg Users Guide Version 3.2
isn't noted in the mini-menu, but choosing the '?=help'
option will inform you of a number of choices other than
those in the basic menu!
Pressing this key will clear the screen and display the
first page of the message. At the bottom of the page, the
system will write either;
Please press <space> to continue <xx> lines left
or
Please press <space> to return
These indicate how much of the current message has been
read: 'continue' indicates the presence of at least one more
line of information (the exact number will be indicated on
the right hand side as 'xx lines left'). Pressing <return>
rather than <space> will automatically return you to the
main system level at any page of a message.
When the message continues onto another page the msg
mailer will also indicate how many lines are left in the
message...
If resolve-mode is turned off (see the 'resolve' flag)
the current message pointer (the arrow) will be incremented
after reading the message and will point to the next message
in the list.
As you can see, it would be quite simple to quickly
read through all the pending mail by repeatedly using the
<return> command at the menu level, and the <space> bar
while reading each message!
While reading is perhaps the most fundamental function
that the msg program performs, there are a number of other
options available, namely;
Command Action
| Pipe current message to specified com-
mand.
! Shell escape.
? A help screen listing commands
+, <space>, or <NEXT> Next page of headers
-, or <PREV> Previous page of headers
=, or <HOME> Set current message to 1
*, or <SHIFT>-<HOME> Set current to last message.
Page 10
Msg Users Guide Version 3.2
<n> Set current message to n
a Alias, change to 'alias' mode
c Change current mail file
d Delete current message
f Forward message to specified user
g Group reply - reply to everyone who
received the current message
h Display message + headers
j Increment current message by one
k Decrement current message by one
m Mail to arbitrary user(s)
n or <return> Next message (Read current, then
increment)
o Option. Alter current options.
p Print current message.
r Reply to the author of current message
s Save current message to file
t The current time and date is displayed
q Quit - mail deleted, saved in mbox or
left.
u Undelete current message
v Variables. Display current variables.
x Exit - don't record as read, don't
save...
^L Rewrite screen.
^M (<return>) Read current message
^Q, ^Z, DEL Exit - don't record as read, don't
save...
That are all the commands available at the main level of the
msg program! Now you can see why it is nice to leave the
three-line menu displayed!
As an example, let's enter a series of commands and
indicate what the display would be after each one;
First off, let's go to the next page of mail with '+';
Page 11
Msg Users Guide Version 3.2
-----------------------------------------------------------------
Mailbox is '/usr/mail/mymail' with 13 messages. [Version 3.0]
N 11<- Apr 27 Jack Wanna buy some albums cheap?
N 12 Apr 28 Jack Cancel the previous offer!
N 13 Apr 30 sdcsvax!dx Moving day (long)
|=pipe, !=shell, ?=help, <n>=set current to n, /=search pattern
A)lias, C)hange mailbox, D)elete, F)orward, G)roup reply, M)ail,
N)ext, P)rint, R)eply, S)ave to file, Q)uit, U)ndelete, or eX)it
Mail :@
-----------------------------------------------------------------
We need to move the current message pointer to message
11, so type in '11', then let's read the new current message
by using the next command (typing <return>)...
-----------------------------------------------------------------
Message #11 from Jack Mailed December 7, 1984 at 8:45 pm
Hey Dave! I've got some old AC/DC and KISS albums, and as I know
you are a collector, do you want to buy them off of me before
I make ashtrays out of them (or frisbees...)?
Humourously,
Jack The Gripper
Please press <space> to return: @
-----------------------------------------------------------------
Page 12
Msg Users Guide Version 3.2
Needless to say, we can't let this message go by
without replying! So let's press the <space> bar to return
to the main menu, then use the reply command to respond.
After pressing the 'r' key, the program asks if a copy
of the source message is desired (the character under the
cursor indicates the default if <return> is pressed. In
this case, the default is 'no');
copy source message? (y/n) @
We choose to answer no, so press the 'n' key. Next msg
verifies that the subject is okay;
Subject: Re: Wanna buy some albums cheap?@
Typing anything other than <return> will allow us to change
the subject to something more appropriate. Furthermore, if
we choose to type our "kill line" character (the same as the
one the shell uses, probably Control-U or Control-X) the
entire line will be erased. We decide, however, to leave it
be and press return.
Finally, we're asked if we want to send copies of this mes-
sage to anyone. We don't, so we press <return> one more
time.
The program then puts us in the vi editor (the default,
assuming no other editor specified by the '.msgrc' variable
"editor") with a blank file.
After having entered a suitable reply, and left the
editor, the msg system then verifies that we really want to
send the message with;
Are you sure you want to send this message? (y/n) @
To which the response is 'y' for 'yes'. It then sends the
message off to Jack, who will receive it hopefully quite
soon (or at least before he makes ashtrays out of the
albums!)
Also, if we have a file called ".msgheaders" in our
home directory, the mailer will include those headers in the
outbound message. This is to allow custom (personalized)
mail, especially headers like "Organization:" and "Loca-
tion:".
Page 13
Msg Users Guide Version 3.2
Message 11 is still the current message, so, now that
we have saved it, let's mark it for deletion by using the
delete command 'd'.
The screen is now;
-----------------------------------------------------------------
Mailbox is '/usr/mail/mymail' with 13 messages. [Version 3.0]
N 11 * Apr 27 Jack Wanna buy some albums cheap?
N 12<- Apr 28 Jack Cancel the previous offer!
N 13 Apr 30 sdcsvax!dx Moving day (long)
|=pipe, !=shell, ?=help, <n>=set current to n, /=search pattern
A)lias, C)hange mailbox, D)elete, F)orward, G)roup reply, M)ail,
N)ext, P)rint, R)eply, S)ave to file, Q)uit, U)ndelete, or eX)it
Mail :@
-----------------------------------------------------------------
Now lets go back to the first page of messages by typing '=';
Page 14
Msg Users Guide Version 3.2
-----------------------------------------------------------------
Mailbox is '/usr/mail/mymail' with 13 messages. [version 2.2]
1<- Apr 3 rob Doing anything tonight?
2 Apr 5 hplabs!joe bug in gammon game
3 Apr 5 root
4 Apr 6 root (continuation of previous message)
U 5 Apr 8 decvax!mouse Re: net.music article decvax:495
6 Apr 13 John Jacob How can you hate RUSH?
7 Apr 15 kevin More software requests
N 8 Apr 18 games Hi there
N 9 Apr 18 Dave Taylor EditFile.c source...
N 10 Apr 23 veeger!carl More silly stuff
|=pipe, !=shell, ?=help, <n>=set current to n, /=search pattern
A)lias, C)hange mailbox, D)elete, F)orward, G)roup reply, M)ail,
N)ext, P)rint, R)eply, S)ave to file, Q)uit, U)ndelete, or eX)it
Mail :@
-----------------------------------------------------------------
Gee..note five not only looks mildly interesting but
it's an Urgent message too! So let's read it by typing
'5'<return> to make that the current message, and press
<return> again to read it. After reading the message we
decide that this seems like a message worth keeping in the
'music' mailbox, so lets do that by using the save to file
command!
Pressing 's' results in the msg system prompting;
Save to what file : @
to which we reply '=/music'. The file is then saved in the
directory we specified as mail home via the '.msgrc' vari-
able "maildir". After saving, the "Mail:" prompt returns,
with message 5 marked for deletion and the current message
pointer incremented to message 6.
Before we finish up, we suddenly remember that one of
the messages was supposed to be about how to write decent
documentation for Unix systems, so let's try to find it...
First off, we'll move back to message one with the
<HOME> key (you'll need to use the "-k" starting option and
be on an HP terminal for this to work!) and then use the '/'
pattern matching command:
Page 15
Msg Users Guide Version 3.2
Mail: Pattern / = match anywhere in messages
Match pattern: @
we'll type in 'document' and see if the system can find it.
After a brief second or two it returns 'pattern not found.'
Hmm...maybe it's not either the from or the subject of any
of the messages...In case, let's try using the new match
anywhere in message command;
Mail: @
To which we type '/' for pattern matching;
Mail: Pattern / = match anywhere in messages
Match pattern: @
Now we'll use '/' again to get the match anywhere in file
option, and then get the prompt;
Match pattern (in entire mailbox): @
to which we respond 'document' again.
The msg mailer then searches through each line of all
the messages in the file and moves the current message
pointer to message number 7. A quick check reveals that
this message indeed contains the word 'document', but it's
not the one we want, so we're going to just get outta here!
We've had enough mail for today, so lets quit, saving
all messages in our mailbox as defined in the '.msgrc' file,
except messages 5 and 11, which are marked for deletion.
Quit prompts;
Delete messages? (y/n) @
to which we answer 'y' for yes. The next prompt is then;
Keep mail in incoming mailbox? (y/n) @
To which we also answer yes...the program then quickly saves
the files, removing message 5 and 11 as it goes along, and
exits.
Page 16
Msg Users Guide Version 3.2
6. Responses...
This section will discuss each command in the msg pro-
gram in more detail than above, including the prompts the
user can expect upon executing the command, the meaning of
different options etc etc.
| Pipe. This command allows you to pipe the current
message through other filters as you desire. The
shell used for the entire command will be either
the one specified in your ".msgrc" file, or, if
none, /bin/sh.
! Shell. This allows you to send a command to the
shell without leaving the program.
? Help. This command produces a two-page display
that details all the commands available in a
reference guide format.
/ Pattern match. This command, on the top level,
allows the user to search through all the from and
subject lines of the current mailbox starting at
the current message and continuing through the
end. If the first character of the pattern is a
'/', then the program will try to match the speci-
fied pattern against ANY line in the mailbox.
Again, this works from one after the current mes-
sage through the end.
<n> Specify new current message. Typing in any of the
digits one thru nine will result in the msg pro-
gram producing the prompt 'Set current to : n',
where 'n' is the digit entered. Note that changing
the current message to a message not on the
current page of the headers will result in a new
page of headers being displayed.
a Alias. The alias system is a way by which more
complex mail addresses can be shortened for the
mail user. For example;
joe, blow : Joe Blow : veeger!hpcnoe!hpcfla!jblow
which allows mail to 'joe' with the system expand-
ing the address properly. As is obvious, this not
only saves remembering complex addresses, it also
allows the address to be optimized to go through
Page 17
Msg Users Guide Version 3.2
the minimum number of machines without anyone hav-
ing to be informed of the change. A more detailed
discussion can be found in the section entitled
'The Alias System'.
c Change mailbox. Specifying this command allows
the user to change the mailbox file that is
currently being read. This is intended for
perusal and reply to previously archived messages.
The prompt is 'Name of new mailbox : ' and enter-
ing <return> cancels the operation, while entering
a filename causes the program to read that file as
the new mailbox file, if possible. As with the
"save" command, this command expands filenames
with '~' being your home directory and '=' being
your MAILDIR directory, if defined. This command
also allows the special character '!' to be used
to allow you to change to the default incoming
mailbox.
d, u Delete and Undelete. Neither of these two com-
mands have any prompts and indicate their action
by either adding an asterisk to the current mes-
sage index entry (indicating deletion pending) or
removing the asterisk (indicating that the dele-
tion is cancelled).
f Forward. Allows the user to forward the current
message to another user. This copies the message
into the edit buffer and allows the user to add
their own message too. The prompt is 'Forward
to:' and will expand an alias if entered.
j, k These two keys work similarly to what they would
do in 'vi' or any of the other screen oriented
programs. The 'j' key moves the current message
pointer down to the next message (going to the
next page if needed) and the 'k' key moves the
current message pointer back to the previous mes-
sage (also changing pages if needed)
m Mail. Send mail to a specified user. The prompt
that is associated with this command is 'Send mail
to :'. Entering an alias name results in the full
address being rewritten in parenthesis immedi-
ately. This prompt is followed by 'Subject:'
which allows the user to title their note. The
final field is 'Copies to: ', which allows other
people specified to receive "carbon copies" of the
message. Upon entering all three items the vi edi-
tor (or any other editor specified by $EDITOR) is
Page 18
Msg Users Guide Version 3.2
invoked and the message can be composed.
n Next message. See above.
o Options. This is a small subsystem of the msg
system with the various options selected by their
first letter, '1' enabling the option, '0' disa-
bling it and <return> leaving it unchanged. 'r'
returns to the main system.
p Print message. This allows you to print out the
current message to a previously defined printer
(see the section on the '.msgrc' discussing the
"print" variable)
q Quit. This command's action is dependent on the
current state of the msg program. For example, if
the current mailbox is the default mailbox the
messages that are not deleted are saved in the
file $home/mbox, whereas if it is a specified
mailbox the to-be-deleted messages are removed
from the file. The possible prompts are 'Save to
mailbox?' if the default mailbox is being read and
there is at least one message to save, 'Delete all
messages' if all messages in any mailbox are
marked for deletion or 'Delete message(s)?' if not
reading the default mailbox and there are some
messages that should be saved. A response of 'n'
(no) to any of these questions will result in the
quit command aborting, and the files being
untouched.
r Reply. Reply to the author of the current mes-
sage. If the autocopy flag is not specified, the
program will prompt 'Copy Message? (y/n)' to which
the user can specify whether a copy of the source
message is to be copied into the edit buffer, or
not. If copied in, all lines from the message are
prepended with the prefix character sequence, as
specified in the users ".msgrc" file.
s Save to file. As demonstrated in the above exam-
ple, this command allows the current message to be
copied into an arbitrary file. If there is any-
thing in the file currently the message is
appended to the end, otherwise the file is created
containing only the message. The prompt for this
command is 'Save to file : '. A response of
<return> cancels the command and returns the user
to the system prompt. After saving a file, the
message is marked for deletion and the current
Page 19
Msg Users Guide Version 3.2
message pointer is incremented. There are two
available meta-characters when specifying a
filename too - '~' as the first character expands
to your home directory, and '=' as the first char-
acter expands to the mail folder directory defined
via the 'maildir' variable in the users ".msgrc"
file.
t Time. This simply displays the current date and
time in a nice readable format.
v Variables. This is also a small subsystem of the
msg system allowing you to alter the value of
various msg variables. The variables that you can
change are the 'EDITOR' variable which determines
what editor to use when you compose a message, the
'MAILBOX' variable which indicates where mail is
to be put after being read, and the 'USERNAME'
variable. (Note that only the superuser can
change their username within the program)
x Exit. This is functionally the same as answering
'n'o to the quit command prompt, and simply leaves
the program in the quickest possible manner. This
command can also occur from typing DELETE,
control-Q or control-Z, all of which are also exit
commands.
7. Special Outgoing Mail Processing
There are a few extra features that the mailer offers
on outgoing mail that are worthy of mention;
The first, and probably the most exciting feature, is
the ability to send encrypted mail! To do this is extremely
simple: You need merely to have two 'key lines' "[encode]"
and "[clear]" in the message body.
Consider the following outgoing message:
Joe,
Remember that talk we had about Amy? Well,
I talked to my manager about it and he said...
uhh...better encrypt this...the usual 'key'...
Page 20
Msg Users Guide Version 3.2
[encode]
He said that Amy was having family problems
and that it had been affecting her work.
Given this, I went and talked to her, and
told her I was sorry for getting angry. She said
that she understood.
We're friends again!!
[clear]
Exciting stuff, eh?
Mike
While this is obviously quite readable while being typed
into the editor, as soon as the message is confirmed as
wanting to be sent, the msg mailer prompts with;
Enter encryption key: @
and accepts a key (or series of 8 or less characters)
without echoing them to the screen. After entry, it will
ask for the same key again to confirm it, then *poof* it
will encrypt and send the mail!
If you have the "copy" option enabled, the program will
save your copy of the message encrypted too. (This is to
ensure the privacy and security of your archived mail too!)
If the mailer doesn't ask for the encryption key, it's
because you don't have the '[encode]' entered as the first 8
characters of the line. It MUST be so for this to work!!
On the other end, a person receiving this mail (they
must also be using msg to receive it, since this mailer has
a unique encryption program) will be reading the message and
then suddenly be prompted;
Enter decryption key: @
and will again be asked to re-enter it to confirm. The pro-
gram will then on-the-fly decrypt the mail and display each
line as it is decoded. The '[clear]' line signifies that
the block to encrypt is done.
For those sites not running msg, I also have available
the encryption code as a separate program suitable for a
filter for use with other mailers...
Page 21
Msg Users Guide Version 3.2
The other option on outgoing mail is the ability to
specify what section of the message you want to have
archived (assuming "copy" is enabled) and what section you
don't. This is most useful for sending out source file
listings and so on...
To indicate the end of the section that should be saved
in the archive, you need merely to have the line
[no save]
appear by itself on a line. This will be removed from the
outgoing mail, and will indicate the last line of the mes-
sage in the saved mail.
8. The Mail Archive File
The format of the mail saved to the archive file is
also worth a quick discussion. Unlike the usual exact copy
of the entire header section, the archived mail has the fol-
lowing header;
From To:<name> 15 Jan 1985 4:54:30 MST
Original-To: <address>
Subject: <subject>
<message body>
The first line, the 'From' line, is deliberately mangled
with the occurance of the 'To:<name' to ensure that when you
are perusing your archive file with the mailer that you see
WHO the message was TO, since they're all going to be FROM
you!! The <name> will either be the machine!login of the
person, or, if used as an alias, it will be the alias name.
To read this file, you can use the mailer, choosing the
"C)hange mailbox" command, or start up specifying your
archive file as the mailbox to read.
Page 22
Msg Users Guide Version 3.2
9. Using MSG with the Notes System
A new and innovative feature in the 3.0 release of the
msg program is the ability to read files saved by the notes
system and display them as individual messages. Unfor-
tunately, the notes software does not currently save a note
with the subject line, however, so the mailer uses the next
best thing and displays each note in the form:
1 Apr 5 hplabs!kundler Note from group net.unix-wizards
2 Apr 7 hplabs!richards Note from group net.unix-wizards
and so on. The individual notes can be replied to by using
the reply command, as with normal mail, and the mailer will
modify it's behaviour to work with this particular brand of
mail file.
How does the mailer know if it's reading a file that
contains normal mail versus a saved set of notes? By check-
ing the first line of the file - if it's the header line
that notes emits (ie "/***** host:login / notesgroup / date
**/") then the file is considered to be a notes file. If
not, the default for unknown files is to assume they're mail
files.
10. The Alias System
As mentioned previously, there exists in the msg system
a set of aliases that associate an arbitrary word (such as a
persons name) to a complex address or group. The advantages
are readily apparent; rather than remembering an address of
the form;
machine1!machine2!machine3! ... !machineN!account
the user merely has to remember a single word.
Two alias tables are available for a each user within
msg, namely the system alias file and the users' alias file.
The system alias file is created and maintained (by the sys-
tem administrator) by editing the file
'/usr/mail/.alias_text' as described in the documentation
with the newalias command, then running the newalias pro-
gram.
Page 23
Msg Users Guide Version 3.2
An individual user can also have an alias file which
works in conjunction with the system aliases. To do this,
they need merely to peruse the documentation for the
newalias command and create a file as indicated therein.
After executing the program, the aliases will be available
for using from within msg.
The command checkalias is also useful to ensure that
the aliases are installed correctly.
Within msg, however, the alias system acts as an
entirely different program, with it's own commands and own
mini-menu. The menu replaces the standard mini-menu with;
---------------------------------------------------------------------
Alias commands
A)lias current message, C)heck alias, M)ake user alias, R)eturn
Alias: @
---------------------------------------------------------------------
The commands are;
a Alias current message. This allows the user to
create an alias that has the return address of the
current message as the address field of the alias.
It prompts for a unique alias name. Important
note: when you alias an address in this fashion,
the mailer will try to minimize the amount it
needs to store by iteratively comparing machine
names in the path with the machines in the
pathalias database. Once it finds an entry the
address will be saved at that point. For further
information, please see the "Msg Alias System
Guide".
c Check alias. This is a simple way of checking
what is in the alias database - it prompts for an
alias name, and returns the address associated
with that name or the error message 'alias not
found' as appropriate.
m Make user alias. This will prompt for a unique
alias name and then for an address. The informa-
tion provided will be added to your individual
alias_text file ($home/.alias_text) and then added
Page 24
Msg Users Guide Version 3.2
to the database.
r Return. Return to the main level of the msg pro-
gram.
11. While We're Talking Aliases...
Another feature worthy of discussion, since it's been
getting lots of veiled references throughout this document,
is the system alias section. This is implemented using the
uucp pathalias database, with a file (whose location is
specified in the hdrs/sysdefs.h file - see the Configuration
Guide) in the format:
hostname <tab> address!%s
The actual details of the file are, suprise suprise, located
in the Alias System Users Guide.
Anyway, to use them is quite simple...when specifying
the address of someone, you can either have an alias for
them already, resond to their mail to you, or use the system
alias feature!
Enough hype, right? Okay...to use this feature, you
specify an address by either "machine!person" ignoring if
your specific machine can talk directly to the machine
specified, or, if you prefer the ARPANET addressing scheme,
"person at machine". When you enter the address as specified,
the mailer will quickly search through the pathalias data-
base file and expand the specified address to be a legiti-
mate routing address.
What's really nice about this is that the address that
we're going to send to can be either on ARPA, CSNET, BITNET,
uucp, or any other network. The method of specifying the
basic address is the same regardless!
For example, mail to me could be sent as either
"hpfcla!d_taylor" (or "hpfcla!hpcnof!d_taylor", with the
first machine name being expanded) or "d_taylor at hpfcla".
msg will expand them both in the same manner.
As the song goes, check the alias guide...
Page 25
Msg Users Guide Version 3.2
12. Expert Mail Users and Debugging the Mailer
There are some additional facilities available in the
msg mailer for those people who are knowledgable about mail
protocols, or trying to debug/track down a problem.
The 'h' command at the outermost level of the mailer
will display the current message ignoring the current set-
ting of the 'weed' option. This is most useful for answer-
ing questions of the form "I wonder what this guy put in his
header?" and such. This command does not show up on the
mini-menu because it is somewhat esoteric, but it DOES
appear on the '?' help screen (can you find it there?).
The '@' command at the outermost level of the mailer
will output a screen of debugging information, including the
number of lines and offsets of each of the message in the
current mailbox.
The '#' command at the outermost level of the mailer
will display the entire stored 'record structure' for the
current message.
The '%' command at the outermost level of the mailer
will display the full computed return address of the current
message.
Starting up msg with the "-d" debug option will create
a file called Msg.debug.info in your home directory and con-
tain a wealth of useful information (to me, at least!) to
aid in tracking down what errors are occuring and why. With
this option on, most everything acts the same with the
exception of when you get new mail while in the mailer - it
will indicate "New mail: N bytes" rather than the usual "New
mail has arrived...hang on...".
If there are any problems with the mailer, please try
to recreate the error with the debug option enabled before
sending defect reports my way.
One final note: all error numbers reported by the pro-
gram are defined in the HP-UX Reference Manual in Errno(2).
Page 26
Msg Users Guide Version 3.2
13. Credits and so on
This mailer has been evolving over the past year or so
with some extremely valuable input from the following people
at Hewlett Packard; Mark Laubach, Walt Underwood, Tw Cook,
Larry Fenske, Rob Sartin, and of course Carl Dierschow.
There have been many others, to numerous to mention, that
have inspired me with questions like "why can't the
mailer..." or "why does it do that?"
Also helpful was the ability to have my 'own' machine
to close up the many many iterative loops that this software
has gone through - since being on a big multi-user machine
tends to slow it down to a standstill...
Finally, it's also been a very useful experience
overall, confirming my beliefs that iterative software
design and keeping a close watch on users (not to mention an
open mind and mailbox!) improves a product manyfold.
Incidentally, this entire mail system, including this
documentation, is
(C) Copyright 1986 Dave Taylor
Page 27
SHAR_EOF
if test 50526 -ne "`wc -c < 'Guide.fmtd'`"
then
echo shar: error transmitting "'Guide.fmtd'" '(should have been 50526 characters)'
fi
fi
exit 0
# End of shell archive
More information about the Mod.sources
mailing list