Title: CIS 90
1CIS 90 - Lesson 3
Mail Command
2CIS 90 - Lesson 3
UNIX mail Benji sends message on Opus
Intended recipients
simmsben
The first prompt is "Subject ", you enter the
subject, then enter the message. The last prompt
is "Cc " and after you hit enter the message is
sent
Use . or Ctrl-D to end the message
simmsmar
richsimms_at_yahoo.com
3CIS 90 - Lesson 3
UNIX Mail Mary reads the message on Opus
One message is in the header list (in tray), "N"
means New, "1" is the message number
simmsmar
The is the mail prompt. Enter a 1 to read
message 1
4CIS 90 - Lesson 3
UNIX mail Rich reads same message on another
computer
richsimms_at_yahoo.com
5CIS 90 - Lesson 3
UNIX Mail Mary replies to the message on Opus
simmsmar
Enter an r to "reply to all" for the last message
read
6CIS 90 - Lesson 3
UNIX Mail Benji gets the reply from Mary
simmsben
Entering just the message number or a "p"
followed by the message number are equivalent.
The p is the mail print command.
7CIS 90 - Lesson 3
UNIX Mail and Rich gets a copy of the reply as
well
richsimms_at_yahoo.com
8CIS 90 - Lesson 3
Class Exercise UNIX mail
- Logon to Opus
- Practice sending emails to your neighbors and
replying. - Start collecting each others usernames to use
for Lab 3
9CIS 90 - Lesson 3
More on Mail Command
10CIS 90 - Lesson 3
mail command read and write modes
- Read mode
- mail (to read new messages)
- mail f (to read saved messages in mbox)
- mail f myfile (to read saved messages in
myfile) - Write mode
- mail simmsben
- mail simmsben simmsmar richsimms_at_yahoo.com
11CIS 90 - Lesson 3
mail command read mode sub commands
- You are in read mode when you invoke mail with no
arguments - ? print these commands
- p ltmessage listgt print messages
- n goto and print next message
- e ltmessage listgt edit messages
- d ltmessage listgt delete messages
- s ltmessage listgt file save (append) messages to
file - u ltmessage listgt undelete messages
- R ltmessage listgt reply to sender(s)
- r ltmessage listgt reply to all
- m ltuser listgt mail to specific users
- q quit, saving read messages to local mbox
file - x quit, mark all mail as unread and undeleted.
- h print out active message headers
- A ltmessage listgt consists of integers, ranges of
same, or user names separated - by spaces. If omitted, Mail uses the current
message - A ltuser listgt consists of user names separated
by spaces.
12CIS 90 - Lesson 3
mail command (h)header sub-command
h (print headers e.g. list my in tray)
message numbers
N New, message is unread
gt points to the current message (last one printed)
13CIS 90 - Lesson 3
mail command (p)rint sub-command
print all messages from simmsmar
14CIS 90 - Lesson 3
mail command (p)rint sub-command
print message 5, note that commands can be
abbreviated to a single letter
15CIS 90 - Lesson 3
mail command (p)rint sub-command
print messages 4 -5
16CIS 90 - Lesson 3
mail command e(x)it sub-command
x will quit mail. All messages revert back to
their original state (unread and undeleted).
When you return to mail again all the messages
will still be there.
17CIS 90 - Lesson 3
mail command (q)uit sub-command
q will quit mail. All read messages are moved to
a local file named mbox. When you return to mail
again those message will not appear. If you want
to read your old messages you must specify the
mbox file with the f option.
18CIS 90 - Lesson 3
mail command Various mailbox files
mail
system mail box /var/mail/username (new mail
arrives here and read messages are deleted on
quit)
local mail box mbox (read messages go here on
quit)
local mail box yourfile (messages can go here
with save)
19CIS 90 - Lesson 3
mail command Various mail boxes example
rsimms_at_opus mail Mail version 8.1 6/6/93.
Type ? for help. "/var/spool/mail/rsimms" 6
messages 6 new gtN 1 jimg_at_opus.cabrillo.e Sun
Jun 22 1353 21/826 "Hot days and servers" N
2 simmsben_at_opus.cabril Thu Jul 24 1227 16/697
"Nisene Hike" N 3 simmsmar_at_opus.cabril Thu
Jul 24 1228 18/728 "Don't forget to bring" N
4 simmsben_at_opus.cabril Thu Jul 24 1229 17/696
"Bone lost" N 5 rsimms_at_opus.cabrillo Thu Jul
24 1233 20/808 "Re Hot days and serv" N 6
roddyduk_at_opus.cabril Thu Jul 24 1541 18/691
"Salsa" p 3-4 Message 3 From
simmsmar_at_opus.cabrillo.edu Thu Jul 24 122838
2008 Date Thu, 24 Jul 2008 122838 -0700 From
Mary Simms ltsimmsmar_at_opus.cabrillo.edugt To
rsimms_at_opus.cabrillo.edu Subject Don't forget to
bring pen drive I need to use it again to back
up some files and practice partitioning. Thanks Ma
ry Message 4 From simmsben_at_opus.cabrillo.edu
Thu Jul 24 122927 2008 Date Thu, 24 Jul 2008
122927 -0700 From Benji Simms
ltsimmsben_at_opus.cabrillo.edugt To
rsimms_at_opus.cabrillo.edu Subject Bone lost Did
you see that old bone I was chewing? I can't find
it anywhere! - Ben
Print 2 messages
20CIS 90 - Lesson 3
mail command Various mail boxes example
save message 4 in bone
s 4 bone "bone" New file h N 1
jimg_at_opus.cabrillo.e Sun Jun 22 1353 21/826
"Hot days and servers" N 2 simmsben_at_opus.cabril
Thu Jul 24 1227 16/697 "Nisene Hike" 3
simmsmar_at_opus.cabril Thu Jul 24 1228 18/728
"Don't forget to bring" gt 4 simmsben_at_opus.cabril
Thu Jul 24 1229 17/696 "Bone lost" N 5
rsimms_at_opus.cabrillo Thu Jul 24 1233 20/808
"Re Hot days and serv" N 6 roddyduk_at_opus.cabril
Thu Jul 24 1541 18/691 "Salsa" q Saved 1
message in mbox Held 4 messages in
/var/spool/mail/rsimms rsimms_at_opus mail Mail
version 8.1 6/6/93. Type ? for
help. "/var/spool/mail/rsimms" 4 messages 4
unread gtU 1 jimg_at_opus.cabrillo.e Sun Jun 22
1353 22/836 "Hot days and servers" U 2
simmsben_at_opus.cabril Thu Jul 24 1227 17/707
"Nisene Hike" U 3 rsimms_at_opus.cabrillo Thu Jul
24 1233 21/818 "Re Hot days and serv" U 4
roddyduk_at_opus.cabril Thu Jul 24 1541 19/701
"Salsa" q Held 4 messages in /var/spool/mail/rsi
mms rsimms_at_opus mail -f mbox Mail version
8.1 6/6/93. Type ? for help. "mbox" 1 message gt
1 simmsmar_at_opus.cabril Thu Jul 24 1228
19/739 "Don't forget to bring" q rsimms_at_opus
mail -f bone Mail version 8.1 6/6/93. Type ?
for help. "bone" 1 message 1 new gt 1
simmsben_at_opus.cabril Thu Jul 24 1229 18/706
"Bone lost" q "bone" complete rsimms_at_opus
messages 3 and 4 are read. 4 is saved ()
21CIS 90 - Lesson 3
mail command (d)elete and (u)ndelete
22CIS 90 - Lesson 3
mail command Copying messages from mbox back to
system mail box
23CIS 90 - Lesson 3
mail command Forwarding a message with m
This is how you forward message 5
24CIS 90 - Lesson 3
mail command The mail boxes are all ascii text
/home/cis90/simmsben cat /var/mail/simmsben From
millehom_at_opus.cabrillo.edu Thu Jul 24 162656
2008 Return-Path ltmillehom_at_opus.cabrillo.edugt Rec
eived from opus.cabrillo.edu (opus 127.0.0.1)
by opus.cabrillo.edu (8.13.8/8.13.8) with
ESMTP id m6ONQuBk016775 for
ltsimmsben_at_opus.cabrillo.edugt Thu, 24 Jul 2008
162656 -0700 Received (from millehom_at_localhost)
by opus.cabrillo.edu (8.13.8/8.13.8/Submi
t) id m6ONQuqw016774 for simmsben Thu,
24 Jul 2008 162656 -0700 Date Thu, 24 Jul 2008
162656 -0700 From Homer Miller
ltmillehom_at_opus.cabrillo.edugt Message-Id
lt200807242326.m6ONQuqw016774_at_opus.cabrillo.edugt To
simmsben_at_opus.cabrillo.edu Subject RC4
review Meeting at 400 today in Big Sur room.
Looks like we have 2 showstoppers and need to
rebuild tonight. Homer /home/cis90/simmsben
mail Mail version 8.1 6/6/93. Type ? for
help. "/var/spool/mail/simmsben" 1 message 1
new gtN 1 millehom_at_opus.cabril Thu Jul 24 1626
18/741 "RC4 review" 1 Message 1 From
millehom_at_opus.cabrillo.edu Thu Jul 24 162656
2008 Date Thu, 24 Jul 2008 162656 -0700 From
Homer Miller ltmillehom_at_opus.cabrillo.edugt To
simmsben_at_opus.cabrillo.edu Subject RC4
review Meeting at 400 today in Big Sur room.
Looks like we have 2 showstoppers and need to
rebuild tonight. Homer
25CIS 90 - Lesson 3
Class Exercise UNIX mail
- Send your neighbor classmates some messages
- Send a message to your home email address
- Read one or more messages
- Save a couple of messages to a file named in2008
- Forward a message to one of your classmates
- Send a message to yourself
- Delete and undelete some messages
- Experiment with quit and exit to see how they
treat read messages differently - Use mail with f option to read mbox and in2008
mailbox files - Check out your mail boxes with file and cat
commands - Your system message store /var/mail/username
- Your archived message mbox
- The file you saved messages to in2008
26CIS 90 - Lesson 3
end-to-end email
27CIS 90 - Lesson 3
end-to-end email
open and read message
compose and send message
28CIS 90 - Lesson 3
end-to-end email
DA Delivery Agent
MTA Mail Transport Agent
MTA Mail Transport Agent
Message Store
AA Access Agent
MUA Mail User Agent
MUA Mail User Agent
open and read message
compose and send message
29CIS 90 - Lesson 3
end-to-end email example Implementation
DA procmail
SMTP Simple Mail Transport Protocol
MTA sendmail
MTA sendmail
Message Store /var/mail/rsimms
SMTP Simple Mail Transport Protocol
AA spop
POP Post Office Protocol
MUA /bin/mail
MUA Yahoo Mail
compose and send message
open and read message
30CIS 90 - Lesson 3
end-to-end email configuring your MUA (Mail
User Agent)
DA Delivery Agent
SMTP Simple Mail Transport Protocol
MTA Mail Transport Agent
MTA Mail Transport Agent
SMTP Simple Mail Transport Protocol
Message Store
Example MUA Windows Mail (on Vista)
This is why you get asked for the SMTP server and
the POP3/IMAP server when you set up email on
your PC. Your MUA needs to know this to send and
receive messages.
AA Access Agent
POP Post Office Protocol
31CIS 90 - Lesson 3
Wrap up
32CIS 191 - Lesson 3
New commands mail - UNIX mail ? print these
commands p ltmessage listgt print messages n goto
and print next message e ltmessage listgt edit
messages d ltmessage listgt delete messages s
ltmessage listgt file save (append) messages to
file u ltmessage listgt undelete messages R
ltmessage listgt reply to sender(s) r ltmessage
listgt reply to all m ltuser listgt mail to
specific users q quit, saving read messages to
local mbox file x quit, mark all mail as unread
and undeleted. h print out active message
headers mesg - Enable or disable writes to your
terminal write - Write message to another
user New Files and Directories /var/spool/mail
- Message store for mail /var/spool/mail/username
- Incoming mailbox for username mbox - File in
users home directory where read messages
are archived to