Amavis, spamassassin upgrade to Ubuntu Dapper
Tuesday, August 8th, 2006
Everything was working nicely on Ubuntu Hoary and then I boldly upgraded to Dapper. Perhaps rashly. Not that Dapper is bad, but the apt distro upgrade or whatever process has a hard time capturing the subtleties of every package upgrade. I suppose I’m in for a long slow discovery process of all the things that have been munged up by that bulk upgrade.
Spam and virus protection on my postfix server is one casualty of the upgrade. I finally got to the bottom of it and found that there are two things that I needed to change. I found that the new configuration of amavis has all the functionality commented out, so I had to turn it back on again in /etc/amavis/conf.d/15-content_filter_mode.
While fiddling with settings and defaults for amavis, I decided I wanted to see spam headers for all mail so I can see the score and get some confidence that I’m not losing mail to false positives. That configuration change turned out to be harder than I thought. The obvious changes to make were in /etc/amavis/conf.d/20-debian_defaults. But that didn’t work like I thought it would. Google lead me to this page: http://www.ijs.si/software/amavisd/#faq-spam where I learned that I need to make sure my local domains are defined if I want spam headers to be written to each inbound email. That is accomplished here in /etc/amavis/conf.d/50-user:
@local_domains_acl = ( "yourdomain.net" ); # $mydomain and its subdomains
Now I get the warm and fuzzy feeling from being able to look at the headers and know that the filters are on the job:
X-Virus-Scanned: Debian amavisd-new X-Spam-Status: No, score=4.085 tagged_above=-10000 required=6.31 tests=[ADVANCE_FEE_1=0, DCC_CHECK=1.37, FROM_HAS_ULINE_NUMS=0.217, RCVD_IN_BL_SPAMCOP_NET=1.332, SUBJ_ALL_CAPS=1.166] X-Spam-Score: 4.085 X-Spam-Level: ****
Nov 30, 2011
I noticed that my spam headers were not being inserted to inbound mail. I needed to make this change to /etc/amavis/conf.d/50-user:
$sa_tag_level_deflt = -90.0;
It was set to "0.0" which I thought was a magic token that applied the header to all mail. But it is a real number and a real threshold. So my test mail which had a spam score of -2, was not getting the header.
Then I had to restart amavis and my headers were back.
Create a copy of a spam message in spam.txt
mail email@example.com < spam.txt
If you are checking headers, this doesn't work because new headers are added and checked instead of the headers in the sample mail.