Discussion:
intergrade /etc/mail/spamassassin/local.cf in to amavisd-new
(too old to reply)
Indunil Jayasooriya
2016-03-03 09:35:49 UTC
Permalink
Hi list,


i have a rule to block mails based on body in /etc/mail/spamassassin/
local.cf

this is what i have written in /etc/mail/spamassassin/local.cf file

body LOCAL_SEX /\b(sex)\b/i
describe LOCAL_SEX Email contains the word sex.
score LOCAL_SEX 7.0


I sent a mail from my gmail account by adding word sex in my body as well
as in Subject .

But amavis does NOT block. It says Passed CLEAN


here are very important lines in amavisd,conf file


# @bypass_virus_checks_maps = (1); # controls running of anti-virus code
# @bypass_spam_checks_maps = (1); # controls running of anti-spam code
# $bypass_decode_parts = 1; # controls running of
decoders&dearchivers


# $MYHOME = '/var/amavis'; # a convenient default for other settings, -H
$TEMPBASE = "$MYHOME/tmp"; # working directory, needs to exist, -T
$ENV{TMPDIR} = $TEMPBASE; # environment variable TMPDIR, used by SA, etc.
$QUARANTINEDIR = "/var/virusmails";
# $quarantine_subdir_levels = 1; # add level of subdirs to disperse
quarantine

# $daemon_chroot_dir = $MYHOME; # chroot directory or undef, -R

$db_home = "$MYHOME/db"; # dir for bdb nanny/cache/snmp databases, -D
# $helpers_home = "$MYHOME/var"; # working directory for SpamAssassin, -S
# $lock_file = "$MYHOME/var/amavisd.lock"; # -L
# $pid_file = "$MYHOME/var/amavisd.pid"; # -P
#NOTE: create directories $MYHOME/tmp, $MYHOME/var, $MYHOME/db manually

$log_level = 0; # verbosity 0..5, -d
$log_recip_templ = undef; # disable by-recipient level-0 log entries
$DO_SYSLOG = 1; # log via syslogd (preferred)
$syslog_facility = 'mail'; # Syslog facility as a string
# e.g.: mail, daemon, user, local0, ... local7
$syslog_priority = 'debug'; # Syslog base (minimal) priority as a string,
# choose from: emerg, alert, crit, err, warning, notice, info,
debug

$enable_db = 1; # enable use of BerkeleyDB/libdb (SNMP and
nanny)
$enable_global_cache = 1; # enable use of libdb-based cache if
$enable_db=1
$nanny_details_level = 2; # nanny verbosity: 1: traditional, 2: detailed



$sa_tag_level_deflt = undef; # add spam info headers if at, or above that
level
$sa_tag2_level_deflt = 2.5; # add 'spam detected' headers at that level
$sa_kill_level_deflt = 2.5; # triggers spam evasive actions (e.g. blocks
mail)
$sa_dsn_cutoff_level = 10; # spam level beyond which a DSN is not sent
# $sa_quarantine_cutoff_level = 25; # spam level beyond which quarantine is
off
$penpals_bonus_score = 8; # (no effect without a @storage_sql_dsn
database)
$penpals_threshold_high = $sa_kill_level_deflt; # don't waste time on hi
spam


#$sa_spam_subject_tag = '***SPAM*** ';
$sa_spam_subject_tag = '{Spam?}';
$defang_virus = 1; # MIME-wrap passed infected mail
$defang_banned = 1; # MIME-wrap passed mail containing banned name
# for defanging bad headers only turn on certain minor contents categories:
$defang_by_ccat{+CC_BADH.",3"} = 1; # NUL or CR character in header
$defang_by_ccat{+CC_BADH.",5"} = 1; # header line longer than 998
characters
$defang_by_ccat{+CC_BADH.",6"} = 1; # header field syntax error


$notify_method = 'smtp:[127.0.0.1]:10025';
$forward_method = 'smtp:[127.0.0.1]:10025'; # set to undef with milter!

$final_virus_destiny = D_DISCARD;
$final_banned_destiny = D_BOUNCE;
$final_spam_destiny = D_DISCARD;
$final_bad_header_destiny = D_PASS;
$bad_header_quarantine_method = undef;


Where have I gone wrong?
--
cat /etc/motd

Thank you
Indunil Jayasooriya
http://www.theravadanet.net/
http://www.siyabas.lk/sinhala_how_to_install.html - Download Sinhala
Fonts
Stanislas Leveau
2016-03-03 11:40:03 UTC
Permalink
Hi

I create my rules in a file file.cf in /etc/mail/spamassassin/ directory and i reload amavis and it s ok normaly

Amavis add local_sex in message header?
What is score in message header?
Regards
Stan
Post by Indunil Jayasooriya
Hi list,
i have a rule to block mails based on body in /etc/mail/spamassassin/local.cf
this is what i have written in /etc/mail/spamassassin/local.cf file
body LOCAL_SEX /\b(sex)\b/i
describe LOCAL_SEX Email contains the word sex.
score LOCAL_SEX 7.0
I sent a mail from my gmail account by adding word sex in my body as well as in Subject .
But amavis does NOT block. It says Passed CLEAN
here are very important lines in amavisd,conf file
# $bypass_decode_parts = 1; # controls running of decoders&dearchivers
# $MYHOME = '/var/amavis'; # a convenient default for other settings, -H
$TEMPBASE = "$MYHOME/tmp"; # working directory, needs to exist, -T
$ENV{TMPDIR} = $TEMPBASE; # environment variable TMPDIR, used by SA, etc.
$QUARANTINEDIR = "/var/virusmails";
# $quarantine_subdir_levels = 1; # add level of subdirs to disperse quarantine
# $daemon_chroot_dir = $MYHOME; # chroot directory or undef, -R
$db_home = "$MYHOME/db"; # dir for bdb nanny/cache/snmp databases, -D
# $helpers_home = "$MYHOME/var"; # working directory for SpamAssassin, -S
# $lock_file = "$MYHOME/var/amavisd.lock"; # -L
# $pid_file = "$MYHOME/var/amavisd.pid"; # -P
#NOTE: create directories $MYHOME/tmp, $MYHOME/var, $MYHOME/db manually
$log_level = 0; # verbosity 0..5, -d
$log_recip_templ = undef; # disable by-recipient level-0 log entries
$DO_SYSLOG = 1; # log via syslogd (preferred)
$syslog_facility = 'mail'; # Syslog facility as a string
# e.g.: mail, daemon, user, local0, ... local7
$syslog_priority = 'debug'; # Syslog base (minimal) priority as a string,
# choose from: emerg, alert, crit, err, warning, notice, info, debug
$enable_db = 1; # enable use of BerkeleyDB/libdb (SNMP and nanny)
$enable_global_cache = 1; # enable use of libdb-based cache if $enable_db=1
$nanny_details_level = 2; # nanny verbosity: 1: traditional, 2: detailed
$sa_tag_level_deflt = undef; # add spam info headers if at, or above that level
$sa_tag2_level_deflt = 2.5; # add 'spam detected' headers at that level
$sa_kill_level_deflt = 2.5; # triggers spam evasive actions (e.g. blocks mail)
$sa_dsn_cutoff_level = 10; # spam level beyond which a DSN is not sent
# $sa_quarantine_cutoff_level = 25; # spam level beyond which quarantine is off
$penpals_threshold_high = $sa_kill_level_deflt; # don't waste time on hi spam
#$sa_spam_subject_tag = '***SPAM*** ';
$sa_spam_subject_tag = '{Spam?}';
$defang_virus = 1; # MIME-wrap passed infected mail
$defang_banned = 1; # MIME-wrap passed mail containing banned name
$defang_by_ccat{+CC_BADH.",3"} = 1; # NUL or CR character in header
$defang_by_ccat{+CC_BADH.",5"} = 1; # header line longer than 998 characters
$defang_by_ccat{+CC_BADH.",6"} = 1; # header field syntax error
$notify_method = 'smtp:[127.0.0.1]:10025';
$forward_method = 'smtp:[127.0.0.1]:10025'; # set to undef with milter!
$final_virus_destiny = D_DISCARD;
$final_banned_destiny = D_BOUNCE;
$final_spam_destiny = D_DISCARD;
$final_bad_header_destiny = D_PASS;
$bad_header_quarantine_method = undef;
Where have I gone wrong?
--
cat /etc/motd
Thank you
Indunil Jayasooriya
http://www.theravadanet.net/
http://www.siyabas.lk/sinhala_how_to_install.html - Download Sinhala Fonts
Indunil Jayasooriya
2016-03-04 04:16:55 UTC
Permalink
Post by Stanislas Leveau
I create my rules in a file file.cf in /etc/mail/spamassassin/ directory
and i reload amavis and it s ok normaly
I have CentOS 6 X running.
My location is different.

I need files in /var/lib/spamassassin/3.003001/updates_spamassassin_org
directory.

I created a file like this .


/var/lib/spamassassin/3.003001/updates_spamassassin_org/custom.cf
<http://custom.cf>
my /var/lib/spamassassin/3.003001/updates_spamassassin_org/custom.cf file
contains this.


#My custom rule

#body LOCAL_MYTHING /\b(mything)\b/i
#describe LOCAL_MYTHING Email contains the word mything.
#score LOCAL_MYTHING 9.0

body LOCAL_SEXTOYS /\b(sextoys)\b/i
describe LOCAL_SEXTOYS Email contains the word sextoys.
score LOCAL_SEXTOYS 9.0



and added below line

include updates_spamassassin_org/custom.cf

in /var/lib/spamassassin/3.003001/updates_spamassassin_org.cf file.



and restarted amavisd .

Now, When I type exactly the word sextoys in body. this will be BLOCKED by
amavisd.

pls see the log.

amavis[16752]: (16752-05) Blocked SPAM {DiscardedInbound,Quarantined}

it gives hits Hits: 6.552 .

I am pretty happy about it. Now the problem is it gets 6 PLUS score when
my rule says 9.0

i.e - score LOCAL_SEXTOYS 9.0

Any idea on this.
Post by Stanislas Leveau
Amavis add local_sex in message header?
When Can I find this in amavisd?


Hope to hear from you
--
cat /etc/motd

Thank you
Indunil Jayasooriya
http://www.theravadanet.net/
http://www.siyabas.lk/sinhala_how_to_install.html - Download Sinhala
Fonts
Stanislas Leveau
2016-03-04 09:11:54 UTC
Permalink
Because There other spamassassin rules reduce the final score.
Post by Stanislas Leveau
Post by Stanislas Leveau
I create my rules in a file file.cf in /etc/mail/spamassassin/ directory and i reload amavis and it s ok normaly
I have CentOS 6 X running.
My location is different.
I need files in /var/lib/spamassassin/3.003001/updates_spamassassin_org directory.
I created a file like this .
/var/lib/spamassassin/3.003001/updates_spamassassin_org/custom.cf
my /var/lib/spamassassin/3.003001/updates_spamassassin_org/custom.cf file contains this.
#My custom rule
#body LOCAL_MYTHING /\b(mything)\b/i
#describe LOCAL_MYTHING Email contains the word mything.
#score LOCAL_MYTHING 9.0
body LOCAL_SEXTOYS /\b(sextoys)\b/i
describe LOCAL_SEXTOYS Email contains the word sextoys.
score LOCAL_SEXTOYS 9.0
and added below line
include updates_spamassassin_org/custom.cf
in /var/lib/spamassassin/3.003001/updates_spamassassin_org.cf file.
and restarted amavisd .
Now, When I type exactly the word sextoys in body. this will be BLOCKED by amavisd.
pls see the log.
amavis[16752]: (16752-05) Blocked SPAM {DiscardedInbound,Quarantined}
it gives hits Hits: 6.552 .
I am pretty happy about it. Now the problem is it gets 6 PLUS score when my rule says 9.0
i.e - score LOCAL_SEXTOYS 9.0
Any idea on this.
Post by Stanislas Leveau
Amavis add local_sex in message header?
When Can I find this in amavisd?
Hope to hear from you
--
cat /etc/motd
Thank you
Indunil Jayasooriya
http://www.theravadanet.net/
http://www.siyabas.lk/sinhala_how_to_install.html - Download Sinhala Fonts
Loading...