Your email should now be marked as spam and the subject should be re-written to indicate the same. Open your email client (in this case, we are using SquirrelMail) and check your inbox. and add include the content below on the email body to trigger the spam check: XJS*C4JDBQADN1.NSBN3*2IDNEN*GTUBE-STANDARD-ANTI-UBE-TEST-EMAIL*C.34X To check whether SpamAssassin is working, send an email to your server (e.g. $ sudo service spamassassin restart Step 6: Testing SpamAssassin Email Filter Then, restart both Postfix and SpamAssassin. Save and close the file by pressing CTRL+X, Y and Enter. Then, add the following information below it: -o content_filter=spamassassin Next, edit the Postfix master configuration file and instruct it to route emails to SpamAssassin for filtering: $ sudo nano /etc/postfix/master.cf Step 5: Configuring Postfix to Use SpamAssassin as an Email Filter The parameter bayes_auto_learn is set to 1 to enable the auto-learning mechanism. When set to 1, use_bayes instructs SpamAssassin to use the Bayes algorithm to classify emails as either ham or spam using a mathematical formula based on probability. The above parameters tell SpamAssassin to rewrite the subject of each email that surpasses the threshold score of 5.0. Make sure the below parameters and values are set on the file: rewrite_header Subject Using nano text editor: $ sudo nano /etc/spamassassin/local.cf We can now start adding rules to SpamAssassin. When you are done editing the file, press CTRL+X, Y and Enter to save the changes. To pick the latest updates from SpamAssassin, we are going to change the CRON value from 0 to 1: CRON =1 Then, locate the below line on the same file: OPTIONS="-create-prefs -max-children 5 -helper-home-dir"Ĭhange it to: OPTIONS="-create-prefs -max-children 5 -username spamd -helper-home-dir /home/spamd/ -s /home/spamd/spamd.log" Next, we are going to create a SAHOME variable and direct it to SpamAssassin home directory: SAHOME="/var/log/spamassassin/" To enable SpamAssassin on the system, find the parameter ENABLED and change its value from 0 to 1. To do this, open the file /etc/default/spamassassin using nano text editor: $ sudo nano /etc/default/spamassassin Next, we need to create a dedicated user for SpamAssassin: $ sudo adduser spamd -disabled-login Step 3: Configuring SpamAssassinĪfter installation, we are going to edit the SpamAssassin configuration file. Then we can install SpamAssassin with the command below: $ sudo apt-get install spamassassin spamc Step 2: Creating a User for SpamAssassin So before we install it, let's first update the package information index: $ sudo apt-get update SpamAssassin is available on the Ubuntu software repository. Step 1: Installing and Configuring SpamAssassin A non-root user that can perform sudo tasks on your server.See our guide for setting up an email server with Postfix, Dovecot and SquirrelMail on Ubuntu 16.04 Alibaba ECS An Alibaba Cloud ECS instance running Ubuntu 16.04 Linux distribution.This is a comprehensive guide that walks you through the process of securing your Ubuntu 16.04 Postfix email server with SpamAssassin. If you have already setup an email server with Postfix, SpamAssassin is a good tool for keeping your inbox free from unwanted emails from hackers and telemarketers. The highly configurable email filter utility is rule-based and to function effectively, it uses regular expressions to determine if an email contains Spam. These include: online blacklist database lookup, checksum based filters, Bayesian algorithm and third party programs. Luckily, SpamAssassin is one of the best Open-source tools for filtering and blocking spam.ĭesigned in Perl, Apache SpamAssassin uses different approaches to identify and block spam. Unsolicited emails are very annoying because they take up your disk space and waste your time every time you try to weed them out from your inbox. Tech Share is Alibaba Cloud's incentive program to encourage the sharing of technical knowledge and best practices within the cloud community. By Francis Ndungu, Alibaba Cloud Tech Share Author.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |