<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="mn">
		<id>https://wiki.dusal.net/index.php?action=history&amp;feed=atom&amp;title=Hardening_postfix%2C_spamassassin_deliverability</id>
		<title>Hardening postfix, spamassassin deliverability - Түүх</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.dusal.net/index.php?action=history&amp;feed=atom&amp;title=Hardening_postfix%2C_spamassassin_deliverability"/>
		<link rel="alternate" type="text/html" href="https://wiki.dusal.net/index.php?title=Hardening_postfix,_spamassassin_deliverability&amp;action=history"/>
		<updated>2026-05-04T12:14:25Z</updated>
		<subtitle>Вики дэх энэ хуудасны засварын түүх</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>https://wiki.dusal.net/index.php?title=Hardening_postfix,_spamassassin_deliverability&amp;diff=386&amp;oldid=prev</id>
		<title>Almas: Хуудас үүсгэв: &quot; Install Spamassassin with Postfix and Dovecot on Ubuntu/Debian server By Silver Moon | July 25, 2018 2 Comments Spam free email with SpamAssassin  If you are running...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.dusal.net/index.php?title=Hardening_postfix,_spamassassin_deliverability&amp;diff=386&amp;oldid=prev"/>
				<updated>2019-09-20T07:38:47Z</updated>
		
		<summary type="html">&lt;p&gt;Хуудас үүсгэв: &amp;quot; Install Spamassassin with Postfix and Dovecot on Ubuntu/Debian server By Silver Moon | July 25, 2018 2 Comments Spam free email with SpamAssassin  If you are running...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Шинэ хуудас&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
Install Spamassassin with Postfix and Dovecot on Ubuntu/Debian server&lt;br /&gt;
By Silver Moon | July 25, 2018&lt;br /&gt;
2 Comments&lt;br /&gt;
Spam free email with SpamAssassin&lt;br /&gt;
&lt;br /&gt;
If you are running your own mailbox on a server using Postfix and Dovecot then it is imperative to install an anti-spam software to protect your mailbox from getting bombed with incoming spam mails.&lt;br /&gt;
&lt;br /&gt;
And for this SpamAssassin is one of the best solutions available out there. It is quite effective and one of the most popular.&lt;br /&gt;
&lt;br /&gt;
In this post we shall see how to setup spamassassin with postfix and dovecot for spam protection. We assume that you have already setup Postfix and Dovecot on your server for handling incoming mails. And that you are using Dovecot LMTP for delivering mails for user accounts. The process had been outlined in a previous post here -&lt;br /&gt;
Setup a mail server with Postfix and Dovecot on Ubuntu / Debian&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Spam checking happens at the Postfix level. Postfix is configured to talk to Spamassassin as a content_filter.&lt;br /&gt;
&lt;br /&gt;
In the next step, Dovecot analyses these headers to identify spam messages and puts them in a separate Spam folder, just like Gmail.&lt;br /&gt;
Install Spamassassin&lt;br /&gt;
&lt;br /&gt;
The first thing would be to install spamassassin packages.&lt;br /&gt;
&lt;br /&gt;
$ apt-get install spamassassin spamc&lt;br /&gt;
&lt;br /&gt;
Setup a user account and group for spamd service&lt;br /&gt;
&lt;br /&gt;
# groupadd spamd&lt;br /&gt;
# useradd -g spamd -s /bin/false -d /var/log/spamassassin spamd&lt;br /&gt;
# mkdir /var/log/spamassassin&lt;br /&gt;
# chown spamd:spamd /var/log/spamassassin&lt;br /&gt;
&lt;br /&gt;
Configure Spamassassin&lt;br /&gt;
&lt;br /&gt;
Edit /etc/default/spamassassin so these options are set:&lt;br /&gt;
&lt;br /&gt;
# Change to one to enable spamd&lt;br /&gt;
ENABLED=1&lt;br /&gt;
&lt;br /&gt;
SAHOME=&amp;quot;/var/log/spamassassin/&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Options&lt;br /&gt;
# See man spamd for possible options. The -d option is automatically added.&lt;br /&gt;
&lt;br /&gt;
# SpamAssassin uses a preforking model, so be careful! You need to&lt;br /&gt;
# make sure --max-children is not set to anything higher than 5,&lt;br /&gt;
# unless you know what you're doing.&lt;br /&gt;
&lt;br /&gt;
OPTIONS=&amp;quot;--create-prefs --max-children 5 --helper-home-dir --username spamd \&lt;br /&gt;
-H ${SAHOME} -s ${SAHOME}spamd.log&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Also find the option called CRON at the bottom and change it to 1. This will enable automatic updating of spamassassin rules as they are released.&lt;br /&gt;
&lt;br /&gt;
# Cronjob&lt;br /&gt;
# Set to anything but 0 to enable the cron job to automatically update&lt;br /&gt;
# spamassassin's rules on a nightly basis&lt;br /&gt;
CRON=1&lt;br /&gt;
&lt;br /&gt;
Start the Spamassassin daemon (spamd)&lt;br /&gt;
&lt;br /&gt;
# service spamassassin start&lt;br /&gt;
Starting SpamAssassin Mail Filter Daemon: spamd.&lt;br /&gt;
root@localhost:/etc/default# &lt;br /&gt;
root@localhost:/etc/default# service spamassassin status&lt;br /&gt;
 * spamd is running&lt;br /&gt;
