<?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; spamassassin</title>
	<atom:link href="http://www.ghacks.net/tag/spamassassin/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 03:24:03 +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>Spam filtering with Kmail</title>
		<link>http://www.ghacks.net/2009/10/16/spam-filtering-with-kmail/</link>
		<comments>http://www.ghacks.net/2009/10/16/spam-filtering-with-kmail/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 14:55:44 +0000</pubDate>
		<dc:creator>Jack Wallen</dc:creator>
				<category><![CDATA[Advice]]></category>
		<category><![CDATA[Email]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Tutorials Basic]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[Bogofilter]]></category>
		<category><![CDATA[HAM]]></category>
		<category><![CDATA[kmail]]></category>
		<category><![CDATA[spam]]></category>
		<category><![CDATA[spamassassin]]></category>

		<guid isPermaLink="false">http://www.ghacks.net/?p=17337</guid>
		<description><![CDATA[SPAM. It&#8217;s a dreadful word that causes many a computer user to yank out their hair and wish their service provider would do a better job of keeping SPAM out of your inbox. But that is not going to happen over night. So&#8230;it is up to the end user to make sure they have extra [...]]]></description>
			<content:encoded><![CDATA[<p>SPAM. It&#8217;s a dreadful word that causes many a computer user to yank out their hair and wish their service provider would do a better job of keeping SPAM out of your inbox. But that is not going to happen over night. So&#8230;it is up to the end user to make sure they have extra means of SPAM prevention rolled into their email clients.</p>
<p>Most email clients contain some sort of SPAM prevention. On the Linux operating system you can employ such tools as <a title="Bogofilter" href="http://bogofilter.sourceforge.net/" target="_blank">Bogofilter</a> or <a title="Spamassassin" href="http://spamassassin.apache.org/" target="_blank">Spamassassin</a>. Either of these tools are great for stopping SPAM &#8211; but what about using them with your favorite email client? With some Linux email clients you have to add extra applications in order to have one of these SPAM filters doing their job with your client. Some clients, however, have built-in tools to save you a little work. KMail belongs to the latter category. So long as you have either/or Bogofilter or Spamassassin installed, you are one step closer to having solid SPAM filtering.</p>
<p>In this article you will learn how to set up reliable SPAM filtering in the KMail mail client.</p>
<p><span id="more-17337"></span><strong>Bogofilter and Spamassassin</strong></p>
<p>KMail can use either Bogofilter or Spammassassin easily. Read up on either tool and decide which application you want to use. I have had good luck with both, but I do believe Bogofilter is easier to set up. And since KMail will automatically detect either, the choice is yours.</p>
<p>You can install either tool from within the Add/Remove Software utility by following these steps:</p>
<ol>
<li><span style="background-color: #ffffff">Open Add/Remove Software utility.</span></li>
<li><span style="background-color: #ffffff">Search for either &#8220;bogofilter&#8221; or &#8220;spamassassin&#8221; (No quotes).</span></li>
<li><span style="background-color: #ffffff">Select either (or both) tools for installation.</span></li>
<li><span style="background-color: #ffffff">Click Apply to install.</span></li>
</ol>
<p>That&#8217;s it. Now you are ready to move on to KMail.</p>
<p><strong>Kmail SPAM Wizard</strong></p>
<div id="attachment_17339" class="wp-caption alignleft" style="width: 190px"><a rel="attachment wp-att-17339" href="http://www.ghacks.net/2009/10/16/spam-filtering-with-kmail/kmail_spam_wizard_1/"><img class="size-thumbnail wp-image-17339 " src="http://www.ghacks.net/wp-content/uploads/2009/10/kmail_spam_wizard_1-300x300.png" alt="Figure 1" width="180" height="180" /></a><p class="wp-caption-text">Figure 1</p></div>
<p>When you have KMail set up and running click on the Tools menu and select the &#8220;Anti-SPAM Wizard&#8221; entry. When the Wizard opens the first thing it will do is detect which SPAM tools you have installed (see Figure 1).</p>
<p>Once the wizard has detected your SPAM tools, select the tool you want to use and click Next. For the purpose of this article I will select Bogofilter.</p>
<p>The next step in the wizard will ask you for two configurations:</p>
<ul>
<li><span style="background-color: #ffffff">Mark detected SPAM as read: I prefer to unset this, because of the next configuration option.</span></li>
<li><span style="background-color: #ffffff">Which folder to relocate SPAM: By default KMail will move SPAM to the trash folder. I prefer to create a new SPAM folder in order to catch any false-positives.</span></li>
</ul>
<p>By moving SPAM to a specific SPAM folder (and not the trash folder) and keeping SPAM unread, you are less likely to miss any email mistakenly marked as SPAM (false-positive).</p>
<p>The final window of the wizard gives you a report on what you have set up. In my case the wizard creates the following filters:</p>
<ul>
<li><span style="background-color: #ffffff">Bogofilter Check</span></li>
<li><span style="background-color: #ffffff">Spam handling</span></li>
<li><span style="background-color: #ffffff">Classify as Spam</span></li>
<li><span style="background-color: #ffffff">Classify as NOT Spam</span></li>
</ul>
<p>Click the Finish button and your KMail client is ready to learn. And learning is the key.</p>
<p><strong>Help Bogofilter learn</strong></p>
<div id="attachment_17340" class="wp-caption alignright" style="width: 190px"><a rel="attachment wp-att-17340" href="http://www.ghacks.net/2009/10/16/spam-filtering-with-kmail/ham_button/"><img class="size-thumbnail wp-image-17340 " src="http://www.ghacks.net/wp-content/uploads/2009/10/ham_button-300x124.png" alt="Figure 2" width="180" height="74" /></a><p class="wp-caption-text">Figure 2</p></div>
<p>Before Bogofilter can become a reliable SPAM filter, it has to learn what should be classified as SPAM and what should be classified as HAM. Here&#8217;s how I like to do it. Allow plenty of email to collect in your inbox. As the mail comes in take all SPAM (that is not already marked and moved) and move it to the SPAM folder. Once you have cleared your Inbox of all SPAM, select all mail in that folder and then click the Ham button (see Figure 2).</p>
<p>Now, once you have collect a good amount of SPAM in your SPAM folder open that folder up, select all the SPAM, and click the SPAM button.</p>
<p>You may have to do this trick a few times before Bogofilter has been properly trained. You will know when Bogofilter has become accurate with your SPAM/HAM.</p>
<p><strong>Final thoughts</strong></p>
<p>It couldn&#8217;t be much easier to catch and mark SPAM with KMail and Bogofilter. But if you find Bogofilter not as reliable as you would like, run the Wizard and try Spamassassin instead.</p>

	Tags: <a href="http://www.ghacks.net/tag/bogofilter/" title="Bogofilter" rel="tag">Bogofilter</a>, <a href="http://www.ghacks.net/tag/ham/" title="HAM" rel="tag">HAM</a>, <a href="http://www.ghacks.net/tag/kmail/" title="kmail" rel="tag">kmail</a>, <a href="http://www.ghacks.net/tag/spam/" title="spam" rel="tag">spam</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/05/01/use-spamassassin-for-better-spam-detection/" title="Use Spamassassin for better SPAM detection (May 1, 2009)">Use Spamassassin for better SPAM detection</a> (1)</li>
	<li><a href="http://www.ghacks.net/2008/05/18/whats-wrong-with-those-rapidshare-captchas/" title="What&#8217;s wrong with those Rapidshare Captchas ? (May 18, 2008)">What&#8217;s wrong with those Rapidshare Captchas ?</a> (44)</li>
	<li><a href="http://www.ghacks.net/2006/06/15/understanding-email-headers/" title="Understanding Email Headers (June 15, 2006)">Understanding Email Headers</a> (0)</li>
	<li><a href="http://www.ghacks.net/2009/07/01/trap-spammers-with-project-honey-pot/" title="Trap Spammers with Project Honey Pot (July 1, 2009)">Trap Spammers with Project Honey Pot</a> (4)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ghacks.net/2009/10/16/spam-filtering-with-kmail/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<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>
