Greylisting with sqlgrey, postfix and mysql on Debian Lenny

This article describes howto setup sqlgrey with postfix and mysql on Debian Lenny. 

The normal graylisting with postgrey store the whitelist in a berkeley database which needs to be replicated on a mailserver cluster. With sqlgrey you can do that replication with a mysql database.

First create a Database “sqlgrey” with an user “sqlgrey” on your database server. (The tables will be created by sqlgrey.)

1. Install sqlgrey:

aptitude install sqlgrey

2. Edit the sqlgrey configuration file:

vim /etc/sqlgrey/sqlgrey.conf

Edit the database settings:

## Database settings
db_type = mysql
db_name = sqlgrey
db_host = YOUR_DATABASE_SERVER
db_port = default
db_user = sqlgrey
db_pass = YOUR_PASS_WORD
db_cleandelay = 1800
clean_method = sync

4. Add sqlgrey to the postfix configuration:

vim /etc/postfix/main.cf

Append the recipient restrictions:

smtpd_recipient_restrictions = permit_sasl_authenticated,
permit_mynetworks,
reject_unauth_destination,
reject_unknown_client,
reject_invalid_hostname,
check_policy_service inet:127.0.0.1:2501,
permit

5. Restart the services:

/etc/init.d/sqlgrey restart
/etc/init.d/postfix restart

6. Controll

Watch the content of the table “connect” it contains the sender information of every incoming mail.

This Post Has 2 Comments

  1. Hallo,

    besten Dank 😉

    Rainer

  2. vielen Dank! Hat mir beim Umstieg von postgrey zu sqlgrey sehr geholfen 🙂

Schreibe einen Kommentar

eMail-Benachrichtigung bei weiteren Kommentaren.
Auch möglich: Abo ohne Kommentar.

Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.