root@localhost:/etc/default#&lt;br /&gt;
&lt;br /&gt;
Spamassassin starts a background service, so use the netstat command to ensure that spamassassin is running fine or not.&lt;br /&gt;
&lt;br /&gt;
# netstat -nlp4 | grep spam&lt;br /&gt;
tcp        0      0 127.0.0.1:783           0.0.0.0:*               LISTEN      1123/spamd.pid&lt;br /&gt;
&lt;br /&gt;
Configure Postfix to use Spamassassin as a filter&lt;br /&gt;
&lt;br /&gt;
Postfix needs to be configured to use spamassassin service to filter all incoming mails&lt;br /&gt;
The postfix configuration file master.cf needs to be edited to add spamassassin filter. Open the file.&lt;br /&gt;
&lt;br /&gt;
# cat /etc/postfix/master.cf&lt;br /&gt;
&lt;br /&gt;
Add the following at the end of the file&lt;br /&gt;
&lt;br /&gt;
spamassassin unix -     n       n       -       -       pipe&lt;br /&gt;
        user=spamd argv=/usr/bin/spamc -f -e  &lt;br /&gt;
        /usr/sbin/sendmail -oi -f ${sender} ${recipient}&lt;br /&gt;
&lt;br /&gt;
After adding the above lines to master.cf the next task is to restart postfix and make sure that it works fine.&lt;br /&gt;
&lt;br /&gt;
$ service postfix restart&lt;br /&gt;
&lt;br /&gt;
Configure Spamassassin&lt;br /&gt;
&lt;br /&gt;
After configuring Postfix to use Spamassassin, its time to configure Spamassassin to modify emails according to spam checks. The configuration file is - /etc/spamassassin/local.cf&lt;br /&gt;
&lt;br /&gt;
$ nano /etc/spamassassin/local.cf&lt;br /&gt;
&lt;br /&gt;
Uncomment the rewrite_header line to modify the Subject lines of emails that are identified as spam.&lt;br /&gt;
&lt;br /&gt;
#   Add *****SPAM***** to the Subject header of spam e-mails&lt;br /&gt;
#&lt;br /&gt;
# rewrite_header Subject *****SPAM*****&lt;br /&gt;
&lt;br /&gt;
rewrite_header Subject [***** SPAM _SCORE_ *****]&lt;br /&gt;
&lt;br /&gt;
The above line would add the Spam score with the asterisk marks to indicate that the message looks like spam. Higher scores would indicate higher probability of the message being a spam.&lt;br /&gt;
&lt;br /&gt;
Spam Score&lt;br /&gt;
&lt;br /&gt;
The minimum required score to mark the message as spam. The default is 5.0, but now a days you might need a more strict score level. So 4.0 works good.&lt;br /&gt;
&lt;br /&gt;
#   Set the threshold at which a message is considered spam (default: 5.0)&lt;br /&gt;
#&lt;br /&gt;
required_score 4.0&lt;br /&gt;
&lt;br /&gt;
Check out the other options in the file and edit them as required.&lt;br /&gt;
&lt;br /&gt;
Restart Spamassassin - After configuring all parameters in the file, save the file and restart spamassassin.&lt;br /&gt;
&lt;br /&gt;
# service spamassassin restart&lt;br /&gt;
Restarting SpamAssassin Mail Filter Daemon: spamd.&lt;br /&gt;
&lt;br /&gt;
Checking spamassassin log&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
# tail -f /var/log/spamassassin/spamd.log &lt;br /&gt;
Fri Feb  5 20:11:43 2016 [1123] info: prefork: child states: II&lt;br /&gt;
Fri Feb  5 20:23:02 2016 [1123] info: spamd: server killed by SIGTERM, shutting down&lt;br /&gt;
Fri Feb  5 20:23:02 2016 [1404] info: logger: removing stderr method&lt;br /&gt;
Fri Feb  5 20:23:03 2016 [1406] info: zoom: able to use 360/360 'body_0' compiled rules (100%)&lt;br /&gt;
Fri Feb  5 20:23:03 2016 [1406] info: spamd: server started on IO::Socket::INET6 [127.0.0.1]:783, IO::Socket::INET6 [::1]:783 (running version 3.4.0)&lt;br /&gt;
Fri Feb  5 20:23:03 2016 [1406] info: spamd: server pid: 1406&lt;br /&gt;
Fri Feb  5 20:23:03 2016 [1406] info: spamd: server successfully spawned child process, pid 1407&lt;br /&gt;
Fri Feb  5 20:23:03 2016 [1406] info: spamd: server successfully spawned child process, pid 1408&lt;br /&gt;
Fri Feb  5 20:23:03 2016 [1406] info: prefork: child states: IS&lt;br /&gt;
Fri Feb  5 20:23:03 2016 [1406] info: prefork: child states: II&lt;br /&gt;
&lt;br /&gt;
Test Spam&lt;br /&gt;
&lt;br /&gt;
Send an email to your mail system from outsite. Include the following piece of text in the email's body&lt;br /&gt;
&lt;br /&gt;
XJS*C4JDBQADN1.NSBN3*2IDNEN*GTUBE-STANDARD-ANTI-UBE-TEST-EMAIL*C.34X&lt;br /&gt;
&lt;br /&gt;
Its called GTUBE - Generic Test for Unsolicited Bulk Email. Its a simple way to test if your mail server is using spamassassin to filter mails or not.&lt;br /&gt;
&lt;br /&gt;
Learn more about it here -&lt;br /&gt;
http://spamassassin.apache.org/gtube/&lt;br /&gt;
SpamAssassin adds headers to all emails with spam scores &amp;gt; 0&lt;br /&gt;
&lt;br /&gt;
Mail with spam score 12.9 This is considered spam according to our configuration of minimum score of 3&lt;br /&gt;
&lt;br /&gt;
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on localhost&lt;br /&gt;
X-Spam-Flag: YES&lt;br /&gt;
X-Spam-Level: ************&lt;br /&gt;
X-Spam-Status: Yes, score=12.9 required=3.0 tests=FROM_LOCAL_NOVOWEL,&lt;br /&gt;
	HTML_FONT_LOW_CONTRAST,HTML_FONT_SIZE_LARGE,HTML_MESSAGE,HTML_OBFUSCATE_05_10,&lt;br /&gt;
	MIME_HTML_ONLY,MISSING_MID,RCVD_IN_BL_SPAMCOP_NET,RCVD_IN_BRBL_LASTEXT,&lt;br /&gt;
	RCVD_IN_PBL,RCVD_IN_PSBL,RCVD_IN_XBL,RDNS_NONE autolearn=no&lt;br /&gt;
	autolearn_force=no version=3.4.0&lt;br /&gt;
