How do I use /usr/um/bin/mail?
The /usr/um/bin/mail email reader is available on every Linux lab machine on the CAEN network. In order to check if any new messages have arrived, type mail at the Linux prompt. Please note that for email to work correctly, you need to have your MAILSERVER environment variable set correctly. This is done automatically for you if your .login file sources /usr/local/skel/sys.login. To make sure you have the correct dotfiles, you can use the /usr/caen/bin/redot command to update them to defaults.
Receiving Email
When the mail command is invoked, if there are new messages in your inbox, a list of the message headers will appear. If there are no new messages, you are notified that there is no mail:
example% mail
Connecting to mail server..
Password (example.engin.umich.edu:uniqname):
Retrieving messages..
Mail version 5.6.2.caen.pop 17-Sep-95. Type ? for help.
"/var/tmp/mailAAAQSaGcQ": 6 messages 5 unread
1 - Mon Oct 7 11:34 0/1400
U 2 - Mon Oct 7 11:34 0/33106
U 3 - Mon Oct 7 11:34 0/1822
U 4 - Mon Oct 7 11:34 0/3354
U 5 - Mon Oct 7 11:34 0/1126520
U 6 - Mon Oct 7 11:34 0/33894
>
In the above example, the user has six pieces of email. Each header gives the message status, sender, day, date and time posted, the number of lines/bytes, and the subject (if the sender supplied one). The mail system right bracket (>) prompt follows. To read a message, simply type the message number that appears at the far left of every message listed.
Messages that are not deleted are appended to a file called mbox in the user’s home directory. To access these messages, type:
mail -f mbox
The mailer will use the file mbox as the mailbox instead of the system mailbox. Messages from mailbox formatted files, (e.g. messages saved using s command) can also be retrieved. Reading your email from the mbox is the same process as reading the mail in your inbox. Just type the message number.
/usr/um/bin/mail commands
?
Prints a brief summary of commands
n
Goes on to the next message (same as pressing )
-
Goes back to the previous message
d
Deletes the current message and continue to the next
p
Prints the current message
pre
Preserves the current message as if it were not yet read
touch
Marks a message as having been read
u #
Un-deletes messages listed in place of #
z
Moves to the next range of messages
z-
Moves to the previous range
s filename
Saves the current message in the named filename; If no file name is given, save the message in the file mbox
h
Prints the current list of mail headers
r
Replies to all recipients of the current message
R
Replies to originator only, not to other recipients
q
Quits—all undeleted and unsaved messages are stored in mbox
x
Exits—return to shell without modifying the system mailbox or mbox file
Ctrl-c
Aborts message being composed and returns to shell
!
Executes the Linux command which follows
Sending Email
In order to send email to another CAEN user, type mail uniqname, where uniqname is the user’s login. You will be prompted for text one line at a time. End a message by typing a period (.) on a line by itself, or entering the End-Of-File character (Ctrl-d). The message will then be sent. A message cannot be edited once it has been sent.
When composing a message, certain escape sequences may be useful. These commands must be typed at the beginning of a line:
~v
Edit the message using the vi editor.
~e
Edit the message using the editor defined by the EDITOR variable.
~p
Print out the message typed in so far.
~s sub
Make sub the current subject field.
~r file
Read file into the current message buffer.
~m #
Read the message number specified by # into the current message buffer; If no message number is given, use the last message.
~q
Abort the message without sending.
For More Information
For additional information, type man mail at the Linux prompt. If you have any questions or difficulties, go to Contact CAEN. CAEN staff members will make every possible effort to answer each message quickly.


