<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Spamassassin on Major Hayden</title><link>https://major.io/tags/spamassassin/</link><description>Recent content in Spamassassin on Major Hayden</description><generator>Hugo</generator><language>en</language><managingEditor>major@mhtx.net (Major Hayden)</managingEditor><webMaster>major@mhtx.net (Major Hayden)</webMaster><copyright>All content licensed [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/)</copyright><lastBuildDate>Sun, 07 Jun 2026 23:39:03 +0000</lastBuildDate><atom:link href="https://major.io/tags/spamassassin/index.xml" rel="self" type="application/rss+xml"/><item><title>Fixing broken DNS lookups in spamassassin</title><link>https://major.io/p/fixing-broken-dns-lookups-in-spamassassin/</link><pubDate>Fri, 20 Jun 2014 13:20:56 +0000</pubDate><author>major@mhtx.net (Major Hayden)</author><guid>https://major.io/p/fixing-broken-dns-lookups-in-spamassassin/</guid><description>&lt;p&gt;I talked about the &lt;a href="https://twitter.com/majorhayden/status/479250665311457281"&gt;joys of running my own mail server&lt;/a&gt; last week only to find that my mail server was broken yesterday. Spamassassin stopped doing DNS lookups for &lt;a href="https://en.wikipedia.org/wiki/DNSBL"&gt;RBL&lt;/a&gt; and &lt;a href="https://en.wikipedia.org/wiki/Sender_Policy_Framework"&gt;SPF&lt;/a&gt; checks.&lt;/p&gt;
&lt;p&gt;I had one of these moments:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://major.io/wp-content/uploads/2014/06/neil_patrick_harris_sigh.gif"&gt;&lt;img src="https://major.io/wp-content/uploads/2014/06/neil_patrick_harris_sigh.gif" alt="Neil Patrick Harris Sigh" width="500" height="233" class="aligncenter size-full wp-image-4968" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;My logs looked like this:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;plugin: eval failed: available_nameservers: No DNS servers available!
plugin: eval failed: available_nameservers: No DNS servers available!
rules: failed to run NO_DNS_FOR_FROM RBL test, skipping:
 (available_nameservers: [...] No DNS servers available!)
 (available_nameservers: [...] No DNS servers available!
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;My /etc/resolv.conf was correct and had two valid DNS servers listed. Also, the permissions set on /etc/resolv.conf were reasonable (0644) and the SELinux context applied to the file was appropriate (net_conf_t). Everything else on the system was able to resolve DNS records properly. Even an strace on the spamd process showed it reading /etc/resolv.conf successfully!&lt;/p&gt;
&lt;p&gt;It was Google time. I put some snippets of my error output into the search bar and found a &lt;a href="https://issues.apache.org/SpamAssassin/show_bug.cgi?id=7057"&gt;spamassassin bug report&lt;/a&gt;. Mark Martinec found the root cause of the bug:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Net::DNS version 0.76 changed the field name holding a set of nameservers in a Net::DNS::Resolver object: it used to be &amp;rsquo;nameservers&amp;rsquo;, but is now split into two fields: &amp;rsquo;nameserver4&amp;rsquo; and &amp;rsquo;nameserver6'.&lt;/p&gt;
&lt;p&gt;Mail/SpamAssassin/DnsResolver.pm relied on the internal field name of a Net::DNS::Resolver object to obtain a default list of recursive name servers, so the change in Net::DNS broke that.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The &lt;a href="https://svn.apache.org/viewvc/spamassassin/trunk/lib/Mail/SpamAssassin/DnsResolver.pm?r1=1603518&amp;amp;r2=1603517&amp;amp;pathrev=1603518"&gt;patch from the bug report&lt;/a&gt; worked just fine on my Fedora 20 mail server. Be sure to restart spamd after making the change.&lt;/p&gt;
&lt;p&gt;There&amp;rsquo;s a &lt;a href="https://bugzilla.redhat.com/show_bug.cgi?id=1111586"&gt;Fedora bug report&lt;/a&gt; as well.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;If anyone is interested, I plan to write up my email configuration on Fedora soon for other folks to use. I might even make some ansible playbooks for it. ;)&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Fedora update: Fedora&amp;rsquo;s spamassassin package has been updated to 3.4.0-7 and it fixes two bugs. You&amp;rsquo;ll find it in the stable repositories in a few days.&lt;/em&gt;&lt;/p&gt;</description></item><item><title>Basic procmail configuration with spamassassin filtering</title><link>https://major.io/p/basic-procmail-configuration-with-spamassassin-filtering/</link><pubDate>Wed, 13 Aug 2008 17:00:48 +0000</pubDate><author>major@mhtx.net (Major Hayden)</author><guid>https://major.io/p/basic-procmail-configuration-with-spamassassin-filtering/</guid><description>&lt;p&gt;I&amp;rsquo;ve used this extremely basic procmail configuration a million times, and it&amp;rsquo;s a great start for any server configuration. It passes e-mails through spamassassin (if they&amp;rsquo;re smaller than 256KB) and then filters any e-mail marked as spam to /dev/null:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;LOGFILE=/var/log/procmail.log
DROPPRIVS=yes&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;:0fw
| /usr/bin/spamc&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;:0
* ^X-Spam-Status: Yes
/dev/null
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Of course, you can make this much more complicated with some additional customization.&lt;/p&gt;</description></item><item><title>High iowait on RHEL 4 with Plesk and SpamAssassin</title><link>https://major.io/p/high-iowait-on-rhel-4-with-plesk-and-spamassassin/</link><pubDate>Thu, 31 Jan 2008 18:38:58 +0000</pubDate><author>major@mhtx.net (Major Hayden)</author><guid>https://major.io/p/high-iowait-on-rhel-4-with-plesk-and-spamassassin/</guid><description>&lt;p&gt;One of my biggest complaints on RHEL 4 is the large resource usage by the version of SpamAssassin that is installed. When it runs, it uses a ton of CPU time and causes a lot of disk I/O as well. When running top, you may see multiple spamd processes. For a high-volume e-mail server (like the one I administer), this is simply unacceptable.&lt;/p&gt;
&lt;p&gt;I decided to do something about it, and here are the steps:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;First,&lt;/strong&gt; you will need two RPMs:&lt;/p&gt;
&lt;p&gt;Latest &lt;a href="http://dag.wieers.com/rpm/packages/spamassassin/"&gt;SpamAssassin RPM from Dag&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The &lt;a href="http://autoinstall.plesk.com/"&gt;psa-spamassassin RPM from SWSoft/Parallels&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Once you have them both on the server, install the new SpamAssassin package from Dag:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;# rpm -Uvh spamassassin-(version).el4.rf.(arch).rpm&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;At this point, Plesk&amp;rsquo;s spamassassin scripts will be non-functional, but the next step will fix it:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;# rpm -Uvh --force psa-spamassassin-(version).(arch).rpm&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;NOTE: DO NOT REMOVE the psa-spamassassin RPM. This will begin stripping your system of all SpamAssassin configurations and it cannot be reversed!&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Plesk&amp;rsquo;s SpamAssassin scripts have been restored at this point in the process. Now, we need to do the part that really makes SpamAssassin work efficiently:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;# sa-update; sa-compile;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;This will update the SpamAssassin rules, and it will compile the rules with re2c (you may also need to &lt;a href="http://dag.wieers.com/rpm/packages/re2c/"&gt;get this RPM from Dag&lt;/a&gt;). This compilation means less disk access, and less CPU time being used to process e-mails.&lt;/p&gt;
&lt;p&gt;To activate the compiled rules within SpamAssassin, uncomment the plugin line in /etc/mail/spamassassin/v320.pre:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;# Rule2XSBody - speedup by compilation of ruleset to native code&amp;lt;br /&amp;gt; #&amp;lt;br /&amp;gt; loadplugin Mail::SpamAssassin::Plugin::Rule2XSBody&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Please bear in mind that this process is done &lt;em&gt;at your own risk&lt;/em&gt;. This may cause issues getting support from SWSoft or your hosting company. This has been tested on Red Hat Enterprise Linux 4 64-bit with Plesk 8.1.1, 8.2.0, and 8.2.1 with SpamAssassin 3.2.3 and 3.2.4.&lt;/p&gt;</description></item></channel></rss>