Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Thread Tools Display Modes
Old 10th October 2007, 15:53
snowfly snowfly is offline
Join Date: Jul 2006
Posts: 93
Thanks: 0
Thanked 7 Times in 5 Posts
Default No Spam Headers after upgrading to Etch


On a spare server here, I recently upgrade it from Debian Sarge to Etch.

Got everything installed and workingfine, amavisd-new (2.4.2 (20060627)), postfix, courier, clamav, etc. (mostly like this guide here)

However, NO email seems to get X-Spam-* headers tags put in.

I've enabled spam/virus checking in "15-content_filter_mode".

Here's an extract from 20-debian-defaults:

$sa_spam_subject_tag = '[SPAM] ';
$sa_tag_level_deflt  = 0.0;  # add spam info headers if at, or above that level
$sa_tag2_level_deflt = 4.7; # add 'spam detected' headers at that level
$sa_kill_level_deflt = 20; # triggers spam evasive actions
$sa_dsn_cutoff_level = 50;   # spam level beyond which a DSN is not sent

When I check /var/log/mail.log , I see many entries of "Passed SPAMMY", with more hits then "4.7" (above), and some "Passed Clean".

For example, a Passed SPAMMY:
Oct 11 01:42:28 aero amavis[3630]: (03630-10) Passed SPAMMY, [xxx] [xxx] <xxx> -> <xxx>, Message-ID: <306301c80b3a$fde85690$c0a8010a@Julius>, mail_id: WFNzCI1D1zJI, Hits: 7.81, queued_as: C6DED803CB, 6439 ms
And an example of Passed CLEAN:
Oct 11 01:44:05 aero amavis[4072]: (04072-02) Passed CLEAN, [xxx] [xxx] <> -> <xxx>, Message-ID: <xxx>, mail_id: b19sMBlu4yMI, Hits: 1.477, queued_as: E9A3F803CB, 5039 ms
And example of Blocked SPAMMY:
Oct 11 01:43:56 aero amavis[4089]: (04089-01) Blocked SPAM, [xxx] [xxx] <xxx> -> <xxx>, quarantine: spam-jAS1viZaeLIW.gz, Message-ID: <xxx>, mail_id: jAS1viZaeLIW, Hits: 27.465, 6643 ms

So I can see that the "Blocked SPAMMY" goes to quarantine, which is fine, as our "$sa_kill_level_deflt = 20", and the Blocked SPAMMY entry had 27.465 Hits.

HOWEVER, the Passed SPAMMY entry had 7.81 Hits, BUT no X-Spam-* headers were inserted into the email.

As there were no headers, our maildrop doesn't see these tags, and doesn't shift the email to the users 'Spam' folder.

Can someone please help, as this has been driving me nuts for hours!!!

I may have missed something really simple, but I just can't see what it is.

ALSO, does amavisd-new on Debian ETCH ever use the SpamAssassin settings in /etc/spamassassin/* (e.g. local.cf) ??????

Reply With Quote
Sponsored Links
Old 10th October 2007, 16:14
snowfly snowfly is offline
Join Date: Jul 2006
Posts: 93
Thanks: 0
Thanked 7 Times in 5 Posts


After many more hours searching around in the middle of the night, I found out about "@local_domains_maps".

In the amavisd conf file 50-user, I added this:

@local_domains_maps = ( [".$mydomain"] );

And now X-Spam-* headers are added to my emails!!!

BUT... this is only for $mydomain, which is my own domain name.
I have over 100 other domain names on this mail server (a virtual system using mysql).
And none of the other emails for other domains are getting these X-Spam-* headers.

Does each and every domain need to be in "@local_domains_maps" ?????

Is there a way of using a MySQL lookup, for @local_domains_maps???
As I already have a "email_domains" table in MySQL, that posfix uses.

Reply With Quote
Old 11th October 2007, 01:13
snowfly snowfly is offline
Join Date: Jul 2006
Posts: 93
Thanks: 0
Thanked 7 Times in 5 Posts

Well I found a temporary solution for now, to put all domains into a hash file, then include.

I wrote a small per script to get list of domains from mysql:

use DBI;
$db_handle = DBI->connect("dbi:mysql:database=xxx;host=localhost:3306;user=xxx;password=xxx");
$statement = $db_handle->prepare("SELECT distinct domain FROM email_domains");
while ($row_ref = $statement->fetchrow_hashref())
print "$row_ref->{domain} OK\n";
I then can pipe this output to a file:
/etc/postfix/amavis-domains.pl > /etc/postfix/amavis-domains
And then run postmap:
postmap /etc/postfix/amavis-domains
Once the hash file is created, I can then call it from Amavis CONF (50-user):

@local_domains_maps = ( read_hash("/etc/postfix/amavis-domains") );

Now that seems to work, and now all 110 domains of our clients can have spam headers added.

Not a very good solution, as every time we add a new domain, we have to re-run the perl script, recreate hash file, and restart Amavis.

Oh well, suppose a cron job could do that.
Would be much nicer to talk to mysql directly.

Last edited by snowfly; 11th October 2007 at 01:15.
Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
In ISPconfig whitelist but still seen as spam edge Installation/Configuration 12 5th September 2007 01:30
How to kill spam when spamassassin marks it spam kpimichael Suggest HOWTO 15 6th August 2007 17:44
Forwarded spam mail not discared by antispam filter NETabuse General 7 26th February 2007 21:02
No Spam Score in Mail Headers mojosound General 5 4th December 2006 17:21
KErnel not showing all my memory Jorem Kernel Questions 8 13th April 2006 13:59

All times are GMT +2. The time now is 00:10.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.