⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 637-638.html

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 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=637-638//-->

<!--UNASSIGNED1//-->

<!--UNASSIGNED2//-->



<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="634-636.html">Previous</A></TD>

<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>

<TD><A HREF="638-640.html">Next</A></TD>

</TR>

</TABLE>

</CENTER>

<P><BR></P>

<P>Some lines were displayed before the message itself began. This is the header information&#151;and it can be useful. Typically, header information includes the following:

</P>

<DL>

<DD><B>&#149;</B>&nbsp;&nbsp;The message number

<DD><B>&#149;</B>&nbsp;&nbsp;Who sent the message

<DD><B>&#149;</B>&nbsp;&nbsp;When it was sent

<DD><B>&#149;</B>&nbsp;&nbsp;The name of the system that received the message

<DD><B>&#149;</B>&nbsp;&nbsp;The date the message was received

<DD><B>&#149;</B>&nbsp;&nbsp;The &#147;real name&#148; of the sender, as well as his or her login ID

<DD><B>&#149;</B>&nbsp;&nbsp;The return path

<DD><B>&#149;</B>&nbsp;&nbsp;The message recipient(s)

<DD><B>&#149;</B>&nbsp;&nbsp;The subject

</DL>

<P>All this information is passed on with each e-mail message. The sender is always identified, making forgeries difficult. The real name that appears in the <TT>From</TT> line is taken from a field from the sender&#146;s entry in the password file. The mail system uses the <TT>Return-Path</TT> or <TT>Reply-To</TT> information if you generate a reply (as discussed later in this chapter). The <TT>To</TT> line contains the address or list of addresses of the recipients of this message. (This sample message was a group message.) The sender filled in the <TT>Subject</TT> line.</P>

<P><FONT SIZE="+1"><B>Reading the Next Message</B></FONT></P>

<P>There are two ways to read the next message (the message following the current message in your mailbox). You can press &lt;Return&gt; or &lt;n&gt; to display the next message. It becomes the current message after you read it. You read the next message in the same way you read the current message. After you read the last message in the list, you see the message <TT>&#145;At EOF&#146;</TT>.</P>

<P><FONT SIZE="+1"><B>Reading Any Message</B></FONT></P>

<P>All the messages in your mailbox are numbered. You can read messages in any order by entering the message number when you see the <TT>?</TT> prompt. For example, to read message number 2, type <TT>2</TT> and press &lt;Return&gt;. Message number 2 then becomes the current message.</P>

<H4 ALIGN="LEFT"><A NAME="Heading10"></A><FONT COLOR="#000077">Reading E-Mail from Other Files</FONT></H4>

<P>When you start <TT>mail</TT>, you read messages kept in your system mailbox, which has the path /var/spool/mail/$LOGNAME. Recall from Chapter 18, &#147;Understanding Linux Shells,&#148; that <TT>LOGNAME</TT> is the shell variable that holds your login name. If you log in as bkorn, your mail is held in /var/spool/mail/bkorn. You can read mail from other files that hold complete e-mail messages&#151;that is, messages with the headers and text of the messages. Naturally, you must have read permission for those files.</P>

<P>To read messages from a file, type the command to start the e-mail program followed by <TT><B>-f</B> filename</TT>, and press &lt;Return&gt;. For example, to read the e-mail in the file mbox, enter this command:</P>

<!-- CODE SNIP //-->

<PRE>

<B>mail -f mbox|</B>

</PRE>

<!-- END CODE SNIP //-->

<P>You can read the mail in that file in the same way you read e-mail from your system mailbox.

</P>

<BLOCKQUOTE>

<P><FONT SIZE="-1"><HR><B>NOTE:&nbsp;&nbsp;</B>The mbox file is located in your home directory and automatically contains messages you&#146;ve already read but haven&#146;t deleted. These messages are saved to mbox when you exit <TT>mail</TT>.<HR></FONT>

</BLOCKQUOTE>

<H4 ALIGN="LEFT"><A NAME="Heading11"></A><FONT COLOR="#000077">Sending Mail While Reading</FONT></H4>

<P>You can send e-mail while you&#146;re using the <TT>mail</TT> program to read your messages. To do so, enter <TT><B>m</B> address</TT> at the <TT>?</TT> prompt. Follow these steps:</P>

<DL>

<DD><B>1.</B>&nbsp;&nbsp;Start the <TT>mail</TT> program (type <TT>mail</TT> and press &lt;Return&gt;).

<DD><B>2.</B>&nbsp;&nbsp;Read some messages or do other things, but at the <TT>?</TT> prompt, enter the following to send e-mail to a user whose login name is ernie:

<!-- CODE SNIP //-->

<PRE>

   <B>m ernie</B>

</PRE>

<!-- END CODE SNIP //-->

<DD><B>3.</B>&nbsp;&nbsp;At the prompt for a subject, type a subject heading:

<!-- CODE SNIP //-->

<PRE>

   Subject: <B>Game Time</B>

</PRE>

<!-- END CODE SNIP //-->

<DD><B>4.</B>&nbsp;&nbsp;Type the message and end it with a period on the last line, as in the following example:

<!-- CODE SNIP //-->

<PRE>

   <B>Don&#146;t forget we&#146;re playing V-ball at 6:30</B>

   <B>.</B>

</PRE>

<!-- END CODE SNIP //-->

<BR>The computer responds with the following lines:

<!-- CODE SNIP //-->

<PRE>

   EOT

   ?

</PRE>

<!-- END CODE SNIP //-->

<DD><B>5.</B>&nbsp;&nbsp;Continue using <TT>mail</TT>.

</DL>

<H3><A NAME="Heading12"></A><FONT COLOR="#000077">Printing Mail Messages</FONT></H3>

<P>By using <TT>mail</TT>, you can print the current message to a printer connected to your system. First, make the message you want to print the current message. Then enter <TT>| <B>lpr</B></TT> at the <TT>?</TT> prompt. You are, in effect, piping the current message to the <TT>lpr</TT> program.</P>

<P>To print a collection of messages, save them in a file and then print the file. See the section &#147;Saving E-Mail to Files with <TT>mail</TT>,&#148; later in this chapter, for information on effective ways to save messages.</P><P><BR></P>

<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="634-636.html">Previous</A></TD>

<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>

<TD><A HREF="638-640.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 + -