📄 ch14.htm
字号:
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT">k, <UP> </TD>
<TD ALIGN="LEFT">Advances to previous undeleted message. </TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT">l </TD>
<TD ALIGN="LEFT">Limits messages by specified criteria. </TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT">Ctrl-L </TD>
<TD ALIGN="LEFT">Redraws screen. </TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT">m </TD>
<TD ALIGN="LEFT">Mails a message. </TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT">n </TD>
<TD ALIGN="LEFT">Next message, displaying current, then increment. </TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT">p </TD>
<TD ALIGN="LEFT">Prints current message or tagged messages. </TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT">q </TD>
<TD ALIGN="LEFT">Quits, maybe prompting for deleting, storing, and keeping messages. </TD>
</TR>
</TABLE>
<BR>
</CENTER>
<P>Let's try to send mail using <TT>elm</TT>.</P>
<P>To send mail, press <TT>m</TT> on the main screen. The header screen appears.
<TT>elm</TT> prompts you to enter the name(s) of the recipient(s) of the mail. Enter
<TT>calvin</TT> and <TT>root</TT> as recipients. Calvin is the primary recipient,
and a copy of this message is sent to root as well.</P>
<P><TT>elm</TT> then prompts for a subject. After entering the subject heading, <TT>elm</TT>
puts you in the <TT>vi</TT> editor to enter the body of the mail message. After you
are finished typing, use the <TT>vi</TT> command <TT>:wq</TT> to save and quit the
<TT>vi</TT> editor. You can now send the message by pressing <TT>s</TT>.</P>
<P>You can also forward mail to others on the system with the <TT>f</TT> command
or reply to a message with the <TT>r</TT> command.</P>
<P>To quit <TT>elm</TT>, type <TT>q</TT> at the main screen.</P>
<P>If <TT>elm</TT> is available on your system, try to use it. <TT>elm</TT> is very
convenient and simple and can greatly improve your electronic mail interaction. Using
Pine Pine, a trademark of the University of Washington, stands for Program for Internet
News and E-mail. Pine offers the capability to send local and remote messages using
a simple user interface, as well as the capability to send documents and graphics.</P>
<P>You invoke Pine by entering <TT>pine</TT> on the command line. The screen shown
in Listing 14.2 should appear.
<CENTER>
<H3><A NAME="Heading18<FONT COLOR="#000077">Listing 14.2. Pines main screen.</FONT></H3>
</CENTER>
<PRE><FONT COLOR="#0066FF">
$ pine PINE 3.95 MAIN MENU Folder: INBOX 1 Message
? HELP - Get help using Pine
C COMPOSE MESSAGE - Compose and send a message
I FOLDER INDEX - View messages in current folder
L FOLDER LIST - Select a folder to view
A ADDRESS BOOK - Update address book
S SETUP - Configure or update Pine
Q QUIT - Exit the Pine program
Copyright 1989-1996. PINE is a trademark of the University of Washington.
[Folder "INBOX" opened with 1 message]
? Help P PrevCmd R RelNotes
</FONT></PRE>
<PRE><FONT COLOR="#0066FF">
O OTHER CMDS L [ListFldrs] N NextCmd K KBLock
</FONT></PRE>
<P>Pine is very easy to use, because it provides a full-screen interface with the
up and down cursor controls. Simply select the item you want by using the arrow keys
and press Enter at the selected line.</P>
<P>Let's send a message using Pine. Take the cursor to the Compose Message line and
press Enter. The screen shown in Listing 14.3 appears.
<CENTER>
<H3><A NAME="Heading20<FONT COLOR="#000077">Listing 14.3. Composing a message.</FONT></H3>
</CENTER>
<PRE><FONT COLOR="#0066FF">
PINE 3.95 COMPOSE MESSAGE Folder: INBOX 1 Message
To : "Laurel N. Hardy" <laurel@hobbes.com>
Cc :
Attchmnt:
Subject : using pine
---- Message Text ----
Hi, I can do everything on one screen
.
Send message? [y] :
^G Get Help ^X Send ^R Rich Hdr ^Y PrvPg/Top ^K Cut Line ^O Postpone
</FONT></PRE>
<PRE><FONT COLOR="#0066FF">
^C Cancel ^D Del Char ^J Attach ^V NxtPg/End ^U UnDel Line ^T To AddrBk
</FONT></PRE>
<P>Pine takes you line-by-line through the mail header and the mail message. Press
Ctrl-X to end the message, as well as send it to the recipient. Just walk through
all the options to get a feel for this mail system.</P>
<P>The last two lines on the screen tell you what commands are available for the
current situation. Usually there are more commands than can be shown on two lines,
so use the O key to see what other commands are available. The O is optional; you
don't have to be able to see a command before you use it.</P>
<P>Pine creates a default configuration file, <TT>.pinerc</TT>, in your home directory.
You can edit this file to select various options. Pine also creates a <TT>mail</TT>
subdirectory for your saved-message folders. Type <TT>?</TT> from the Main Menu for
more help. Using mailx (Berkeley Mail) This section is about <TT>mailx</TT>, another
common mail program for Linux. This section covers the basics of <TT>mailx</TT>.
<TT>mailx</TT> has many options and features, most of which are listed in its man
pages. Discussing all these features would require a book in itself.</P>
<P>Let's see how to receive and send mail using <TT>mailx</TT>. Receiving Mail Suppose
someone has sent you a mail message. How would you know about it? The<TT> Mail</TT>
system deals with this by displaying a message when you log in. A sample login session
is shown in Listing 14.4.
<CENTER>
<H3><A NAME="Heading21<FONT COLOR="#000077">Listing 14.4. Login notification
of received mail.</FONT></H3>
</CENTER>
<PRE><FONT COLOR="#0066FF">
Welcome to Linux 2.0.0.
mpsi login: laurel
Last login: Fri Jan 6 13:28:06 on tty1
Linux 2.0.0.
</FONT></PRE>
<PRE><FONT COLOR="#0066FF">
You have new mail.
</FONT></PRE>
<P>To read the mail message, invoke the Mail handler by typing mail at the prompt.
You will see the output shown in Listing 14.5.
<CENTER>
<H3><A NAME="Heading23<FONT COLOR="#000077">Listing 14.5. Receiving mail.</FONT></H3>
</CENTER>
<PRE><FONT COLOR="#0066FF">
mpsi:~$ mail
Mail version 5.5 6/1/90. Type ? for help.
"/var/spool/mail/calvin": 1 message 1 new
>N 1 laurel@hobbes.com Fri Jan 6 13:38 12/374 "just checking"
& 1
Message 1:
From laurel@hobbes.com Fri Jan 6 13:38:06 1995
Date: Fri, 6 Jan 1995 13:38:06 -0600
From: "Laurel N. Hardy" <laurel@hobbes.com>
To: calvin@hobbes.com
Subject: just checking
the body of the message
bye
& exit
</FONT></PRE>
<PRE><FONT COLOR="#0066FF">You have mail in /var/spool/mail/calvin
</FONT></PRE>
<P>In this example, the user Calvin has received a mail message from another user,
Laurel. This message is the first message in the message queue and is declared as
new, which means it has not been read yet. The message queue has an <TT>>N</TT>,
indicating that it is a new message, followed by a message number (1), the sender's
login ID (<TT>laurel@hobbes.com</TT>), the day of the week, the date and time the
message was sent, and the subject of the message.</P>
<P>The ampersand (<TT>&</TT>) is the mail system prompt. You can now read the
message by typing the message number at this prompt.<FONT COLOR="#0066FF"></FONT>
<PRE><FONT COLOR="#0066FF"> & 1
Message 1:
From laurel@hobbes.com Fri Jan 6 13:38:06 1995
Date: Fri, 6 Jan 1995 13:38:06 -0600
From: "Laurel N. Hardy" <laurel@hobbes.com>
To: calvin@hobbes.com
Subject: just checking
the body of the message
bye
&
</FONT></PRE>
<P>Mail Options All the available options in the <TT>Mail</TT> system can be listed
by typing a <TT>?</TT> after the <TT>&</TT>. The listed options are shown in
Listing 14.6.
<CENTER>
<H3><A NAME="Heading25<FONT COLOR="#000077">Listing 14.6. Mail options.</FONT></H3>
</CENTER>
<PRE><FONT COLOR="#0066FF">
& ?
Mail Commands
t <message list> type messages
n goto and type next message
e <message list> edit messages
f <message list> give head lines of messages
d <message list> delete messages
s <message list> file append messages to file
u <message list> undelete messages
R <message list> reply to message senders
r <message list> reply to message senders and all recipients
pre <message list> make messages go back to /usr/spool/mail
m <user list> mail to specific users
q quit, saving unresolved messages in mbox
x quit, do not remove system mailbox
h print out active message headers
! shell escape
cd [directory] chdir to directory or home if none given
A <message list> consists of integers, ranges of same, or user names separated
by spaces. If omitted, Mail uses the last message typed.
A <user list> consists of user names or aliases separated by spaces.
Aliases are defined in .mailrc in your home directory.
&
</FONT></PRE>
<P>Replying to a Message Suppose you have three mail messages from different users
and you want to reply to the one sent by Jeremy. Just invoke mail as before, as shown
in Listing 14.7.
<CENTER>
<H3><A NAME="Heading27<FONT COLOR="#000077">Listing 14.7. Three received messages.</FONT></H3>
</CENTER>
<PRE><FONT COLOR="#0066FF">
mpsi:~$ mail
Mail version 5.5 6/1/90. Type ? for help.
"/var/spool/mail/laurel": 3 messages 3 unread
>U 1 calvin@hobbes.com Fri Jan 6 13:27 12/429 "Format for a mail hea"
U 2 jeremy@hobbes.com Sat Jan 7 15:25 72/23291 " Please reply soon"
U 3 calvin@hobbes.com Wed Jan 11 12:29 12/373 "message # 3"
</FONT></PRE>
<P>The <TT>U</TT> in front of the second message specifies that the message is still
unread. You can read the message by typing the message number.<FONT COLOR="#0066FF"></FONT>
<PRE><FONT COLOR="#0066FF">& 2
Message 2:
From jeremy@hobbes.com Sat Jan 7 15:25:00 1995
Date: Sat, 7 Jan 1995 15:25:00 -0600
From: "friend22" <jeremy@hobbes.com>
To: laurel@hobbes.com
Subject: Please reply soon
What's up?
</FONT></PRE>
<P>You can reply to the message by typing <TT>r</TT>.</P>
<PRE><FONT COLOR="#0066FF">& r
To: jeremy@hobbes.com
Subject: Re: Please reply soon
Replying to your mail message # 2
I am too busy to reply to you now. Go away.
.
EOT
</FONT></PRE>
<P>The <TT>Mail</TT> daemon automatically sets up the header in the reply mode, so
all you have to do is type the text. Sending and Forwarding Mail Sending and forwarding
mail can be done with the <TT>s</TT> and <TT>f</TT> commands, respectively. The procedures
for creating the header and text of the message are similar to that of replying to
a message.</P>
<P>The ~<TT>/signature</TT> file is appended to every mail message you send. You
should place text in here that you want to send with every message. Some examples
are your phone number or an alternative e-mail address (your recipient might not
be able to reply to certain hosts). <TT>Mail</TT> etiquette requires that you keep
you signature files short--four lines or less. Most recipients do not like to see
pages of information about you in every mail message.
<CENTER>
<H3><A NAME="Heading29<FONT COLOR="#000077">Using news</FONT></H3>
</CENTER>
<P>Using <TT>news</TT> is perhaps the best way of getting into what is probably the
world's best online forum: the Usenet news service. There are literally thousands
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -