PostfixCompleteVirtualMailSystemHowtoDiscussionAndDrafts

SQLgrey

Here is a draft version of my SQLgrey guide. Feel free to add comments. Also if anyone knows a way to provide Opt-In and Opt-Out that lets the individual domain admins do it themselves for their domain please say so.

the guide

Anything marked with an (i) is a guide for sharing the SQLgrey database between several computers. If you have several mail-servers I recommend sharing the database to prevent each server's SQLgrey from thinking each resent e-mail is the first e-mail and blocking it. I will call the computer that holds the SQLgrey database the DB server.

After installing SQLgrey you'll need to create an SQLgrey user

sudo groupadd sqlgrey
sudo adduser -g sqlgrey sqlgrey

now log into mySQL and create the SQLgrey database

mysql -u root -p

create database sqlgrey;
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP ON sqlgrey.* TO 'sqlgrey'@'localhost' IDENTIFIED by 'sqlpassword'; 
(sqlpassword MUST NOT HAVE ANY SPACES!)
exit;

(i) you will have to grant permission to SQLgrey on your other server(s) as well

GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP ON sqlgrey.* TO 'sqlgrey'@'ipadress of server' IDENTIFIED by 'sqlpassword'; 

exit;

Next we go to the sqlgrey configuration file

sudo vi /etc/squlgrey/squlgrey.conf

The default configuration is fine for the most part but some things need changing and others are entirely down to your personal preferences:

https://wiki.ubuntu.com/PostfixCompleteVirtualMailSystemHowto?action=AttachFile&do=get&target=IconHint.png

if a line in sqlgrey.conf is commented out, the default value is used.

One thing that must be changed is the data-base settings.

Uncomment and change the following lines

db_type = MySQL
db_pass = sqlpassword

(i) you'll also have to give the IP address of the DB server

db_host = ipadress of db-server

And change the postmaster address to a real address

admin_mail = Postmaster@yourdomain.net

(i) you all so need to point SQLgrey at the correct server.

inet = Ipaddress:2501

(e.g. 192.168.0.50:2501)

The following options are well documented and you should change them to suit your prefrences.

  • greylisting delays
  • auto whitelists settings
  • greylisting method

Now finally to create your own whitelists

sudo vi /etc/squlgrey/clients_ip_whitelist.local

add any IP adresses you want to whitelist. Do not touch clients_ip_whitelist as that will be overwritten. for example

128.0.0.1 

you don't want to greylist yourself.

also you'll want to create a domain whitelist:

/etc/squlgrey/clients_fqdn_whitelist.local

PostfixCompleteVirtualMailSystemHowtoDiscussionAndDrafts (last edited 2008-08-06 16:33:46 by localhost)