× Installation and guides about a great free, plesk and cpanel alternative project

How to configure SpamAssassin on CentOS Web Panel

3 Χρόνια 3 Μήνες πριν - 2 Χρόνια 7 Μήνες πριν #94 από infogate
SpamAssassin is an Open Source anti-spam platform that attempts to filter spam by examining incoming emails in the CentOS Web Panel integrated with the Postfix Mail Server.

Although the SpamAssassin service is running we cannot see Spam filtering is working. Therefore this tutorial will walk you through how to configure SpamAssain on CentOS Web Panel.

There are Three configuration files that need to be edited in the SpamAssassin and Postfix Mail Server. Two configuration files in SpamAssain and one with the Postfix Mail Server.

Now Let’s see how we can configure these configuration files.


1st open /etc/mail/spamassassin/local.cf running the command below.
vim /etc/mail/spamassassin/local.cf
Then edit the configuration file with the settings below.
required_hits 5
report_safe 0
required_score 5
rewrite_header Subject [***SPAM***]

Here is the explanation of each setting of the above configuration. You can configure the level accordingly.

Required_hits: This determines the filter balance; the lower the score the more aggressive the filter. A setting of 5.0 is generally effective for a small organisation or a single user. Adjust the strictness score to your organization’s needs – a large medical organisation might want to let email items through that are trying to sell pharmaceuticals, so we might increase the level to a more modest 8.0.

Report_safe: This line determines whether to delete the item or to move the item to the inbox whilst appending a spam notice to the subject line. The levels for this line are set to either a 1 or 0. A score of 1 will delete the spam item, whereas a score of 0 will send the item to the inbox and rewrite the subject line. For this guide we shall use 0 as the score.

Required_score: This line sets the spam score for all email alllowed through to your domain, with levels of certainty set from 0 to 5. Zero would be classified as a legitimate email item, whereas 5 would be an definite ‘SPAM’ item. If we set the score to 3 we would catch a lot of unsolicited emails but quite a few false positives would still get through. For our example email server we will use the score of 5, but you can of course set this value according to your preference.

Rewrite_header: This line does exactly what it implies, that is, any message caught as ‘SPAM’ will have the subject line rewritten to include this header. For this guide we will use the default subject header of [***SPAM***].

2nd configuration file that we need to edit is /etc/sysconfig/spamassassin file. Edit/add the file with below config and save it.
SPAMDOPTIONS="-d -c -m5 -H --username nobody -s ${SAHOME}spamd.log"


The 3rd configuration file is with Postfix. Open the file
/etc/postfix/master.cf and edit/add the config below then save it.
smtp      inet  n       -       n       -       -       smtpd
  -o content_filter=smtp-amavis:
  -o receive_override_options=no_address_mappings
  -o content_filter=spamassassin

spamassassin      unix -      n      n      -      -      pipe
  user=nobody argv=/usr/bin/spamc -f -e
  /usr/sbin/sendmail -oi -f ${sender} ${recipient}

You have configured three required files and now restart SpamAssasin Anti-Spam service and Postfix Mail Server service using the commands below.

systemctl restart spamassassin.service

systemctl restart postfix.service


Login to your Gmail account. Compose an email with the subject line below and send it to an email address in the newly-configured mail server.

Follow us at You Tube --> www.youtube.com/@freespiritsgr
Follow us at Facebook --> www.facebook.com/freespirits.gr
If you found the above article useful we would appreciate it if you would rate us by clicking here --> g.page/r/CeAOj46Cf2epEB0/review
If you are interested in receiving a financial offer for website design click --> freespirits.gr/web-design
If you already have a website and want a free speed and SEO check click here --> fspirits.com/contact-us/
If you need affordable, fast hosting with, free of charge transfer from old host, click here --> freespirits.gr/hosting

Last edit: 2 Χρόνια 7 Μήνες πριν by infogate.

Παρακαλούμε Σύνδεση ή Δημιουργία λογαριασμού για να συμμετάσχετε στη συζήτηση.

Χρόνος δημιουργίας σελίδας: 0.087 δευτερόλεπτα
Powered by Kunena Φόρουμ