Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
12-30-2010, 10:01 AM
|
#1
|
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
Rep: 
|
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?
|
|
|
12-30-2010, 12:15 PM
|
#2
|
LQ Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,222
|
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
|
|
|
12-30-2010, 12:33 PM
|
#3
|
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
Rep: 
|
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.
|
|
|
12-30-2010, 12:54 PM
|
#4
|
LQ Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,222
|
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
|
|
|
12-30-2010, 03:10 PM
|
#5
|
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
Rep: 
|
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.
|
|
|
12-30-2010, 05:28 PM
|
#6
|
LQ Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,222
|
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.
|
|
|
All times are GMT -5. The time now is 06:37 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|