Documents >> FreeBSD >> SQLGrey Greylist on Postfix

FreeBSD SQLGrey install including the Webinterface SGWI

In my fight agains SPAM, I recently started looking for a Greylist implementation to Postfix.... There where quite a few... Sooo in the end i just choosed one.

I choose SQLGrey since it uses a MySQL database as its backend... This I liked since it gives me the possibility to look behind the scene,

The installation is fairly straight forward given that you have a functional postfix mailserver install.... At least on FreeBSD. Install it from ports and follow the howto that gets placed in /usr/local/share/doc/sqlgrey.

cd /usr/ports/mail/sqlgrey
make install
  * Choose MySQL server as backend 

When the install has finished it has created a sqlgrey folder in /usr/local/etc/

Edit the /usr/local/etc/sqlgrey/sqlgrey.conf and uncomment the lines with the configurations you want to change. Remember to set the database information. 

ee  /usr/local/etc/sqlgrey/sqlgrey.conf

Before starting the SQLGrey service, remember to create the database in MySQL. I allways do this though PHPMyAdmin, so there is no reason to describe this here.

Now it is time to start the SQLGrey service.

echo "sqlgrey_enable=YES" >> /etc/rc.conf

/usr/local/etc/rc.d/sqlgrey start

The last thig to do is to get Postfix to use the SQLGrey Service. This is done by editing the following variable in postfix main configuration file /usr/local/etc/postfix/main.cf and add the following two lines to it,

ee /usr/local/etc/postfix/main.cf

smtpd_recipient_restrictions =
               ...
               reject_unauth_destination
               check_policy_service inet:127.0.0.1:2501

Now you are almost done.... Reload Postfix and enjoy the decreasing amount of SPAM.

postfix reload 

Now it is time to install the Webinterface.

Simply because I like to se what is happening....

As said before I used the SGWI Webinterface, which can be found here. 

To use this Webinterface you ofcourse need a working Webserver and access to the database used by SQLGrey.

Download the SGWI Webinterface from the supplied link, and unpack it.

wget LINK
tar zxvf FILE 

edit the config_inc.php to set the database configuration. After this it is just to open the Webinterface in your browser.

ee config_inc.php

Rememberto set some security on it, because you do not want people to mangle with your white / black lists.
I used HTaccess to secure the folder.

If you  do not know how this is done, search my site... I may make a guide some time in the furture... Else search the internet there is thousands of theese guides.

 

 


^ Top | Copyright © 2007 Afterschool.dk| css | xhtml