[comp.sources.unix] v14i045: Mail User's Shell, version 6.0, Part13/14

rsalz@bbn.com (Rich Salz) (04/16/88)

Submitted-by: island!argv@sun.com (Dan Heller)
Posting-number: Volume 14, Issue 45
Archive-name: mush6.0/part13

[  This is the third part of the manual page; do
	cat mush.1.[abc] >mush.1
   to get the whole thing.  --r$ ]

#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of archive 13 (of 14)."
# Contents:  mush.1.c
# Wrapped by rsalz@fig.bbn.com on Wed Apr 13 20:04:56 1988
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'mush.1.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'mush.1.c'\"
else
echo shar: Extracting \"'mush.1.c'\" \(38739 characters\)
sed "s/^X//" >'mush.1.c' <<'END_OF_FILE'
X.sp
X.ti +2
pick -f island!argv@sun.com | sort s
X.sp
This finds all messages from the user \*Qisland!argv@sun.com\*U
and sorts them by subject.
Since these messages are already grouped together via the
previous sort command, the sorting by subject (s) will restrict itself
to such messages.
You may specify the exact message list by specifying
that message list on the command line and using a pipe:
X.sp
X.ti +2
X10-. | sort d
X.sp
This command means to sort the messages from 10 to the current message
according to the date.
X.sp
To specify subsorting from with the curses interface, the temporary
curses escape key must be used (the colon `:') and the command issued
at the command line given (as if giving an \*Qex\*U command to \*Qvi\*U).
When the command is finished, the \*Q...continue...\*U prompt is given and
the user may continue or return to the top level of the curses mode.
X.sp
In the tool interface, the user must map a function key to the desired
command.
Select the \*QOpts\*U icon with the right mouse button, choose
the menu item labeled \*Qfunction keys\*U and use the interface provided
to set a function key to the desired piped mechanism.
X.TP
X.B stop
For systems with job control, stop will cause
X.I Mush
to send a SIGTSTP to itself.
The command was introduced to facilitate
the stop-job action from a complex command line alias rather than the user
having to type his stop character explicitly.
X.TP
X.B top
Takes a message list and prints the top few lines of each.
The number of lines printed is controlled by the variable
X.B toplines
and defaults to the size of the value of the variable
X.B crt.
This command is ignored in the tool mode.
X.SH VARIABLES
Shell variables are controlled via the
X.B set
and
X.B unset
commands.
Options may be either boolean, in which case it is only
significant to see whether or not they are set;
string, in which case the actual value is of interest;
or numerical, in which the numerical value is important.
Some variables may have attributes
of boolean and string at the same time.
X.sp
If you or the program references a variable which is not explicitly set,
then the environment variables are checked and a pointer to that data
is returned.
Following is a list of all predefined variables.
X.TP
X.B alwaysignore
X(Boolean)
If set, the mail headers set by the
X.B ignore
command are always ignored.
Normally, ignored headers are not ignored when sending messages to
the printer, when interpolating messages into letters with ~f or ~h,
when the `P' or `T' command is given (see the \fBprint\f command),
or with the -h flag to the
X.B mail
or
X.B reply
commands.
Setting
X.B alwaysignore
will ignore those headers even in the situations mentioned here.
No headers can be ignored during updates and when using the
X.B save
command since the user may ignore headers which are required by
X.I Mush
or any other mail system to read those folders.
X.sp
Also see the
X.B ignore
command for more information.
X.TP
X.B ask
X(Boolean)
If set, you will be prompted for a subject header for outgoing mail.
If not set, the Subject header will be displayed as a blank header.
Use the tilde escape \*Q~s\*U to set the header once in the message
or specify the -s option on the
X.B mail
command line at the
X.I Mush
prompt.
X.TP
X.B askcc
X(Boolean)
If set, you will be prompted for a Cc (carbon copy) list when you are
finished editing a letter to be sent.
In the tool mode, this is ignored; the Cc list
is always prompted for after the Subject prompt.
X.TP
X.B autodelete
X(Boolean)
When exiting mail, all messages which have been read
X.I "regardless of whether they have been marked for deletion"
are removed.
Only messages that haven't been read or marked as
X.BR preserved ,
are not removed.
X.TP
X.B autoedit
X(Boolean)
If set, you are automatically put into your editor whenever you
send or reply to mail.
X.TP
X.B autoinclude
X(Boolean)
When replying to any mail, a copy of the message being replied to
is automatically inserted into your message body indented by
the string described by the variable
X.BR indent_str .
X.TP
X.B autoprint
X(Boolean)
After you delete a message, the next message is printed automatically.
X.TP
X.B auto_route
X(Boolean)
This variable has two functions, both of which only concern the command,
X.BR replyall ,
and is only important to users who use UUCP to mail to remote sites.
The first function is to cause replyall to modify the return addresses
of all recipients to route through the original sender's host.
The problem with UUCP mail delivery is that mail delivery is frequently
routed through other computers before the message finally gets to its
destination.
If the original sender of the message was on a remote
machine which your machine does not exchange UUCP mail with, then a UUCP
path containing hosts which you do talk to will have to be
created to respond to the author.
However, if he mailed to other people
on machines which are also multi-hops away, the addresses he used for
those recipients may differ from what you should specify if you were to
try to reply to everyone on the listed in the original message.
X.sp
For example, if the original sender came from remote host,
X.B pixar
and the list of recipients looked like,
X.sp
X.nf
X.in +2
From: pixar!user1
To: yourhost!you
Cc: r2d2!user2, r2d2!user3
X.in -2
X.fi
X.sp
Clearly, \*Quser1\*U on the machine pixar can talk to your machine
and the machine named r2d2.
However, you would not be able to respond to those users if your machine
did not exchange UUCP mail with the host r2d2.
X.sp
X.I Mush
will attempt to solve this problem if
X.B auto_route
is set.
An attempt will be made to compensate by reconstructing the addresses
for \*Quser2\*U and \*Quser3\*U according to the address of the original
sender, \*Quser1\*U.
The new addresses for \*Quser2\*U and \*Quser3\*U should therefore become,
X.sp
X.ti +2
pixar!r2d2!user2, pixar!r2d2!user3.
X.sp
If your machine not only talks to pixar,
but talks to r2d2 as well, it becomes unnecessary to route the mail
through both pixar and r2d2.
The variable
X.B known_hosts
may be set to a list of hosts which you know your machine to have
UUCP mail connections with.
This list is checked when constructing
mail addresses and the shortest path is made by removing from the
UUCP path those hosts which do not need to be called.
See the entry for
X.B known_hosts
for more information.
X.sp
An additional feature of the
X.B auto_route
variable is that all redundant hostnames from UUCP pathnames are removed
to avoid unnecessary UUCP connections and speed up mail delivery.
Normally, this is the responsibility of the
X.IR "Mail Transfer Agent" ,
or MTA.
But it might be the case where the MTA at your site is not
smart enough to figure out such redundant paths.
In either case, the algorithm for removing redundant hosts is simple and
should probably be used.
An example of how auto_route truncates UUCP paths:
X.sp
X.ti +2
pixar!island!sun!island!argv
X.sp
Here, mail was probably originally sent to users at pixar and sun from
somewhere undetermined now.
Since sun and pixar do not talk to each other, the users on those machines may
have responded to mail creating the type of addresses stated above.
Here, it can be seen that we can reduce the path to the host
X.IR island :
X.sp
X.ti +2
pixar!island!argv
X.sp
See the MAIL ADDRESSES section for more detailed information
about legal mail addresses.
X.TP
X.B autosign
X(Boolean/string)
Append a signature to outgoing mail.
If this variable is set, but not to a string (e.g., boolean-true),
then the file ~/.signature is used.
X.sp
Otherwise, the variable is interpreted in one of three ways.
By default, the string is interpreted as a pathname relative to the
X.I current
directory.
For this reason, it is advisable to use full pathnames here.
As usual, the special characters `~' and `+' are expanded.
If a file is found, it is opened and its contents are read into the
message buffer.
X.sp
If the variable is set to a string that begins with `$', then that string
is interpreted as a user-definable variable and is expanded and appended
to the letter.
X.sp
Finally, if the variable is set to a string that begins with a backslash (\\),
then the string itself (minus the `\\' character) is used; no expansion
is done and no files are read.
X.sp
In the latter two cases, it is advisable to set the variable using single
quotes to avoid expanding the variable beforehand or eliminating the
backslash.
Examples,
X.sp
X.ti +2
set autosign = '$foo'
X.ti +2
set autosign = '\\  Dan Heller island!argv@ucbcad.berkeley.edu'
X.sp
Warning: if redirection from the calling shell is used, there will be
no signature or forutne added to outgoing mail.  For example,
X.sp
X.ti +2
X% mush -s report manager < report_file
X.sp
In this command, mail is being sent to the user \*Qmanager\*U and the
subject is set to \*Qreport\*U and the file \*Qreport_file\*U is being
redirected as input.  In this case, there will be \fIno\fR signature
appended.
X.TP
X.B autosign2
X(String)
This alternate signature is available for special cases where the default
signature is not desired or if no signture is desired for special addresses
or if special addresses only require a signature.
The format for this variable is:
X.sp
X.ti +2
autosign2 = \*Qaddress1, address2, ... : <signature>\*U
X.sp
The addresses are legal mailing addresses but do not contain comment
fields (see the sections MAIL ADDRESSES for more information on legitimate
mail addresses).
The signature description is the same as described by
X.B autosign
above.  The colon (:) separates the list of addresses from the signature
description.  If there is no colon or the address list is missing, the
entire string is considered the signature (except for the colon).
X.sp
If
X.B autosign
is not set, then autosign2 will ONLY work if the tilde command \*Q~S\*U
is specified.  In this way, a user may never have autosign set and just
set autosign2 to be some signature value.  The user may then issue the
tilde command to automatically sign the letter.
If a list of addresses is given (terminated by a colon), then all
recipients of the message must be in the list of addresses in autosign2;
otherwise, the signature in \fBautosign\fR (if set) is used instead.
A null signature in autosign2 will not sign the letter.
X.sp
Example:
X.ti +2
set autosign2 = "fred, barney, wilma, betty: ~/flintstone.sig"
X.sp
If a message is sent to:
X.sp
X.ti +2
To: fred, wilma
X.sp
Then the file ~/flinstone.sig will be used.
However, if the address were:
X.sp
X.ti +2
To: barney, betty, bambam
X.sp
Then autosign2 will not be used because bambam is not in the list.
X.sp
Note that mail sent via redirection from the calling shell will not
sign letters or append fortunes.
X.TP
X.B cdpath
X(String)
Set to a string of pathnames separated by spaces to use when searching
for a directory when the
X.B cd
command is issued.
If this variable is used, it is recommended that the path `.' be included.
Note that this differs from the
X.IR csh ,
which does not require that `.' be present.
X.TP
X.B crt
X(Numeric)
Set to a value which describes the number of lines a message
must have before invoking the
X.B pager
to view a message.
X.TP
X.B cwd
X(String)
The
X.B "current working directory"
string is automatically set upon startup of
X.I Mush
and is reset each time the command
X.BR cd ,
is called.
It is referenced each time
X.B pwd
is called and may be used as any other shell variable.
X.TP
X.B dead
X(String)
File to use instead of dead.letter when interrupted mail is saved.
For more information, see the variable,
X.B nosave.
X.TP
X.B dot
X(Boolean)
Accepts a `.' on a line by itself, in addition to `^D', to terminate messages.
X.TP
X.B editor
X(String)
Editor to use when \*Q~e\*U is specified.
Default is the value of the variable
X.BR visual .
X.TP
X.B escape
X(Character)
When typing in a letter (not in an editor), when the
X.B escape
character is the first character on the line, the following character
is examined and a corresponding function associated with that
X.B "escape command"
is executed.
See
X.B "tilde escapes"
for more information.
X.TP
X.B folder
X(String)
The folder variable is set to a path where folders are kept.
X\&~/Mail is the default value.
X.TP
X.B fortune
X(Boolean/string)
If fortune is set, a random fortune is appended to the end of
all outgoing mail using the
X.I UNIX
command
X.B /usr/games/fortune
X(may vary from system to system).
If fortune is set to something that starts with
a `\-', then it is interpreted as a flag to fortune (e.g., \*Q\-o\*U).
If
X.B fortune
starts with a `/', then the program described by
the string is executed (thus not doing fortune at all, if you want).
By default,
X.I "fortune \-s"
X(short fortunes) is used.
X.TP
X.B fortunates
X(String)
When fortunes are added to messages, sometimes it is desireable to
make sure that only a selected group of people get a fortune since
certain people may not understand the messages at the end of your
mail.  Therefore, you can set a list of addresses (either pure addresses
or aliases which are expanded to addresses) to be the only people who
receive fortunes if one is to be appended.  Therefore,
if the To: and Cc: lines contain only address listed in this string
variable, then a fortune is appended to the message.
If those lists contain names which are not on the fortunates
list, then no fortune is added.
This cannot be overriden; using the
tilde command \*Q~F\*U does not force a fortune to be added unless the
list of individuals on the recipient list are all included in the fortunates
list.  The list is made up of addresses or aliases separated by spaces or
commas.
X.I "NOTE: fortune must be set in order for fortunates to work."
X.TP
X.B hdr_format
X(String)
This variable controls the format of the headers displayed by the
X.B headers
command and in the curses and graphics modes.
The format style of this variable string is similar to printf in C.
When printing the information, the variable is evaluated and each
character in the string is echoed unless a `%' character is
encountered.
If one is found, the following string substitutions are made:
X.sp
X.in +2
X.nf
X.ta 0.5i
X%a	address of the author
X%c	number of characters (bytes) in the message
X%f	entire \*QFrom:\*U field (author)
X%l	number of lines in the message
X%n	name of the author
X%s	subject of the message
X%t	\*QTo:\*U field (recipients)
X%d	entire date of the message
X%T	the time only of the message
X%N	the day number of the month of the message
X%D	the day or the week (Sun, Mon, etc.)
X%M	the month name of the message
X%Y	the year of the message
X\\n	a newline
X\\t	a tab
X.fi
X.in -2
X.sp
A field width specifier may be used in all options.
Thus, \*Q%20f\*U will print the
first 20 characters of the from line.
No matter what the formatting string, the message number
followed by a `>' (for current message) is printed.
X.sp
The \*Qaddress\*U and \*Qname\*U of the author
are extracted from the \*QFrom:\*U field of the message.
The name may be given in parentheses and
the rest of the line is the address, or the address is given in angle
brackets (`<' and `>') and the rest of the line is the name.
Sometimes the address is the only thing on the line,
in which case the name and address are the same.
X.sp
X.TP
X.B hold
X(Boolean)
Normally, on termination of mail, read messages are saved in
your mbox (except those marked as preserved).
Setting
X.B hold
prevents this from happening,
and messages remain in /usr/spool/mail/user.
This does not apply to folders, obviously.
X.TP
X.B home
X(String)
This variable describes the user's home directory.
The variable is initialized to the value of the environment variable HOME,
but can be modified at any time during the
X.I Mush
session.
The home directory is the same directory where temporary
files are kept for editing and so forth.
If the home directory cannot be found or read/write access is denied, an
alternate directory, typically /tmp, is used.
X.TP
X.B ignore_bang
X(Boolean)
If set,
X.I Mush
will ignore the `!' character as a history reference.
X.TP
X.B ignoreeof
X(Boolean/string)
If set, `^D' will not exit from
X.IR Mush .
If set to a string, that string is executed as a command
when `^D' is typed.
This does not effect termination of messages under the
X.B mail
and
X.B reply
commands.
X.TP
X.B in_reply_to
X(String)
This variable may be set to a string which will complete the
header \*QIn-Reply-To:\*U.
The format of this string is identical to the options for the variable
X.BR hdr_format .
X.sp
For example, if the user were to respond to a message
from Dan Heller that was sent on October 21, 1987 at 10:39pm, with
X.B in_reply_to
set to the string
X.in +2
X.sp
X%n's message as of %d.
X.sp
X.ti -2
the header line
X.sp
In-Reply-To: Dan Heller's message as of Oct 21, 1987 10:39pm.
X.in-2
X.sp
would be added to the message.
X.TP
X.B indent_str
X(String)
When including messages into the text of a letter you are editing,
each line of the messages is preceded by the value of
X.BR indent_str .
If it is unset, the message body is indented by the string \*Q> \*U.
See also the variables
X.B pre_indent_str
and
X.BR post_indent_str .
X.TP
X.B keepsave
X(Boolean)
If set, the commands
X.B save
and
X.B write
will
X.I not
mark messages for deletion.
X.TP
X.B known_hosts
X(String)
Used in conjunction with the variable
X.BR auto_route ,
this variable is set to a list of hosts, separated by spaces, tabs,
and/or commas, and describes
the hosts with whom you know your machine shares UUCP connections.
When replying to mail, many times you will see that the return path
constructed will have hostnames which your site could call, but instead
the mail has been routed through a number of different machines first.
X.sp
For example, if you respond to mail which would mail to the path,
X.sp
X.ti +2
unicom!pixar!root
X.sp
but your know your machine already calls pixar, then sending the mail
to unicom first is unnecessary.
If you have set your known_hosts string to include pixar in its list,
the resulting address would look like,
X.sp
X.ti +2
pixar!root
X.sp
Also see the command
X.B replyall
for more information on constructing correct return addresses.
X.TP
X.B lister
X(String)
Default arguments to the \*Qls\*U command for printing the
contents of a directory.
X.TP
X.B mbox
X(String)
Set to the pathname of a file you'd like mush to use as the default
holder for read mail.
The default is ~/mbox.
X.TP
X.B metoo
X(Boolean)
When replying to mail, you are normally deleted from the list of
recipients.
If metoo is set, you remain on the list.
See the 
X.B alternates
command
for information on determining whether or not you're even on the list.
X.TP
X.B mil_time
X(Boolean)
Whenever the time is displayed in a message header or in the prompt,
it can be displayed in either 12-hour am/pm format, or in 24 hour
military time format.
The default is the 12 hour format, but can be
reset to use the 24 hour format by setting this variable.
X.TP
X.B newline
X(Boolean/string)
If set, carriage returns are ignored.
If set to a string, that string is executed as a command when a
carriage return is typed.
Otherwise, carriage return prints the next undeleted message.
X.TP
X.B no_expand
X(Boolean)
When a
X.I Mush
alias is used to reference a list of addresses, the list is expanded on
the To: and Cc: lines to indicate the complete list of all the recipients of
the message.
When no_expand is set, aliases are not expanded and the headers
reflect the same information as typed by the user.
X.TP
X.B no_hdr
X(Boolean)
If set, this variable tells 
X.I Mush
not to include your personalized mail headers in messages.
This does not unset your headers, it just disables them.
X.TP
X.B no_reverse
X(Boolean)
In curses mode and in the tool mode, reverse video is not used to indicate the 
X.I "current message"
if this variable is set.
In the tool mode, if reverse video is not in use,
text is displayed in \*Qbold\*U.
X.TP
X.B nosave
X(Boolean)
When composing a letter, the user can terminate the letter without
sending it using the tidle escape \*Q~q\*U or by sending two \*Qinterrupt\*U
signals.
When the message is terminated, a copy of it is saved to the
file \*Qdead.letter\*U in the user's home directory or to the file described
by the variable,
X.BR dead .
If the variable,
X.B nosave
is set, then a backup copy of the message will not be saved.
X.TP
X.B pager
X(String)
If a message is longer than the number of lines that the variable
X.B crt
is set to, then this program is executed to view a message.
If the user does not have this variable set, the user's environment PAGER
is checked.
If this isn't set, then the default value for pager (set up
by the system manager) is used.
This may or may not be the internal pager.
To use the internal pager, you may set the variable pager to
X.I internal
or to a null string.
X.TP
X.B pre_indent_str
X(String)
If this variable is set, when including the body of a message into an outgoing
mail message (using the \-i option to
X.I reply
or
X.IR mail ,
or when using the \*Q~i\*U escape),
a line preceding the first line of
included text is printed using the string value of the variable.
This string uses the same printf style formatting characters as the
X.B hdr_format
variable.
For example, you could set
X.B pre_indent_str
as follows:
X.sp
X.ti +2
set pre_indent_str = '[In the message entitled "%s", on %7d\n %n writes:]'
X.sp
You can then include a message body using \*Q~i\*U, and you might
get something like this:
X.sp
X.in +2
X.nf
X[In the message entitled "This is a test.", on Jan 19,
X Dan Heller writes:]
X> This is a test message to show how
X> pre_indent_str might be used.
X.ti -2
X.sp
X.fi
This example assumes that the string value of
X.B indent_str
is not set.
X.TP
X.B post_indent_str
X(String)
This variable has the same function as
X.B pre_indent_str
except that the string is inserted into the message body
X.I after
the text of the included message rather than before.
The purpose of this variable is to complement the string described by
the variables
X.B pre_indent_str
and
X.BR indent_str .
For example,
X.sp
X.in +2
X.nf
set pre_indent_str = "/*"
set indent_str = " * "
set post_indent_str = " */"
X.sp
X.ti -2
An included message might look something like this:
X.sp
X/*
X * This is a test message to show how
X * post_indent_str and pre_indent_str
X * can work together with indent_str.
X */
X.fi
X.in -2
X.TP
X.B printer
X(String)
Used to set the default printer for the lpr command.
X.TP
X.B print_cmd
X(String)
This string should describe UNIX command other than "lpr" for sending
messages to the line printer.
Some people may choose to use a device independent
troff style program, but virtually any UNIX command will suffice.
Common usage might include:
X.sp
X.ti +2
set print_cmd = 'ptroff -ms -Plp'
X.ti +2
lpr .-$
X.sp
This command would send all messages from the current message to the last
message through the ptroff command, supplying the appropriate arguments.
Uncommon, but legal usage might include:
X.sp
X.ti +2
set print_cmd = 'write frank ttyp0'
X.ti +2
lpr *
X.sp
This command will send all your messages through to the \*Qwrite\*U
program and display them on Frank's terminal.
X.sp
X.TP
X.B prompt
X(String)
You can set your prompt to tell you many different pieces of information.
By default, the prompt is set to the string,
X.sp
X.ti +2
X\*QMsg %m of %t: \*U
X.sp
If you have 10 messages and your current message is 5, then your prompt
would look like:
X.sp
X.ti +2
Msg 5 of 10:
X.sp
The string value that prompt is set to will be printed as your prompt.
If the string contains a `%', then that character is
ignored, the next character is evaluated and an appropriate
value is printed in its place:
X.sp
X.nf
X.in +2
X.ta 0.5i
X%d	number of deleted messages
X%D	today's day (Sun, Mon, Tue, ...)
X%f	filename of the current folder
X%m	\*Qcurrent message\*U number
X%n	number of \*Qnew\*U messages
X%N	today's date (Number of the day in the month)
X%T	current time (hours and seconds)
X%t	total number of messages
X%u	number of unread messages
X%Y	this year
X\\n	a newline
X\\t	a tab
X.fi
X.in -2
X.TP
X.B quiet
X(Boolean)
If set, the currently running version of
X.I Mush
is not printed on startup.
X.TP
X.B record
X(String)
Set to the name of a file to record all outgoing mail.
This should be a full pathname or the current directory is searched.
The pathname may begin with `+' (indicating the user's ~/Mail directory
or the value of the 
X.B folder
variable) or with a `~' (or \*Q~user\*U)
indicating the user's home directory.
X.TP
X.B reply_to_hdr
X(String)
When replying to mail,
X.I Mush
searches for return paths from the message by searching for
the message headings \*QReply-to\*U, \*QReturn-path\*U, and \*QFrom:\*U,
in that order.
If none are found, then the first line of the
message created by the delivery system is parsed and the address
given there is used.
If the variable
X.B reply_to_hdr
is set to a of headers (delimited by spaces or commas), then that list
is searched.
If none of the headers listed in the variable exist
in the message, then a warning message is printed and the default
headers are used.
See the
X.B reply
command for more details.
X.TP
X.B sendmail
X(String)
If set, the program and arguments described by this variable will
be executed to actually deliver mail sent by
X.I Mush.
X.TP
X.B screen
X(Numeric)
May be set to the number of message headers to display at a time in the
line and curses modes.
X.TP
X.B screen_win
X(Numeric)
Man be set to the number of message headers to display in the tool mode.
A subwindow is created for message headers, and its size is large
enough to hold $screen_win headers.
X.TP
X.B show_deleted
X(Boolean)
If true, deleted message headers are displayed along with
other messages ('*' indicates a deleted message).
In curses mode, this variable is ignored and deleted messages are always
displayed with other messages to facilitate undeleting messages.
X.TP
X.B show_hdrs
X(String)
Set to a list (space and/or comma separated) of headers which are to be the
only headers displayed when viewing a message.
This variable disables the headers supressed by the
X.B ignore
command.
For example,
X.sp
X.ti +2
set show_hdrs = "from date subject to cc"
X.sp
will only display the headers,
X.B From: Date: Subject: To: Cc:
in their entirety.
X.TP
X.B sort
X(Boolean/string)
The value of this variable is the same as the arguments to the
X.B sort
command.
This variable is used for the initialization file to presort
mail in the system mailbox upon entering mush.
See the COMMANDS section for more information.
X.TP
X.B squeeze
X(Boolean)
Whenever messages are read, piped, or saved, if this variable is set,
all consecutive blank lines are squeezed into one blank line.
X.TP
X.B toplines
X(Numeric)
The number of lines of a message to print when the "top" command
is issued.
If unset, $crt lines are printed.
X.TP
X.B unix
X(Boolean)
If set, commands which are not
X.I Mush
commands are considered to be
X.I UNIX
commands.
This removes the inconvenience of requiring the user to do
shell escapes to do quick UNIX commands.
For systems that support job control, SIGTSTP will stop the entire shell as
well as the process being executed.
When SIGCONT is delivered, both will receive the
signal and the shell will continue to wait for the job to finish.
X.sp
Due to the lack of real job control, input/output redirection and UNIX command
piping, this mode of the shell is not intended to be used as a login shell.
X.sp
If a
X.I Mush
command conflicts with a UNIX command, use the command
X.B sh
to force execution as a shell command.
X.sp
X.I "WARNING: Be aware that Mush commands return message lists, NOT TEXT."
You cannot pipe UNIX or shell commands to or from UNIX commands.
UNIX commands should be simple commands without pipes or metacharacters.
X.sp
This feature is not available for the graphics (tool-based) mode.
X.TP
X.B verbose
X(Boolean)
Passes verbose flag to mail delivery systems when sending mail.
X.TP
X.B verify
X(Boolean)
When through editing messages, just before sending,
X.B verify
will ask you if you want to send, continue editing, or abort the
whole message all together.
X.TP
X.B visual
X(String)
May be set to the visual editor to use when ~v is specified.
Default is vi.
The visual editor is invoked by the \-e arguments to the
commands, 
X.B respond
and
X.BR mail .
X.TP
X.B warning
X(Boolean)
If set, warning messages are printed when:
X.in +4
X.ti -2
X\(bu a command line alias (\*Qcmd\*U) looks like a command.
X.br
For example,
X.ti +2
cmd mail 'set fortune; \\mail'
X.ti +2
cmd respond 'unset fortune; \\respond;'
X.ti -2
X\(bu a variable is set differently from its default value.
X.br
For example, if the escape character is set to something other
that the tilde (~), then a warning message will be printed.
X.ti -2
X\(bu a date format from a message is unknown.
X.br
The date of a message is taken from the \fBDate:\f header.
If the date on that header is unknown, other headers are searched for a
valid date format until a legal one is found.
This date may not be
correct in that it was the date the message was received, not sent.
X.in -4
X.sp
The intent is so that users who are used to their own environments
will be aware of changes in other environments should they be forced
to use them.
There may also be warning messages of failed routines
or assertions which are not fatal enough to interrupt normal running
of the program.
X.TP
X.B wrap
X(Boolean)
Normally, when the last message is deleted, the current message
pointer remains pointing to the last message and the user is done
reviewing his mail.
If the
X.B wrap
variable is set, the current message pointer will wrap around to the
beginning of the user's messages again to the next undeleted message.
This also applies to the
X.B next
command.
X.SH "MAIL ADDRESSES"
Whenever a command which requires a user address or set of addresses
is specified
X.RB ( mail ,
X.BR reply ,
X.BR alias ,
X.BR etc ),
the addresses given must be separated by commas.
Most casual users specify addresses that contain no comments or whitespace.
The simplest addresses are just the login names of the users you wish to send
your message to:
X.sp
X.ti +2
X\fBmail\fR fred barney wilma betty
X.sp
In these cases,
X.I Mush
can figure out that they are separate addresses and
insert commas between addresses automatically.
X.sp
X.ti +2
To: fred, barney, wilma, betty
X.sp
Addresses may also contain `!', `@' and `%' characters which are used
to separate hostnames and the final user name from each other.
This is primarily used to mail to users on other machines.
UUCP addresses are specified as
X.sp
X.ti +2
host1!host2!user
X.sp
where there may be as many hosts as necessary to route the message
to the recipient user.
Here, the user's account is on \*Qhost2\*U
and that machine is connected to \*Qhost1\*U.
X.I Domain
addresses (also called Arpanet and RFC822 addresses) are specified as
X.sp
X.ti +2
user@host.domain
X.ti +2
user%host2.domain@host1
X.sp
where \*Qdomain\*U is a domain name such as \*Q.berkeley.edu\*U or \*Q.com\*U.
As in the first example, the user is on \*Qhost2\*U, but that machine talks
to \*Qhost1\*U.
It is beyond the scope of this document to discuss in detail the ramifications
of internetwork mailing.
More information can be obtained through your system manager.
X.PP
X.I Mush
understands addresses containing a comment field.
Comment fields do not affect the destination address of mail being sent.
These fields are purely for
human legibility and may be specified according to the following constraints: 
X.sp
Anything within angle brackets is an address; whatever is outside of the
address is considered a comment:
X.sp
X.ti +2
Dan Heller <sun!island!argv>
X.ti +2
Dan Heller <argv%island@sun.com>
X.sp
Anything that has parentheses is a comment; whatever is outside of the
parentheses is considered the address:
X.sp
X.ti +2
sun!island!argv (Dan Heller)
X.ti +2
argv%island@sun.com (Dan Heller)
X.sp
Double quotes (") are treated just like parentheses:
X.sp
X.ti +2
X"Dan Heller" sun!island!argv
X.ti +2
X"Dan Heller" island!argv@sun.com
X.sp
If the comment is to contain a comma, the first case above may not be used;
you must use either the parenthesis or double-quote cases.
X.sp
X.ti +2
fred@flintstone.bed.rock (Fred Flintstone, Cave Man)
X.sp
If the comment contains unbalanced quotes, unpredictable results may occur
X(Mush won't deliver the mail).
X.sp
Since the angle brackets have the highest precedence, quotes or parentheses
may be used in conjunction with one another.
X.sp
X.ti +2
Yabba Dabba Doo (Fred Flintstone) <fred>
X.ti +2
Scoobie "Doobie" Doo <scooby@shaggys.mystery.machine>
X.PP
Multiple addresses may appear on a line:
X.sp
X.in +2
island!argv@sun.com argv@garp.mit.edu dheller
X.in -2
X.sp
Because there is no indication of comments (parenthesis, angle bracket,
or quotes), it is assumed that these are separate addresses and mush will
insert commas between these addresses accordingly.
It is for this reason that the user is encouraged to explicitly insert
commas between all mail addresses and not depend on the automation of comma
insertion to correctly separate addresses from one another.
X.PP
Mail aliases may contain addresses of the form described above.
X.sp
X.nf
X.in +2
X.ta 1.5i
alias george	George Jetson <george@spacely.space.sprokets>
alias jane	Jane Jetson <jane@sky-high.appts>
alias group	george, jane
X.in -2
X.fi
X.sp
You can mail using the alias as an address and it will be expanded
accordingly.
You can not, however, reference an alias and specify a
comment or another address at the same time.
X.sp
X.ti +2
To: The Jetsons <group>
X.sp
The alias \*Qgroup\*U will not be expanded because the angle brackets
causes it to be considered as another address entirely.
X.SH FILES
X.nf
X.ta 2.0i
X/usr/spool/mail/*	Directory for incoming mail
X~/Mail	Default \fBfolder\fR directory
X~/mbox	File where old mail is saved
X~/.mushrc	File giving initial \fIMush\fR commands
X~/.mailrc	Alternate initialization file
X~/.edXXXXXXX	Temporary for file for outgoing messages
X~/.mushXXXXXX	Temporary mail file (copy of current folder)
X.fi
X.PP
Temporary files which are created by the program are always
created with read/write access to the owner only; group and other
permissions are never set.
This is also true for the /usr/spool/mail/* files.
All other files created by the user via commands internal or external
to the program have permissions set by the user's default umask.
If the umask is reset within the program, the mask remains
intact even after exiting.
Remember to set the variable
X.B unix
before attempting to set the umask value.
X.PP
If your system is using Sun Microsystem's NFS, take special note to
read the manual page for mount(1).
Filesystems mounted for read/write
access should be mounted as \*Qhard\*U NFS mounts or you may lose
mailboxes during a timeout during a write or update.
X.PP
Filesystems that use RFS still have bugs to be ironed out in the way
of owners and permissions concerning utime(2).
X.SH "SEE ALSO"
X.IR Mail (1),
X.IR binmail (1),
X.IR csh (1),
X.IR aliases (5),
X.IR mount (1),
X.IR mailaddr (7),
X.IR sendmail (8),
X.IR printf (3),
X.IR execl (3),
X.IR umask (1),
X.IR utime (2).
X.SH AUTHOR
This code was written entirely by Dan Heller and contains no UNIX sources.
It is also not a modified version of any other mail user agent.
Similarities
with any other mailer may have been designed for compatibility reasons.
X.PP
argv@spam.istc.sri.com	sun!island!argv
X.SH BUGS
The curses interface uses the curses library.
The routines from the library that are used are the most basic and simple to
avoid possible bugginess that different versions of UNIX might have.
However, one unavoidable problem is the reverse video mode.
Depending on your terminal,
the termcap entry for it, and the version of curses you are running,
the reverse video may makes things worse than desired.
In such situations, the user should set the variable
X.B no_reverse
to not get reverse video.
X\&`^R' may still be entered at runtime in the curses
interface to toggle reverse video.
X.PP
If the program is already running and the system [later] has to swap
and there is no swap space left, there may be problems.
One such problem is sending mail.
If this happens, then sending mail
will fail and a segmentation fault from the spawned forked child will occur
unless the -v flag was given to mail.
The unsent letter will not be removed from the editing file ($home/.edXXXXXX)
and may be recovered.
X.PP
Many functions available to the line oriented mode (shell mode)
are not available to the tool mode.
For example,
X.B pick
may not be directly accessed although experienced users may find that
typing pick commands within single backquotes in the \*Qrange\*U panel item
in the header window will indeed pick messages.
This is mostly for selecting the \*Qdelete range\*U item
or the middle mouse button icon in the header panel.
X.PP
Shell escapes (of any kind) may not be called from
the tool/graphics mode.
The reason for this is that there is no tty
X.I window
to run commands from.
It is impossible to determine whether or not the user wants to run an
interactive program or not so it is best to disallow its usage all together.
The experienced window user
can figure out how to really do shell layers from within the tool mode.
X.PP
Toggling from the curses mode to the line mode to get the full
functionality of the shell/line mode is unfortunately necessary
in the name of \*Quser friendliness.\*U
Mostly, this is only necessary
for piping of commands and using the pick command.
X.PP
The function keys and their ability to
X.I work
has been variable depending on the version of SunWindows/SunView
your Sun Workstation has.
From time to time, it works, but when it
doesn't, it seems to be related to other user or system definable
dot-files or whatever.
I hardly use them, so I haven't had a chance
to really debug that part much.
My experiences have shown them to
work in Sun versions 2.0, 2.2, and 3.3, but not any other version.
X.PP
When using
X.B vi
in the tool/graphics mode, periodically the window will be one
line \*Qshort.\*U
That is, scrolling will be off by one line and you may
have to redraw the window (using \*Qz.\*U in vi) to get it in sync again.
This is a known problem with SunWindows, but Sun refuses to fix it
as SunWindows are \*Qobsolete.\*U
X.PP
When running on full filesystems,
X.I Mush
may complain or not even run since it needs temporary space with which
to work.
Instead of finding new filesystems on it's own,
X.I Mush
leaves this task up to the user.
The workaround is to set the variable
X.B home
in the initialization file to be a writable place in a filesystem which
has enough disk space.
This will set the user's home directory to be
set incorrectly, but resetting the home manually once in the shell
will correct the problem.
X.PP
Most of the other known and documented bugs
are in the supplied README file accompanying the source.
Of course, the source is an excellent place to look as most known bugs are
documented right in the source code.
A good way to track suspicious bugs is to use the
X.B debug
command, but note that
this command is very difficult to use in curses mode.
END_OF_FILE
if test 38739 -ne `wc -c <'mush.1.c'`; then
    echo shar: \"'mush.1.c'\" unpacked with wrong size!
fi
# end of 'mush.1.c'
fi
echo shar: End of archive 13 \(of 14\).
cp /dev/null ark13isdone
MISSING=""
for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 14 archives.
    rm -f ark[1-9]isdone ark[1-9][0-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0
-- 
Please send comp.sources.unix-related mail to rsalz@uunet.uu.net.