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. |