&lt;br /&gt;
Spam Score 1.7, Not considered spam&lt;br /&gt;
&lt;br /&gt;
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on localhost&lt;br /&gt;
X-Spam-Level: *&lt;br /&gt;
X-Spam-Status: No, score=1.7 required=3.0 tests=DEAR_SOMETHING,FREEMAIL_FROM,&lt;br /&gt;
	HTML_MESSAGE,RCVD_IN_MSPIKE_H2,URIBL_BLOCKED autolearn=no autolearn_force=no&lt;br /&gt;
	version=3.4.0&lt;br /&gt;
&lt;br /&gt;
These headers shall be used to send emails into a separate Spam folder via Dovecot LMTP transport.&lt;br /&gt;
Configure Dovecot with separate Spam folder&lt;br /&gt;
&lt;br /&gt;
Dovecot is the mail reading and managing system, POP3 and IMAP server. It is Dovecot that organises mails into separate folders depending on criterias.&lt;br /&gt;
&lt;br /&gt;
Dovecot can be configured to read mail headers and move spam mails to a separate folder called Spam. Much like you see with free mail services like Gmail and Outlook.&lt;br /&gt;
Install and Configure Sieve Plugin&lt;br /&gt;
&lt;br /&gt;
Dovecot needs the Sieve interpreter plugin to use Sieve to read mails. Install the Sieve packages&lt;br /&gt;
&lt;br /&gt;
# apt-get install dovecot-sieve dovecot-managesieved&lt;br /&gt;
&lt;br /&gt;
Edit&lt;br /&gt;
/etc/dovecot/conf.d/20-lmtp.conf&lt;br /&gt;
&lt;br /&gt;
Configure dovecot to enable the sieve plugin&lt;br /&gt;
&lt;br /&gt;
protocol lmtp {&lt;br /&gt;
  # Space separated list of plugins to load (default is global mail_plugins).&lt;br /&gt;
  mail_plugins = $mail_plugins sieve&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Finally its time to restart dovecot&lt;br /&gt;
&lt;br /&gt;
# service dovecot restart&lt;br /&gt;
&lt;br /&gt;
Now check if the sieve server is running on port 4190. Use the netstat command. The service will be named as dovecot.&lt;br /&gt;
&lt;br /&gt;
# netstat -nltp | grep 4190&lt;br /&gt;
tcp        0      0 0.0.0.0:4190            0.0.0.0:*               LISTEN      9843/dovecot    &lt;br /&gt;
tcp6       0      0 :::4190                 :::*                    LISTEN      9843/dovecot&lt;br /&gt;
&lt;br /&gt;
Setup Sieve filtering&lt;br /&gt;
&lt;br /&gt;
To learn more about sieve filters, check out the following page - http://wiki2.dovecot.org/Pigeonhole/Sieve/Examples&lt;br /&gt;
&lt;br /&gt;
# mkdir /var/lib/dovecot/sieve/&lt;br /&gt;
&lt;br /&gt;
Create a file called default.sieve and fill it with the following rule sets&lt;br /&gt;
&lt;br /&gt;
require [&amp;quot;fileinto&amp;quot;, &amp;quot;mailbox&amp;quot;];&lt;br /&gt;
&lt;br /&gt;
if header :contains &amp;quot;X-Spam-Flag&amp;quot; &amp;quot;YES&amp;quot; {&lt;br /&gt;
        fileinto :create &amp;quot;Spam&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Now compile the .sieve script file using the sievec command.&lt;br /&gt;
&lt;br /&gt;
# sievec default.sieve&lt;br /&gt;
&lt;br /&gt;
If you have multiple .sieve files in the directory, then you can compile all of them in one go like this -&lt;br /&gt;
&lt;br /&gt;
# sievec sieve/&lt;br /&gt;
&lt;br /&gt;
Now change the ownership of the sieve files to the dovecot specific user so that dovecot can read them. In this case the username is vmail.&lt;br /&gt;
&lt;br /&gt;
/var/lib/dovecot# chown -R vmail:vmail sieve/*&lt;br /&gt;
&lt;br /&gt;
Restart Dovecot again.&lt;br /&gt;
&lt;br /&gt;
# service dovecot restart&lt;br /&gt;
&lt;br /&gt;
Check dovecot logs&lt;br /&gt;
&lt;br /&gt;
Dovecot log files shall help you diagnose any problems that might come along the way.&lt;br /&gt;
&lt;br /&gt;
Find the location of dovecot log files with the following command&lt;br /&gt;
&lt;br /&gt;
# doveadm  log find&lt;br /&gt;
Debug: /var/log/dovecot.log&lt;br /&gt;
Info: /var/log/dovecot.log&lt;br /&gt;
Warning: /var/log/dovecot.log&lt;br /&gt;
Error: /var/log/dovecot.log&lt;br /&gt;
Fatal: /var/log/dovecot.log&lt;br /&gt;
&lt;br /&gt;
Then open the file using the tail command&lt;br /&gt;
&lt;br /&gt;
# tail -f /var/log/dovecot.log&lt;br /&gt;
&lt;br /&gt;
Feb 06 11:17:16 imap-login: Info: Login: user=&amp;lt;admin@binarytides.com&amp;gt;, method=PLAIN, rip=122.163.23.27, lip=173.255.230.5, mpid=10370, TLS, session=&amp;lt;RfgSgBMr1QB6oxcb&amp;gt;&lt;br /&gt;
Feb 06 11:17:37 lmtp(10379): Info: Connect from local&lt;br /&gt;
Feb 06 11:17:37 lmtp(10379, admin@binarytides.com): Error: uMMvHPmItVaLKAAA0J78UA: sieve: main script: failed to stat sieve script: stat(/var/lib/dovecot/sieve/default.sieve) failed: Permission denied (euid=5000(vmail) egid=5000(vmail) missing +x perm: /var/lib/dovecot, dir owned by 0:0 mode=0750)&lt;br /&gt;
Feb 06 11:17:37 lmtp(10379, admin@binarytides.com): Error: uMMvHPmItVaLKAAA0J78UA: sieve: failed to access default user script /var/lib/dovecot/sieve/default.sieve&lt;br /&gt;
Feb 06 11:17:37 lmtp(10379, admin@binarytides.com): Info: uMMvHPmItVaLKAAA0J78UA: msgid=&amp;lt;CAKfwS=YH3TJ2XCxE0RzQqisBO54-QmYe9QJWAQd8-i207JN_1Q@mail.gmail.com&amp;gt;: saved mail to INBOX&lt;br /&gt;
Feb 06 11:17:37 lmtp(10379): Info: Disconnect from local: Successful quit&lt;br /&gt;
Feb 06 11:18:31 lmtp(10379): Info: Connect from local&lt;br /&gt;
Feb 06 11:18:31 lmtp(10379, admin@binarytides.com): Error: vMMvHPmItVaLKAAA0J78UA: sieve: msgid=&amp;lt;CAKfwS=YLa+1DYyX3HiQ7qQN=4PkmzCfX_1vB28A1gHT9xB4xjA@mail.gmail.com&amp;gt;: failed to store into mailbox 'Spam': Mailbox doesn't exist: Spam&lt;br /&gt;
Feb 06 11:18:31 lmtp(10379, admin@binarytides.com): Info: vMMvHPmItVaLKAAA0J78UA: sieve: msgid=&amp;lt;CAKfwS=YLa+1DYyX3HiQ7qQN=4PkmzCfX_1vB28A1gHT9xB4xjA@mail.gmail.com&amp;gt;: stored mail into mailbox 'INBOX'&lt;br /&gt;
Feb 06 11:18:31 lmtp(10379, admin@binarytides.com): Error: vMMvHPmItVaLKAAA0J78UA: sieve: execution of script /var/lib/dovecot/sieve/default.sieve;name=main script failed, but implicit keep was successful&lt;br /&gt;
Feb 06 11:18:31 lmtp(10379): Info: Disconnect from local: Successful quit&lt;br /&gt;
Feb 06 11:26:27 lmtp(10479): Info: Connect from local&lt;br /&gt;
Feb 06 11:26:27 lmtp(10479, admin@binarytides.com): Info: 3h4eBwuLtVbvKAAA0J78UA: sieve: msgid=&amp;lt;CAKfwS=b6cEU-WwhOkxaBjZcxb61dAZomyC4x98T4drLVFgeTxw@mail.gmail.com&amp;gt;: stored mail into mailbox 'Spam'&lt;br /&gt;
Feb 06 11:26:27 lmtp(10479): Info: Disconnect from local: Successful quit&lt;br /&gt;
Feb 06 11:26:57 imap-login: Info: Login: user=&amp;lt;admin@binarytides.com&amp;gt;, method=PLAIN, rip=122.163.23.27, lip=173.255.230.5, mpid=10483, TLS, session=&amp;lt;OreuohMrXgB6oxcb&amp;gt;&lt;br /&gt;
Feb 06 11:26:58 imap-login: Info: Login: user=&amp;lt;admin@binarytides.com&amp;gt;, method=PLAIN, rip=122.163.23.27, lip=173.255.230.5, mpid=10484, TLS, session=&amp;lt;xr6+ohMrXwB6oxcb&amp;gt;&lt;br /&gt;
Feb 06 11:28:30 imap-login: Info: Login: user=&amp;lt;admin@binarytides.com&amp;gt;, method=PLAIN, rip=122.163.23.27, lip=173.255.230.5, mpid=10499, TLS, session=&amp;lt;n7Q2qBMrCwB6oxcb&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change the permissions of the dovecot directory&lt;br /&gt;
&lt;br /&gt;
/var/lib/dovecot# chmod a+x .&lt;br /&gt;
&lt;br /&gt;
Boost Spamassassin spam filtering with Pyzor&lt;br /&gt;
&lt;br /&gt;
Pyzor will act just like other rules.&lt;br /&gt;
https://wiki.apache.org/spamassassin/Rules/PYZOR_CHECK&lt;br /&gt;
&lt;br /&gt;
It will add an extra spam score of about 1.985 according to the tests table found at - http://spamassassin.apache.org/tests_3_3_x.html&lt;br /&gt;
&lt;br /&gt;
# sudo apt-get install pyzor&lt;br /&gt;
&lt;br /&gt;
Discover the Pyzor servers&lt;br /&gt;
&lt;br /&gt;
# pyzor --homedir /etc/mail/spamassassin/pyzor discover&lt;br /&gt;
&lt;br /&gt;
Make the servers file readable by all&lt;br /&gt;
&lt;br /&gt;
/etc/spamassassin/pyzor# chmod a+r servers&lt;br /&gt;
&lt;br /&gt;
Run a check -&lt;br /&gt;
&lt;br /&gt;
# echo &amp;quot;test&amp;quot; | spamassassin -D pyzor 2&amp;gt;&amp;amp;1 | less&lt;br /&gt;
&lt;br /&gt;
You should see some output like this&lt;br /&gt;
&lt;br /&gt;
Feb  9 16:24:58.824 [23979] dbg: pyzor: network tests on, attempting Pyzor&lt;br /&gt;
Feb  9 16:24:59.787 [23979] dbg: pyzor: pyzor is available: /usr/bin/pyzor&lt;br /&gt;
Feb  9 16:24:59.788 [23979] dbg: pyzor: opening pipe: /usr/bin/pyzor check &amp;lt; /tmp/.spamassassin23979z26KDDtmp&lt;br /&gt;
Feb  9 16:24:59.841 [23979] dbg: pyzor: [23981] finished: exit 1&lt;br /&gt;
Feb  9 16:24:59.842 [23979] dbg: pyzor: check failed: no response&lt;br /&gt;
&lt;br /&gt;
Add the following lines to the end of /etc/spamassassin/local.cf&lt;br /&gt;
&lt;br /&gt;
pyzor_options --homedir /etc/mail/spamassassin/pyzor&lt;br /&gt;
&lt;br /&gt;
And restart spamassassin daemon&lt;br /&gt;
&lt;br /&gt;
# service spamassassin restart&lt;br /&gt;
&lt;br /&gt;
Install Razor&lt;br /&gt;
&lt;br /&gt;
sudo apt-get install razor&lt;br /&gt;
&lt;br /&gt;
/etc/spamassassin# mkdir razor&lt;br /&gt;
&lt;br /&gt;
Now run the following commands to register with the razor distributed network.&lt;br /&gt;
&lt;br /&gt;
# razor-admin -home=/etc/spamassassin/razor -register&lt;br /&gt;
Register successful.  Identity stored in /etc/mail/spamassassin/razor/identity-rudkVFCIxs&lt;br /&gt;
# razor-admin -home=/etc/spamassassin/razor -create&lt;br /&gt;
# razor-admin -home=/etc/spamassassin/razor -discover&lt;br /&gt;
&lt;br /&gt;
Add the following line at the end of /etc/spamassassin/local.cf file&lt;br /&gt;
&lt;br /&gt;
razor_config /etc/spamassassin/razor/razor-agent.conf&lt;br /&gt;
&lt;br /&gt;
Finally restart spamassassin&lt;br /&gt;
&lt;br /&gt;
check razor working with this command&lt;br /&gt;
&lt;br /&gt;
# echo &amp;quot;test&amp;quot; | spamassassin -D razor2 2&amp;gt;&amp;amp;1 | less&lt;br /&gt;
&lt;br /&gt;
something like this should show up&lt;br /&gt;
&lt;br /&gt;
Feb  9 17:11:34.701 [26028] dbg: razor2: razor2 is available, version 2.84&lt;br /&gt;
 Razor-Log: read_file: 15 items read from /etc/mail/spamassassin/razor/razor-agent.conf&lt;br /&gt;
&lt;br /&gt;
Custom scores for higher scores&lt;br /&gt;
&lt;br /&gt;
This is a little bit advanced way to increase the accuracy of spamassassin to catch spam better. It involves increasing the score levels for certain spam-tests inside of spamassassin. These are the spam tests that are known to have a very high level of accuracy in detecting spam.&lt;br /&gt;
&lt;br /&gt;
So if some of these high accuracy tests indicate a mail as spam, we should focus more on it.&lt;br /&gt;
http://toao.net/566-improving-spamassassin-accuracy-with-statistics&lt;br /&gt;
References and Resources&lt;br /&gt;
&lt;br /&gt;
Simple Spamassassin setup with Postfix and Dovecot on Ubuntu Breezy&lt;br /&gt;
http://www.townx.org/index.php?q=blog/elliot/simple_spamassassin_setup_with_postfix_and_dovecot_on_ubuntu_breezy&lt;br /&gt;
&lt;br /&gt;
How To Install and Setup Spamassassin on Ubuntu 12.04&lt;br /&gt;
https://www.digitalocean.com/community/tutorials/how-to-install-and-setup-spamassassin-on-ubuntu-12-04&lt;br /&gt;
&lt;br /&gt;
Instructions on installing Pyzor and Razor with Spamassassin&lt;br /&gt;
https://kura.io/2011/09/22/spamassassin-razor-pyzor/&lt;br /&gt;
&lt;br /&gt;
Setting up Sieve filtering with Dovecot&lt;br /&gt;
https://easyengine.io/tutorials/mail/server/sieve-filtering/&lt;br /&gt;
&lt;br /&gt;
Spamassassin Tips : Ultimate Setup Guide&lt;br /&gt;
http://www.spamtips.org/p/ultimate-setup-guide.html&lt;br /&gt;
&lt;br /&gt;
How to Improve SpamAssassin Accuracy&lt;br /&gt;
https://wiki.apache.org/spamassassin/ImproveAccuracy&lt;br /&gt;
&lt;br /&gt;
On the effects of lowering your SpamAssassin threshold&lt;br /&gt;
http://taint.org/2008/02/29/155648a.html&lt;br /&gt;
&lt;br /&gt;
Improving SpamAssassin accuracy on cPanel (or any other) mail servers - with statistics&lt;br /&gt;
http://toao.net/566-improving-spamassassin-accuracy-with-statistics&lt;br /&gt;
&lt;br /&gt;
This post outlines simple hacks that you can use to change score levels for some of the spamassassin tests thereby improving spam filtering.&lt;br /&gt;
&lt;br /&gt;
Advanced Tips for Using SpamAssassin&lt;br /&gt;
https://www.andrewferrier.com/oldpages/spamassassin_tips.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Source: ===&lt;br /&gt;
&lt;br /&gt;
* https://www.binarytides.com/install-spamassassin-with-postfix-dovecot/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Ангилал:Сисадмин]]&lt;br /&gt;
[[Ангилал:Linux]]&lt;/div&gt;</summary>
		<author><name>Almas</name></author>	</entry>

	</feed>