![]() ![]() Send an email to your mail system from outsite. # tail -f /var/log/spamassassin/spamd.logįri Feb 5 20:11:43 2016 info: prefork: child states: IIįri Feb 5 20:23:02 2016 info: spamd: server killed by SIGTERM, shutting downįri Feb 5 20:23:02 2016 info: logger: removing stderr methodįri Feb 5 20:23:03 2016 info: zoom: able to use 360/360 'body_0' compiled rules (100%)įri Feb 5 20:23:03 2016 info: spamd: server started on IO::Socket::INET6 :783, IO::Socket::INET6 :783 (running version 3.4.0)įri Feb 5 20:23:03 2016 info: spamd: server pid: 1406įri Feb 5 20:23:03 2016 info: spamd: server successfully spawned child process, pid 1407įri Feb 5 20:23:03 2016 info: spamd: server successfully spawned child process, pid 1408įri Feb 5 20:23:03 2016 info: prefork: child states: ISįri Feb 5 20:23:03 2016 info: prefork: child states: II 7. If at any point you need to debug something or view whats going in the background of spamassassin, feel free to check its look file. Restarting SpamAssassin Mail Filter Daemon: spamd. Restart Spamassassin - After configuring all parameters in the file, save the file and restart spamassassin. # Set the threshold at which a message is considered spam (default: 5.0)Ĭheck out the other options in the file and edit them as required. The default is 5.0, but now a days you might need a more strict score level. The minimum required score to mark the message as spam. Higher scores would indicate higher probability of the message being a spam. The above line would add the Spam score with the asterisk marks to indicate that the message looks like spam. # Add *****SPAM***** to the Subject header of spam e-mails Uncomment the rewrite_header line to modify the Subject lines of emails that are identified as spam. The configuration file is - /etc/spamassassin/local.cf $ nano /etc/spamassassin/local.cf Configure Spamassassin to Mark Spam MessagesĪfter configuring Postfix to use Spamassassin, its time to configure Spamassassin to modify emails according to spam checks. usr/sbin/sendmail -oi -f $Īfter adding the above lines to master.cf the next task is to restart postfix and make sure that it works fine. # cat /etc/postfix/master.cfĪdd the following at the end of the file spamassassin unix - n n - pipe The postfix configuration file master.cf needs to be edited to add spamassassin filter. Postfix needs to be configured to use spamassassin service to filter all incoming mails Configure Postfix to use Spamassassin as a filter Spamassassin starts a background service, so use the netstat command to ensure that spamassassin is running fine or not. :/etc/default# service spamassassin status Starting SpamAssassin Mail Filter Daemon: spamd. Start the Spamassassin daemon (spamd) # service spamassassin start ![]() # spamassassin's rules on a nightly basisĬRON=1 4. # Set to anything but 0 to enable the cron job to automatically update This will enable automatic updating of spamassassin rules as they are released. OPTIONS="-create-prefs -max-children 5 -helper-home-dir -username spamd \Īlso find the option called CRON at the bottom and change it to 1. # make sure -max-children is not set to anything higher than 5, # SpamAssassin uses a preforking model, so be careful! You need to Configure SpamassassinĮdit /etc/default/spamassassin so these options are set: # Change to one to enable spamd # chown spamd:spamd /var/log/spamassassin 3. # useradd -g spamd -s /bin/false -d /var/log/spamassassin spamd Setup a user account and group for spamd service # groupadd spamd The first thing would be to install spamassassin packages. In the next step, Dovecot analyses these headers to identify spam messages and puts them in a separate Spam folder, just like Gmail. Postfix is configured to talk to Spamassassin as a content_filter. Spam checking happens at the Postfix level. Spamassassin scans incoming emails to identify spam and if a mail is found to be potentially a spam mail then Spamassassin adds headers to that email to mark it a spam. The process had been outlined in a previous post here - Setup a mail server with Postfix and Dovecot on Ubuntu / Debian We assume that you have already setup Postfix and Dovecot on your server for handling incoming mails.Īnd that you are using Dovecot LMTP for delivering mails for user accounts. In this post we shall see how to setup spamassassin with postfix and dovecot for spam protection. It is quite effective and one of the most popular. And for this SpamAssassin is one of the best solutions available out there. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |