Standard Berkeley Mail

Standard Berkeley Mail

Named Mail (we just have to type mail on our system)
There are many other mail handlers elm, pine, mh, etc.

% mail puts you into your system mailbox;
actually a file called /usr/spool/mail/<login id>
% mail -u <login id> forces the system mailbox if something is saying otherwise (not on Alpha's)
% mail -f <file> allows you to name another file to be used as the mailbox. if no filename is given it uses ~/mbox
% mail -v shows the mail delivery path
- % mail -s "this is the subject line" jplane jp10702 < this.file

- % mail jplane jp10702

subject: this is the subject line
this is text before the file
______________________
~r this.file
(this.file included) Content of the file does not
appear on the screen
______________________
this is text after the file

Two types of commands

1) & commands must be typed at the & prompt
( & is replaced with a ? on some machines - I will continue to use just the & for simplicity)
2) <escape> commands must be typed at the beginning of a line when you are typing a message to someone

1) & prompt commands (or ? prompt commands):

Mail Commands

q quit, saving unresolved messages in mbox
x exit(quit) without modifying the current mailbox
h <message number> headers - print out active message headers
d <message list> delete messages
s <message list> file (save) append messages to file
u <message list> undelete messages
r <message list> reply to messages(to sender and recipients)
R <message list> reply to messages(to sender only)
m <user list> mail to specific users (m = mail)
!<command> shell escape for one command
f <user id> from - displays list of headers of messages received from the named user
? help - display a list of & level commands
A <message list> consists of integers or ranges of integers separated by spaces. If omitted, Mail uses the last message typed.
A <user list> consists of user login ids separated by spaces.
">" is the message pointer. It points to the "default" or "current" message

2) <escape> commands

The following ~ escapes are defined:

~r file Read a file into the message buffer
~p Print the message buffer
~w file Write message onto file.
~q terminate the current message (same as ^C^C)
~? Get a list of ~ commands
~f [messages] Read in messages
~m [messages] Read in messages, right shifted by a tab
~v Puts you into the visual editor of your choice editing the current message
~h header - Prompt for to list, subject and cc list
~s subject Set subject
~~ Quote a single tilde
~! command Invoke the shell
~: command Invode a & level mail command

Set Up of the Mail System

(Customization of the Mail System) /usr/lib/Mail.rc on MIPS machines or /usr/share/lib/Mail.rc on the Alpha Machines ~/.mailrc set or unset command at the & prompt

ask,asksub tells the system to request the subject line if not already given
askcc tells the system to request a CC: line before ending
dot tells the system to accept a . (period) as the end of message
ignoreeof tells the system not to accept ^D as end of message
hold puts messages back into system mailbox rather than into ~/mbox after the message has been read
append appends rather than prepends to ~/mbox
nosave killed letter is not saved in dead.letter file
verbose all delivery information will be displayed
autoprint tells d to act as dp (delete and display next)
VISUAL=/usr/bin/vi tells which editor should be used when you do a ~v
SHELL=/bin/csh tells which shell should be used when you do a &! or ~!
escape=~ tells which character should be used for the <escape> commands

Alias

Also can be set in the ~/.mailrc or at the & prompt No set or unset command is used

alias tom tsmith@tove.cs.umd.edu
alias 107tas jp10702 jp10703
alias 113tas tim@umd5 fred@cs bob@penguin.cs.umd.edu

& alias Gives a list of all the aliases currently defined
& alias tom Gives the "value" of the alias tom
& unalias tom Removes the "value" of the alias tom

System Wide Aliases /usr/lib/aliases

format is

name : userlist
MAILER-DAEMON : postmaster
postmaster : root

# Aliases to handle mail to msgs and news
msgs: "|/usr/ucb/msgs -s"
rnews:"|/usr/local/uurec"

.forward file

- hidden file located in the home directory
- must have address of where you would like your mail forwarded
- no mail will be delivered into that account while the .forward exists
 

Home Up Next