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

📄 0180-0182.html

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTML
字号:






<HTML>

<HEAD>

<TITLE>Sams Teach Yourself Linux in 24 Hours:Configuring Internet Email:EarthWeb Inc.-</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=0672311623 //-->

<!-- TITLE=Sams Teach Yourself Linux in 24 Hours//-->

<!-- AUTHOR=Bill Ball//-->

<!-- PUBLISHER=Macmillan Computer Publishing//-->

<!-- IMPRINT=Sams//-->

<!-- CHAPTER=11 //-->

<!-- PAGES=0173-0184 //-->

<!-- UNASSIGNED1 //-->

<!-- UNASSIGNED2 //-->







<P><CENTER>

<a href="0176-0179.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0183-0184.html">Next</A>

</CENTER></P>



<A NAME="PAGENUM-180"><P>Page 180</P></A>









<P>Unlike pine, elm must be started in a window with at least 14 rows, or it will complain

and quit.

</P>



<P>After you retrieve your mail, elm reads your messages and displays your messages as

shown in Figure 11.4 (just as the pine mail program does).<BR>

</P>



<P>Figure 11.4.<BR>

The elm mail program<BR>

displays messages in a<BR>

list.

</P>

<P><a href="javascript:displayWindow('images/ch11fg04.jpg', 288, 209)"><img src="images/tn_ch11fg04.jpg"></a><BR>

</P>



<P>As in pine, you can use elm to delete, forward, save, or compose messages. You can

customize some of its features by typing an o while in

elm's main display. These custom features are saved in an

elmrc file under the .elm folder in your home directory.

</P>



<P>This book doesn't go into all the details about the

elm program. Make sure to read the manual page for

elm before you start using it. If you'd like more information, you can

also check

</P>



<!-- CODE SNIP //-->

<PRE>

<a href="http://www.myxa.com/elm.html">

http://www.myxa.com/elm.html</A>

</PRE>

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



<H4><A NAME="ch11_ 11">

Subscribing to Mailing Lists

</A></H4>



<P>Once you feel confident that your mail system is working, you may want to subscribe

to a mailing list. Mailing lists are handled by automatic mail servers, and work by

relaying messages generated to all members of a mailing list. One smart way to subscribe to

mailing lists is to sign up for a digest version, in which the day's message traffic is condensed

into a single or twice-daily mailing.

</P>



<P>You can find out more about mailing lists by browsing to

</P>

<A NAME="PAGENUM-181"><P>Page 181</P></A>





<!-- CODE SNIP //-->

<PRE>

<a href="http://www.lsoft.com/lists/listref.html">

http://www.lsoft.com/lists/listref.html</A>

</PRE>

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



<P>One query sent to a mailing list server at the University of Georgia returned:

</P>





<!-- CODE //-->

<PRE>

Date: Tue, 18 Nov 1997 19:12:15 -0500

From: &quot;L-Soft list server at UGA (1.8c)&quot; &lt;LISTSERV@UGA.CC.UGA.EDU&gt;

To: bball@staffnet.com

Subject: Output of your job &quot;bball&quot;



&gt; lists global

There   are    currently   14,869    public   LISTSERV   lists    known   to

LISTSERV@UGA.CC.UGA.EDU. Without  a search string, the  listing generated by

the LIST  GLOBAL command would be  over 44,500 lines  long and add up  to an

estimated 1486k of data. Please use a search string to limit the size of the

file that  will be returned  to you. For  instance, &quot;LIST GLOBAL  CHEM&quot; will

return a description of all the lists related to chemistry (lists whose name

or topic contains the string &quot;CHEM&quot;).

</PRE>

<!-- END CODE //-->



<P>Chances are that you'll find a mailing list that will interest you. Have fun!

</P>



<H3><A NAME="ch11_ 12">

Configuring procmail and Writing Recipes to Fight Spam

</A></H3>



<P>We're all used to getting junk mail or telemarketing calls. Day after day, we receive

offers for credit cards, home equity loans, new long-distance service, or great deals on prime

