📄 648-650.html
字号:
<HTML>
<HEAD>
<TITLE>Special Edition Using Linux, Fourth Edition:Using Electronic Mail</TITLE>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>
-->
<!--ISBN=0789717468//-->
<!--TITLE=Special Edition Using Linux, Fourth Edition//-->
<!--AUTHOR=Jack Tackett//-->
<!--AUTHOR=Jr.//-->
<!--AUTHOR=Steve Burnett//-->
<!--PUBLISHER=Macmillan Computer Publishing//-->
<!--IMPRINT=Que//-->
<!--CHAPTER=33//-->
<!--PAGES=648-650//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="645-648.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="650-653.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<H4 ALIGN="LEFT"><A NAME="Heading23"></A><FONT COLOR="#000077">Quitting and Saving Changes</FONT></H4>
<P>To quit the <TT>mail</TT> program and save the changes that occur, press <q><Return> at the <TT>?</TT> prompt. You see the shell prompt again. When you quit <TT>mail</TT> this way, messages you read but didn’t delete are saved in a file named mbox in your home directory.</P>
<P>Suppose that you use <TT>mail</TT> to read your mail. Your login name is bkorn, and your home directory is /home/bkorn. When you enter <TT><B>mail</B></TT> to start the <TT>mail</TT> program, you see the following screen of information:</P>
<!-- CODE SNIP //-->
<PRE>
mail Type ? for help.
“/var/spool/mail/bkorn”: 5 messages 2 new 1 unread
1 sarah Wed Jan 8 09:17 15/363
2 top@kite.fish.com Thu Jan 9 10:18 26/657 Meeting on Friday
U 3 fred Fri Jan 10 08:09 32/900 New Order
> N 4 jones Fri Jan 10 13:22 35/1347 Draft Report
N 5 smith@somewhere.com Sat Jan 11 13:21 76/3103 Excerpt from book
?
</PRE>
<!-- END CODE SNIP //-->
<P>Now suppose that you read the current message by pressing <Return>, and then you read message 1 by typing <TT>1</TT> and pressing <Return> at the <TT>?</TT> prompt. If you then press <q><Return> to quit, you see the following information:</P>
<!-- CODE SNIP //-->
<PRE>
Saved 2 messages in /home/bkorn/mbox
Held 3 messages in /var/spool/mail/bkorn
</PRE>
<!-- END CODE SNIP //-->
<P>The two messages you read are saved in the file mbox in your home directory; the other three messages are saved in your system mailbox, /var/spool/mail/bkorn.
</P>
<P>If you save read messages like this often, mbox can become quite large. You may want to print that file occasionally and delete it. You can also read the mail from that file as though it were your system mailbox, as described later in this chapter.</P>
<BLOCKQUOTE>
<P><FONT SIZE="-1"><HR><B>NOTE: </B>You can read mail and indicate that the current message is to be kept in your system mailbox, /var/spool/mail/bkorn, and not in the file mbox. To do this after you read a message, enter <TT><B>pre</B></TT> (for preserve) at the <TT>?</TT> prompt.<HR></FONT>
</BLOCKQUOTE>
<H4 ALIGN="LEFT"><A NAME="Heading24"></A><FONT COLOR="#000077">Quitting and Not Saving Changes</FONT></H4>
<P>The other way to quit the <TT>mail</TT> program is to press <x><Return> at the <TT>?</TT> prompt. When you do that, you exit the program with no changes to your system mailbox or any other file—as if you didn’t read your mail at all. You then see the shell prompt. You may want to exit the <TT>mail</TT> program in this way when you want to leave the program but save the mail in your system mailbox.</P>
<H3><A NAME="Heading25"></A><FONT COLOR="#000077">Using the <I>elm</I> Mailer
</FONT></H3>
<P>As stated earlier in this chapter, several different mail programs are available for Linux. Each has its own advantages and disadvantages.
</P>
<P>One mail reader that comes with the Slackware and Red Hat distributions of Linux is the <TT>elm</TT> mailer. This mail program is a screen-oriented mailer rather than a line-oriented one. It provides a set of interactive menu prompts and is easy to use. Virtually everything that you can do with <TT>mail</TT> can be done under <TT>elm</TT>, and usually much more easily!</P>
<P>Because <TT>elm</TT> is easy to use, the following sections just touch on the highlights of using it. You can find more in-depth information by using <TT>elm</TT>’s online help or by reading its man page.</P>
<H4 ALIGN="LEFT"><A NAME="Heading26"></A><FONT COLOR="#000077">Starting <I>elm</I>
</FONT></H4>
<P>To start a mail session with <TT>elm</TT>, just type <TT><B>elm</B></TT> at the command prompt. If this is the first time you’ve used <TT>elm</TT>, it will prompt you for permission to set up a configuration directory in your account and create an mbox mail file if one doesn’t exist. Here’s what you see as you start <TT>elm</TT> for the first time:</P>
<!-- CODE //-->
<PRE>
$ <B>elm</B>
Notice:
This version of ELM requires the use of a .elm directory in your home
directory to store your elmrc and alias files. Shall I create the
directory .elm for you and set it up (y/n/q)? <B>y</B>
Great! I’ll do it now.
Notice:
ELM requires the use of a folders directory to store your mail folders in.
Shall I create the directory /home/gunter/Mail for you (y/n/q)? <B>y</B>
Great! I’ll do it now.
</PRE>
<!-- END CODE //-->
<P>After <TT>elm</TT> creates its directory and mbox file, it runs the main mail program. This is a full-screen-oriented mailer. Your screen clears, and you see a display similar to the following:</P>
<!-- CODE //-->
<PRE>
Mailbox is ‘/var/spool/mail/gunter’ with 2 messages [ELM 2.4 PL25]
<B>N 1 Nov 11 Jack Tackett Linux book</B>
N 2 Nov 11 Jack Tackett more ideas
You can use any of the following commands
by pressing the first character;
d)elete or u)ndelete mail, m)ail a message,
r)eply or f)orward mail, q)uit
To read a message, press <return>. j = move down, k = move up, ? = help
Command:
</PRE>
<!-- END CODE //-->
<P>At the top of the screen, <TT>elm</TT> tells you where your system mailbox is located, how many messages are in it, and what version of <TT>elm</TT> you’re running. <TT>elm</TT> then lists one line for each message in your mailbox. It places the letter <TT>N</TT> before each new message, just like the <TT>mail</TT> program. The summary line for each message tells you whether the message is new, the message date, the sender, and the subject. (As always, your display may vary slightly depending on your version of <TT>elm</TT>.) The current message is highlighted in the list (in the preceding listing, the current message is in boldface).</P><P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="645-648.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="650-653.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
</td>
</tr>
</table>
<!-- begin footer information -->
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -