setup spamassassin

Posted on 2013-09-01
Medium Priority
Last Modified: 2013-09-01
hello there,
I have centos v6.4 and I have installed spamassassin by doing this "yum install spamassassin"

but for some reason everything seems to be running okay, postfix with dovecot and also spamassassin but no emails are being marked as spam while using test subject line "XJS*C4JDBQADN1.NSBN3*2IDNEN*GTUBE-STANDARD-ANTI-UBE-TEST-EMAIL*C.34X"

I also edited the conf file "/etc/mail/spamassassin/local.cf" to something like this
rewrite_header Subject [SPAM]
required_score           2.0
report_safe     0
use_bayes               1
use_bayes_rules         1
bayes_auto_learn        1
skip_rbl_checks         0
use_razor2              0
use_pyzor               0

Open in new window

protocols = imap pop3 lmtp

!include conf.d/*.conf

#log_path = /home/virtual/email/dovecot.log
#info_log_path = /home/virtual/email/dovecot-info.log

# Disable SSL for now.
ssl = no # v1.2+, for older versions use: ssl_disable = yes
disable_plaintext_auth = no

mail_location = maildir:/home/virtual/email/%u/
#mail_location = maildir:~/Maildir

# Authentication configuration:
auth_verbose = yes

auth_mechanisms = plain login
passdb {
  driver = passwd-file
  args = /home/virtual/email/passwd
userdb {
  driver = static
  args = uid=vmail gid=vmail home=/home/virtual/email/%u/

Open in new window

>postfix main.cf
## These settings differers from the default config ##
myhostname = domain.net
mail_owner = postfix
mydomain = domain.net
myorigin = $mydomain
inet_interfaces = all
inet_protocols = all
mydestination = localhost, mail.localdomain, localhost.localdomain, localdomain
unknown_local_recipient_reject_code = 550
in_flow_delay = 1s
home_mailbox = Maildir/
mail_spool_directory = /home/virtual/email
smtpd_banner = $myhostname ESMTP $mail_name ($mail_version)

## The following is added to the config ##
local_transport = virtual
virtual_mailbox_domains = /home/virtual/email/domains
virtual_mailbox_base = /home/virtual/email
virtual_mailbox_maps = hash:/home/virtual/email/virtual
#virtual_alias_domains = /home/virtual/email/domains
virtual_alias_maps = hash:/home/virtual/email/alias
virtual_minimum_uid = 100
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000

smtpd_helo_required = yes
disable_vrfy_command = yes
smtpd_recipient_restrictions =
        reject_invalid_hostname, reject_non_fqdn_hostname,
        reject_non_fqdn_sender, reject_non_fqdn_recipient,
        reject_unknown_sender_domain, reject_unknown_recipient_domain,
smtpd_data_restrictions = reject_unauth_pipelining, permit

Open in new window

Question by:XK8ER
1 Comment
LVL 13

Accepted Solution

Daniel Helgenberger earned 2000 total points
ID: 39457493

spamassassin works by 'piping' new mails through it. I think since you did not post your master.cf, you missed this step.

cat /etc/postfix/master.cf
smtp        inet   n           -           n          -             -              smtpd -o content_filter=spamassassin
spamassassin unix - n n - - pipe flags=R user=spamd argv=/usr/bin/spamc -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}

Open in new window

Here is another guide which mentions this step. The rest of the config looks ok at first glance.

Featured Post

A proven path to a career in data science

At Springboard, we know how to get you a job in data science. With Springboard’s Data Science Career Track, you’ll master data science  with a curriculum built by industry experts. You’ll work on real projects, and get 1-on-1 mentorship from a data scientist.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Often times it's very very easy to extend a volume on a Linux instance in AWS, but impossible to shrink it. I wanted to contribute to the experts-exchange community a way of providing a procedure that works on an AWS instance. It can also be used on…
Cron is one of the most popular and basic utilities found on Unix systems. Combined with other tools, cron makes it exceptionally easy to automate a broad range of tasks on your server.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question