cuts of pot roast at the local food market. You can do something about unwanted postal

mail, junk faxes, and telemarketing calls, but there's no current regulation regarding junk email.

</P>



<P>You can, however, use procmail, which is found under the

/usr/bin directory, to filter your incoming mail. You'll need to create a directory, create several files, write a small

script, and customize how your incoming mail is handled by writing short filters, or

procmail recipes. It will only take you a minute or so to set up your system to organize incoming mail

and dispose of junk mail.

</P>



<P>The first step is to create a text file, called

.procmailrc, in your home directory. Then, type in the following, specifying the name of your mail directory (if you use

pine, the directory is mail), the location of the

.procmail directory (which you'll soon create), and the name of

your procmail filter file:

</P>



<!-- CODE SNIP //-->

<PRE>

MAILDIR=$HOME/mail

PMDIR=$HOME/.procmail

INCLUDERC=$HOME/rc.mailfilter

</PRE>

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



<P>Save this file. Next, create a text file called

.forward in your home directory. This file should contain the following line:

</P>



<!-- CODE SNIP //-->

<PRE>

&quot;|IFS=' ` &amp;&amp; exec /usr/bin/procmail -f- || exit 75 #username&quot;

</PRE>

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



<A NAME="PAGENUM-182"><P>Page 182</P></A>







<P>This command line controls procmail, and you should use your username instead of

username. Now, make your .forward file world-readable, and your home directory

</P>



<P>world-searchable with the chmod command. See the following example (making sure

you're in your home directory):

</P>



<!-- CODE SNIP //-->

<PRE>

# chmod 644 .forward

# chmod a+x .

</PRE>

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



<P>You're almost done. Now, with the mkdir command, create a directory called

.procmail, change directories into it, and create a text file called

rc.mailfilter.

</P>



<P>This file will contain your procmail filters, or recipes. While these recipes can be

extremely complex (so complex in fact, that you can write your own mail delivery service), this

section presents simple recipes to get you started.

</P>



<P>First, examine a sample message's mail headers (which contain the From:, To:, or

Subject: lines). The British MG sports cars digest has the following subject line in each message:

</P>



<!-- CODE SNIP //-->

<PRE>

Subject: mgs@autox.team.net digest #905 Mon Nov 17 10:09:07 MST 1997

</PRE>

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



<P>Each digest message can contain almost 100,000 characters, and is sent twice a day, so

it would be nice to have all these digests go into their own mail folder, which you'll call

mgdigest. So, you'll enter

</P>



<!-- CODE SNIP //-->

<PRE>

:0:

*^Subject:.*digest

mgdigest

</PRE>

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



<P>This small recipe will save any incoming message with a subject line containing the

word digest into a mail file called mgdigest in your mail program's mail directory. Note that

you don't have to create this mail file yourself. It will be created for you when you first

retrieve mail, and procmail finds a match. You can also use another recipe to have all mail files

from your friends saved to a specific folder, for example:

</P>



<!-- CODE SNIP //-->

<PRE>

:0:

*^From:.*aol.com

AOL

</PRE>

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



<P>&quot;OK,&quot; you're asking, &quot;but what about junk email?&quot; Well, you know what you want to

do with junk email&#151;trash it! For Linux users, there's a special place to which you can

send junk email: the old bit bucket, /dev/null. So if you get an unwanted message from a place

like hotlips4u.com, you can send this type of junk to the boneyard with

</P>



<!-- CODE SNIP //-->

<PRE>

:0:

^From:.*hotlips4u.com

/dev/null

</PRE>

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



<P>The mail message won't be stored on your hard drive, and you won't have to bother

with any mail from that address again. Using this approach is simplistic,

however, and if you get a lot of junk mail, you may want to experiment with more complex recipes, which

can

</P>

<P><CENTER>

<a href="0176-0179.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0183-0184.html">Next</A>

</CENTER></P>











</td>
</tr>
</table>

<!-- begin footer information -->









</body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -