<?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 &#124; Latest Tech News, Software And Tutorials &#187; SPAM scoring</title> <atom:link href="http://www.ghacks.net/tag/spam-scoring/feed/" rel="self" type="application/rss+xml" /><link>http://www.ghacks.net</link> <description>A technology news blog covering software, mobile phones, gadgets, security, the Internet and other relevant areas.</description> <lastBuildDate>Sat, 11 Feb 2012 17:32:23 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/> <item><title>Stop SPAM in Postfix with Spamassassin</title><link>http://www.ghacks.net/2009/10/26/stop-spam-in-postfix-with-spamassassin/</link> <comments>http://www.ghacks.net/2009/10/26/stop-spam-in-postfix-with-spamassassin/#comments</comments> <pubDate>Mon, 26 Oct 2009 20:46:31 +0000</pubDate> <dc:creator>Jack Wallen</dc:creator> <category><![CDATA[Advice]]></category> <category><![CDATA[Email]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Networks]]></category> <category><![CDATA[Open Source]]></category> <category><![CDATA[Security]]></category> <category><![CDATA[Server]]></category> <category><![CDATA[Tutorials Advanced]]></category> <category><![CDATA[email filtering]]></category> <category><![CDATA[Postfix]]></category> <category><![CDATA[spam]]></category> <category><![CDATA[SPAM scoring]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=17653</guid> <description><![CDATA[So you have your Ubuntu server up and running with a Postfix mail server (see &#8220;Install Postfix for reliable email delivery&#8220;). You have also set up Postfix for antivirus with the help of ClamAV (see &#8220;Add antivirus to Post fix with ClamAV&#8220;). Finally you have Postfix set up to relay (see &#8220;Mail relaying made simple [...]]]></description> <content:encoded><![CDATA[<p>So you have your Ubuntu server up and running with a Postfix mail server (see &#8220;<a
title="Install Postfix for reliable email delivery" href="http://www.ghacks.net/2009/10/24/install-postfix-for-reliable-email-delivery/" target="_blank">Install Postfix for reliable email delivery</a>&#8220;). You have also set up Postfix for antivirus with the help of ClamAV (see &#8220;<a
title="Add antivirus to Postfix with ClamAV" href="http://www.ghacks.net/2009/10/24/install-postfix-for-reliable-email-delivery/" target="_blank">Add antivirus to Post fix with ClamAV</a>&#8220;). Finally you have Postfix set up to relay (see &#8220;<a
title="Mail relaying made simple with Postfix" href="http://www.ghacks.net/2009/09/23/mail-relaying-made-simple-with-postfix/" target="_blank">Mail relaying made simple with Postfix</a>&#8220;). The last trick in this bag is to add SPAM prevention to Postfix.</p><p>Fortunately there is a tool for that. The tool? <a
title="Spamassassin" href="http://spamassassin.apache.org/" target="_blank">Spamassassin</a>. Spamassassin is a very versatile SPAM tool that is part of the <a
title="Apache Foundation" href="http://www.apache.org/" target="_blank">Apache Foundation</a>. Spamassassin uses numerous means to detect SPAM including: DNS and Checksum based SPAM detection as well as Bayesian filtering, external programs, black lists, and online databases. These tools together make for a fairly powerful detection system.</p><p>In this article you are going to see how to install and configure Spamassassin to work in conjunction with Postfix to further enhance your email server.</p><p><span
id="more-17653"></span><strong>Installing Spamassassin</strong></p><p>Obviously the first thing you need to do is install Spamassassin. You will find Spamassassin in the Ubuntu repositories. And since this entire series has been laid on top of a Ubuntu Server installation, that is quite convenient. So, to install Spamassassin, open up your terminal window and issue the following command:</p><p><em>sudo apt-get install spamassassin</em></p><p>There may or may not be some dependencies to install in order for the Spamassassin  installation to complete. Go ahead and OK those. Once this installation is complete you are ready to start configuring.</p><p><strong>Configuration</strong></p><p>Before we actually get to the configuration it is important to understand the SPAM scoring system. With Spamassassin, messages are tagged as SPAM only when they have enough SPAM-matching characteristics (according to a scoring level). The scoring level is 0-5, however it&#8217;s not as simple as saying a 0 means it is 0% SPAM. The system is set up so that every characteristic can add to the overall score. For example a message tested to find a base64 attachment does not have a file name filtered with both bayes+net will add 0.224 to the over all score of the message. When all of the characteristic scores are added up, if they exceed the default score you have set in the configuration file, that message is considered SPAM.</p><p>Now that you have a basic understand of how the scoring system works. Let&#8217;s start configuring Spamassassin.</p><p>The main configuration file is <strong>/etc/spamassassin/local.cf. </strong>The first option you want to configure is the default score. Look for the line:</p><p><em> # required_score 5.0</em></p><p>The first thing you want to do is uncomment that line (by removing the &#8220;#&#8221; character) and then changing the score. A score of 5 is pretty high and sure to be SPAM. Understand the more you lower that score the likely you are of missing message messages that are tagged false-positives. A score of 3.5 is a fairly reliable score that will catch a lot of SPAM but not a lot of false positives.</p><p>Above this line are a couple of other options that are important. The first is the option to set the option:</p><p>report_safe</p><p>To 0. This option can be set to either 0 or 1. A zero means that if a message is found to be SPAM the message will not be deleted, but instead the subject line will be rewritten to include a message marking it as SPAM.  This is handy to prevent users from losing important messages to false positives. This also allows you to set a lower score threshold.</p><p>To do this first look for the line:</p><p><em># report_safe 1</em></p><p>Uncomment this line by removing the &#8220;#&#8221; character and then change the &#8220;1&#8243; to &#8220;0&#8243; (no quotes).</p><p>The next step is to uncomment the line:</p><p># rewrite_header Subject *****SPAM*****</p><p>Now you can alter the &#8220;*****SPAM*****&#8221; section of this line to reflect what you&#8217;d prefer it to say. Just make sure it is clear to your users that a message with this rewritten subject line is most likely SPAM.</p><p>Now restart the Spamassassin daemon with the command:</p><p><em>sudo /etc/init.d/spamassassin restart </em></p><p><strong>Configure Postfix</strong></p><p>The last step is to set up Postfix to use Spamassassin. To do this open up the file <strong>/etc/postfix/master.cf<em> </em><span
style="font-weight: normal">and look for the line:</span></strong></p><p><strong><span
style="font-weight: normal"><em>smtp     inet    n   &#8211;   &#8211;   &#8211;   &#8211;   smtpd</em></span></strong></p><p>You need to alter this line to look like:</p><p><code>smtp      inet   n   -   -   -   -   smtpd -o content_filter=spamassassin</code></p><p>Finally, at the end of this file add the following:</p><p><code>spamassassin<br
/> unix - n n - - pipe<br
/> flags=R<br
/> user=spamd<br
/> argv=/usr/bin/spamc<br
/> -e /usr/sbin/sendmail<br
/> -oi -f ${sender} ${recipient}</code></p><p>Now all you need to do is restart Postfix with the command:</p><p><em>sudo /etc/init.d/postfix restart</em></p><p>Your mail server should now be scoring incoming message as SPAM or HAM.</p><p><strong>Final thoughts</strong></p><p>The mail server is a tricky beast. You have to ensure that users are getting their mail, but you have to make sure they aren&#8217;t receive SPAM or viruses. After completing this series of articles, you should have a pretty solid server running that will send out mail that is safe for users eyes.</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2009/10/26/stop-spam-in-postfix-with-spamassassin/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> </channel> </rss>
