<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>gHacks technology news &#187; SPAM filtering</title>
	<atom:link href="http://www.ghacks.net/tag/spam-filtering/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ghacks.net</link>
	<description>A technology blog covering software, mobile phones, gadgets, security, the Internet and other relevant areas.</description>
	<lastBuildDate>Tue, 24 Nov 2009 20:14:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Use Spamassassin for better SPAM detection</title>
		<link>http://www.ghacks.net/2009/05/01/use-spamassassin-for-better-spam-detection/</link>
		<comments>http://www.ghacks.net/2009/05/01/use-spamassassin-for-better-spam-detection/#comments</comments>
		<pubDate>Fri, 01 May 2009 20:42:56 +0000</pubDate>
		<dc:creator>Jack Wallen</dc:creator>
				<category><![CDATA[Email]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Tutorials Basic]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[mail server]]></category>
		<category><![CDATA[spam]]></category>
		<category><![CDATA[SPAM filtering]]></category>
		<category><![CDATA[spamassassin]]></category>

		<guid isPermaLink="false">http://www.ghacks.net/?p=12517</guid>
		<description><![CDATA[The Linux operating system is typically immune to viruses attached to email. But it is not immune to SPAM. Left unfiltered your inbox would quickly fill up with more SPAM than you care to delete. What is worse is owning a mail server and not protecting your users from a barrage of SPAM.
By employing Spamassassin [...]]]></description>
			<content:encoded><![CDATA[<p>The Linux operating system is typically immune to viruses attached to email. But it is not immune to SPAM. Left unfiltered your inbox would quickly fill up with more SPAM than you care to delete. What is worse is owning a mail server and not protecting your users from a barrage of SPAM.</p>
<p>By employing Spamassassin you can set up an outstanding SPAM  filter system that will protect your users. It&#8217;s not as simple as double clicking an .exe file to install, but the end results will be worth the time and effort.</p>
<p><span id="more-12517"></span><strong>Installing the tool<br />
</strong></p>
<p>This portion of the task is simple. Open up your Add/Remove utility, do a search for &#8220;spamassassin&#8221; (no quotes), select the results, and apply the changes. After you have installed the package you need to take a few steps to finish up the installation.</p>
<p>Now you are going to need a <strong>local.rc </strong>file. You can open up the <strong>/etc/mail/spamassassin/local.rc </strong>file for hand editing, or you can use this <a title="Spamassassin configurator" href="http://www.yrex.com/spam/spamconfig.php" target="_blank">handy web-based tool</a> to set it up for you. This tool was written by Michael Moncur and makes the setup of Spamassassin much easier. Once you have selected all your options click the Generate button and then click the Download button. You will need to place this file in <strong>/etc/mail/spamassassin</strong> in order for it to be used.</p>
<p>It&#8217;s time to start the daemon. Issue the command <strong>/etc/init.d/spamassassin start </strong>(or <strong>/etc/rc.d/init.d/spamassassin start</strong> &#8211; depending upon your distribution.)</p>
<p><strong>Test the install</strong></p>
<p>Spamassassin comes with a sample file you can run through the filter for testing. In modern installations this file is located in <strong>/usr/share/doc/spamassassin-*/sample-spam.txt</strong>. To test this issue the command:</p>
<p><em>spamc -R &lt;/usr/share/doc/spamassassin-3.2.5/sample-spam.txt</em></p>
<p>You should see results like this:</p>
<p><em>Content analysis details:   (1000.0 points, 5.0 required)</em></p>
<p><em>pts rule name              description<br />
&#8212;- &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
-0.0 NO_RELAYS              Informational: message was not relayed via SMTP<br />
1000 GTUBE                  BODY: Generic Test for Unsolicited Bulk Email<br />
-0.0 NO_RECEIVED            Informational: message has no Received headers</em></p>
<p>As you can see, this sample scored 1000 points. Only 5 points are required for an email to be considered SPAM. It&#8217;s safe to say this is SPAM and safe to say Spamassassin is working.</p>
<p><strong>Using Spamassassin with Procmail</strong></p>
<p>You will need to set up Procmail (or another MTA) in order to deliver mail. What we want to do is set this up globally so you don&#8217;t have to deal with each users ~/.procmailrc file. To do this you will edit the <strong>/etc/procmailrc</strong> file. All you need to do is add the following lines:</p>
<p><em>DROPPRIVS=yes</em></p>
<p><em>:0fw</em></p>
<p><em>| /usr/bin/spamc</em></p>
<p>Spamassassin should now be working.</p>
<p><strong>Training spamassassin</strong></p>
<p>At first you might not notice much of a drop in SPAM. This is because Spamassassin has to have a period of training.  There is a built-in tool for this called sa-learn. What you need to do is create two folders, one for SPAM and one for HAM. In the SPAM folder collect 100 or so emails that are definately SPAM. In the HAM folder collect 100 or so valid emails. Once you have those folders collected issue the following commands:</p>
<p>sa-learn &#8211;spam /PATH/TO/SPAM/FOLDER</p>
<p>sa-learn &#8211;ham /PATH/TO/HAM/FOLDER</p>
<p>Where /PATH/TO/SPAM/FOLDER and /PATH/TO/HAM/FOLDER are the explicit paths to these folders.</p>
<p>You can also set up a cron job to help Spamassassin train frequently if you need.</p>
<p><strong>Final Thoughts</strong></p>
<p>If SPAM is clogging up your Linux mail server you will be wise to employ a tool like Spamassassin. Your users and your IT staff will thank you for it.</p>

	Tags: <a href="http://www.ghacks.net/tag/linux/" title="Linux" rel="tag">Linux</a>, <a href="http://www.ghacks.net/tag/mail-server/" title="mail server" rel="tag">mail server</a>, <a href="http://www.ghacks.net/tag/spam/" title="spam" rel="tag">spam</a>, <a href="http://www.ghacks.net/tag/spam-filtering/" title="SPAM filtering" rel="tag">SPAM filtering</a>, <a href="http://www.ghacks.net/tag/spamassassin/" title="spamassassin" rel="tag">spamassassin</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.ghacks.net/2009/06/20/use-bogofilter-for-better-junk-detection-in-evolution/" title="Use Bogofilter for better junk detection in Evolution (June 20, 2009)">Use Bogofilter for better junk detection in Evolution</a> (3)</li>
	<li><a href="http://www.ghacks.net/2009/10/16/spam-filtering-with-kmail/" title="Spam filtering with Kmail (October 16, 2009)">Spam filtering with Kmail</a> (2)</li>
	<li><a href="http://www.ghacks.net/2009/06/05/make-sendmail-accept-mail-from-external-sources/" title="Make Sendmail accept mail from external sources (June 5, 2009)">Make Sendmail accept mail from external sources</a> (1)</li>
	<li><a href="http://www.ghacks.net/2008/02/07/yoggie-pico-personal-mobile-security-computer/" title="Yoggie PICO Personal Mobile Security Computer (February 7, 2008)">Yoggie PICO Personal Mobile Security Computer</a> (3)</li>
	<li><a href="http://www.ghacks.net/2009/10/30/with-ubuntu-9-10-arrives-wubi-9-10/" title="With Ubuntu 9.10 Arrives Wubi 9.10 (October 30, 2009)">With Ubuntu 9.10 Arrives Wubi 9.10</a> (2)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ghacks.net/2009/05/01/use-spamassassin-for-better-spam-detection/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
