Virtual Users And Domains With Postfix, MailScanner, Mailwatch & MySQL On CentOS 5.1 - Page 3
8.1 MailScanner Quarantine
Make sure that it's disabled - the corresponding line should look like this:
$disabled = 1;
8.2 Mailwatch Quarantine
Change the first line that it looks like this:
cp /tmp/mailwatch-1.0.4/tools/quarantine_maint.php /usr/local/bin/
8.3 Mail Queue Watcher
First copy the mail queue watcher script.
cp /tmp/mailwatch-1.0.4/mailq.php /usr/local/bin/
Afterwards we create a new cronjob.
Add the following line:
0-59 * * * * /usr/local/bin/mailq.php
9 Quarantine Release Fix
In order that a released email is not checked again (it would be quarantined again) we have to add/modify some rules.
9.1 WhiteList SQL Database
Connect to phpmyadmin (%server_ip%/phpmyadmin) and log in as mailwatch. Afterwards select the database "mailscanner" and then the table "whitelist". Create a new record:
to_address = default
9.2 MailScanner Rules
Note that the entries in all lines of the following files have to be separated with tabs!
From: 127.0.0.1 /etc/MailScanner/filename.rules.allowall.conf FromOrTo: default /etc/MailScanner/filename.rules.conf
From: 127.0.0.1 /etc/MailScanner/filetype.rules.allowall.conf FromOrTo: default /etc/MailScanner/filetype.rules.conf
allow .* - -
allow .* - -
From: 127.0.0.1 no FromOrTo: default yes
Now adjust the permissions for the quarantine directory.
chown -R postfix:apache /var/spool/MailScanner/quarantine/
Note: The needed MailScanner settings were already included in step 4.
chkconfig --level 2345 MailScanner on
You should see lines like the following in the output:
Mar 6 07:33:21 server1 MailScanner: Config: calling custom init function SQLBlacklist
11 Remaining Configuration
http://www.howtoforge.com/virtual-users-and-domains-postfix-courier-mysql-centos5.1 from step 14 till the end.
Keep in mind that the commands to start, stop or restart postfix have changed!
To start MailScanner & Postfix:
service MailScanner start
To restart MailScanner & Postfix:
service MailScanner restart
To stop MailScanner & Postfix:
service MailScanner stop
12 Mailwatch Webinterface
Now you can access the mailwatch webinterface via http://mailwatch.example.com. Log in with the username & password that you created in step 7.4 .
First you should update the SpamAssassin rule descriptions and the GeoIP database. You'll find both options when you click on the "Tools/Links" button.
The attached VM is configured as follows.