LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-30-2010, 10:01 AM   #1
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,868
Blog Entries: 31

Rep: Reputation: 180Reputation: 180
how to enable spamassassin in amavis


I already have Postfix running email through amavis and back again for various checks. It seems amavis is checking a few things on its own (like validating headers). But there appears to be no effort to invoke spamassassin. I have added the following configuration to amavis and it seems to not be having any effect:

Code:
@spam_scanners = ( ['SpamAssassin', 'Amavis::SpamControl::SpamAssassin'], );
There is a daemon running as a result of starting the spamassassin service. But it is not being used.

Code:
14325 ?        Ss     0:00 /usr/sbin/spamd --create-prefs --max-children 5 --helper-home-dir -d --pidfile=/var/run/spamd.pid
14327 ?        S      0:00 spamd child
14328 ?        S      0:00 spamd child
Anyone know the magic incantations to make amavis use spamassassin?
 
Old 12-30-2010, 12:15 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,222
Blog Entries: 1

Rep: Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076
Quote:
I have added the following configuration to amavis and it seems to not be having any effect:

@spam_scanners = ( ['SpamAssassin', 'Amavis::SpamControl::SpamAssassin'], );
You don't need that. By default amavisd uses spamassassin to scan mail. All you have to do is to customize amavisd.conf.
Look for the $sa_* entries and modify them to your needs.
If you think there is some problem, you can run:
Code:
amavisd -u amavis debug
and watch he output for spamassassin.
There is also a nice howto about postfix configuration.

Regards
 
Old 12-30-2010, 12:33 PM   #3
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,868

Original Poster
Blog Entries: 31

Rep: Reputation: 180Reputation: 180
On Ubuntu and Debian, the amavis config files are separately numbered in directory /etc/amavis/conf.d (and presumably run in numeric order). Only /etc/amavis/conf.d/20-debian_defaults has anything with '$sa_' already:

Code:
meitner/root/x0 /etc/amavis/conf.d 289# fgrep '$sa_' *
20-debian_defaults:$sa_spam_subject_tag = '***SPAM*** ';
20-debian_defaults:$sa_tag_level_deflt  = 2.0;  # add spam info headers if at, or above that level
20-debian_defaults:$sa_tag2_level_deflt = 6.31; # add 'spam detected' headers at that level
20-debian_defaults:$sa_kill_level_deflt = 6.31; # triggers spam evasive actions
20-debian_defaults:$sa_dsn_cutoff_level = 10;   # spam level beyond which a DSN is not sent
20-debian_defaults:$sa_mail_body_size_limit = 200*1024; # don't waste time on SA if mail is larger
20-debian_defaults:$sa_local_tests_only = 0;    # only tests which do not require internet access?
meitner/root/x0 /etc/amavis/conf.d 290#
and these defaults seem to be fine to get started with. What changes would get spamassassin to get used?

The biggest problem seems to be a lack of "how to configure amavis" documentation.
 
Old 12-30-2010, 12:54 PM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,222
Blog Entries: 1

Rep: Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076
I'm not familiar with the amavisd configuration in debian, but searching a bit, it looks like you should uncomment the 2 lines about spam checks in /etc/amavis/conf.d/15-content_filter_mode

Cheers
 
Old 12-30-2010, 03:10 PM   #5
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,868

Original Poster
Blog Entries: 31

Rep: Reputation: 180Reputation: 180
I now have the following in the /etc/amavis/conf.d/75-local file (the last in the sequence):

Code:
use strict;

# Turn off the extra Received header:
# $allowed_added_header_fields{lc('Received')} = 0;

# Turn on spamassassin:
@spam_scanners = ( ['SpamAssassin', 'Amavis::SpamControl::SpamAssassin'], );

@bypass_spam_checks_maps = (
   \%bypass_spam_checks, \@bypass_spam_checks_acl, \$bypass_spam_checks_re);

$sa_spam_subject_tag = '***SPAM*** ';

$sa_tag_level_deflt = -999; # add spam info headers if at, or above that level
$sa_tag2_level_deflt = 1.0; # add ‘spam detected’ headers at that level
$sa_kill_level_deflt = 999; # triggers spam evasive actions

# Specify disposition of junk classes:
$final_virus_destiny      = D_PASS;
$final_banned_destiny     = D_DISCARD;
$final_spam_destiny       = D_PASS;
$final_bad_header_destiny = D_PASS;

#------------ Do not modify anything below this line -------------
1;  # insure a defined return
According to a document I just recently found, the setting for $sa_spam_subject_tag would modify the subject. But that is not happening. Yet I am seeing many log messages beginning with "Dec 30 16:08:19 meitner amavis[26361]: (26361-05) Passed SPAMMY," while nothing in the email exists for it.
 
Old 12-30-2010, 05:28 PM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,222
Blog Entries: 1

Rep: Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076Reputation: 2076
As I've already told you I don't use debian, so I cannot tell how the amavisd config files work, but I guess settings in /etc/amavis/conf.d/75-local overwrite those from previous files.
You should use normal numbers for the various spam levels and if you want to check spam settings, use this sample spam mail.
Also try to comment out:
Quote:
@spam_scanners = ( ['SpamAssassin', 'Amavis::SpamControl::SpamAssassin'], );
If it still doesn't work, run amavisd in debug mode the see what happens.
Note also that you should stop the daemon spamd from running and let amavisd use spamassassin to filter messages.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
postfix (spamassassin+clamav+ amavis) alphatest Linux - Software 2 12-21-2010 08:17 AM
Amavis, SpamAssassin and Shared Bayes Files juergen Linux - Server 0 09-25-2007 08:34 AM
How to restart spamassassin in an Amavis-environment ? Marc Thoelen Linux - Server 6 07-20-2007 08:46 AM
How to restart spamassassin in an Amavis-environment ? Marc Thoelen Linux - Enterprise 1 07-13-2007 04:21 AM
Amavis Spamassassin Config, Where to change settings? schoeppchen Linux - General 1 08-15-2005 10:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration