COHERENT manpages

This page displays the COHERENT manpage for mail [Send or read mail].

List of available manpages
Index


mail -- Command

Send or read mail
mail [-mpqrv] [-f file] [user ...]

mail  allows you  to exchange  electronic mail  with other  COHERENT system
users, either on  your own system or on other  systems via UUCP.  Depending
upon its form, this command can  be used either to send mail to other users
or to read the mail that other users have sent to you.

Sending Mail

If you  name one or more  users, mail assumes that you wish  to send a mail
message to each user. mail first prints the prompt

    Subject:

on the screen, requesting that you give the message a title.

mail  then  reads what  you  type  on the  standard  input.   A message  is
terminated by  <ctrl-D>, by a  line that contains  only the character
`.', or  by a  line that  contains only the  character `?'.  Ending  with a
question mark prompts  mail to feed the message into  an editor for further
editing.  The  editor used is  the one named in  the environmental variable
EDITOR. If this variable is not defined, mail uses ed.

If you  have defined  environmental variable ASKCC  to YES, mail  asks you,
after a  message is ended, for a  list of users to whom you  wish to send a
copy of the message.

Finally, mail prepends the date and the sender's name, and sends the result
to each  user named either on  the command line or  on the carbon-copy list
with the rmail command.

Each  user who  has received  mail  is greeted  by the  message ``You  have
mail.''  when she  logs  in.  mail  normally  changes the  contents of  the
mailbox as the  user works with them; however, mail  has options that allow
the contents of the mailbox to remain unchanged if the user desires.

Reading Mail

If no user is named on its command line, mail reads and displays the user's
mail, message by message.  If environmental variable PAGER is defined, mail
will ``pipe'' each message through  the command it names.  For example, the
.profile command line:

    export PAGER="exec /bin/scat -1"

invokes /bin/scat  for each mail message with  the command-line argument -1
(the digit one).

While reading mail, the user can use any of the following commands to save,
delete, or send each message to another user interactively.

d    Delete the current message and print the next message.

m [user ...]
     Mail the current message to each user given (default: yourself).

p    Print the current message again.

q    Quit, and update mailbox file to reflect changes.

r    Reverse the direction in which the mailbox is being scanned.

s [file ...]
     Save  the current  mail message  with  the usual  header in  each file
     (default: $HOME/mbox).

t [user ...]
     Send a message read from  the standard input, terminated by an end-of-
     file character or  by a line containing only `.'  or `?', to each user
     (default: yourself).

w [file ...]
     Write  the  current message  without  the usual  header  in each  file
     (default: $HOME/mbox).

x    Exit without updating the mailbox file.

<newline>
     Print the next message.

-    Print the previous message.

EOF  Quit, updating mailbox; same as q.

?    Print a summary of available commands.

!command
     Pass command to the shell for execution.

The following command line options control the sending and reading of mail.

-f file
     Read mail from file instead of from the default, /usr/spool/mail/user.

-m   Send a message to the terminal of user if he is logged into the system
     when mail is sent.

-p   Print all mail without interaction.

-q   Quit without changing the  mailbox if an interrupt character is typed.
     Normally,  an  interrupt  character  stops  printing  of  the  current
     message.

-r   Reverse  the  order  of  printing  messages.   Normally,  mail  prints
     messages in the order in which they were received.

-v   Verbose  mode.   Show the  version  number of  the  mail program,  and
     display expanded aliases.

If you  wish, you  can create  a signature file,  .signature, in  your home
directory.  mail appends  the contents of the signature file  to the end of
every  mail message  you send,  as a  signature.  A  signature can  be your
system's path  name (for uucp messages), your  telephone number, an amusing
bon mot, or what you will.

Files

$HOME/dead.letter -- Message that mail could not send
$HOME/mbox -- Default saved mail
$HOME/.signature -- Signature file
/etc/domain -- Name of your system's domain
/etc/uucpname -- Name of your system
/tmp/mail* -- Temporary and lock files
/usr/spool/mail -- Mailbox directory, filed by user name

See Also

aliases,
ASKCC,
commands,
EDITOR,
.forward,
mkfnames,
msg,
nptx,
PAGER,
paths,
rmail,
smail,
uux

Notes

Note that before you can send mail, either locally or to a remote site, you
must run  the program uuinstall and  use its `S' option to  set the name of
your local site  and domain.  Your local system must,  of course, also have
permission to log into any remote site to which you wish to send mail.  See
the tutorial  and Lexicon  articles on  UUCP for details  on using  UUCP to
exchange mail and files with remote sites.