Postfix: July 2008 Archives

Updated mailgrey graylisting policy scripts

| | Comments (0) | TrackBacks (1)
for my dual (My)SQL-Server Postfix graylisting policy service mentioned in
this blog entry about the two-node redundant SQL postfix graylisting service
are available:


You will need an MySQL Database Version 5 or greater (for InnoDB performance), perl with DBD::mySQL and Digest::MD5, and Postfix capable of using Policy servers.

With this update, changes to the whitelist databases (postmap) are detected automatically. The literal script in the former blog article was updated also.

Graylisting stats after 19 days

| | Comments (0) | TrackBacks (0)
As mentioned before, I set up a graylisting combo on two incoming mailservers using Postfix, MySQL and Perl (on Solaris 10). This solution runs now for 19 days and I took the time to analyze the database a little bit. Here's a plot of the number of positive graylisted entries since the beginning (X-axis represents the number of days since the beginning):

w.gif

The number of new entries per day is going slowly down, as expected.
These servers deliver mail for approx 12,000 users. So at the moment every user statistically receives mail from 40 correspondents.

The two SQL databases are running fine, and every night between 2.5 and 6 million rows are deleted (inactive graylisting entries which did not become active after 48 hours):

Jul 14    Inactive deleted:  2646153    Active deleted:        0
Jul 15    Inactive deleted:  4268527    Active deleted:        0
Jul 16    Inactive deleted:  5531953    Active deleted:        0
Jul 17    Inactive deleted:  4406925    Active deleted:        0
Jul 18    Inactive deleted:  3413663    Active deleted:        0
Jul 19    Inactive deleted:  3422004    Active deleted:        0
Jul 20    Inactive deleted:  2864347    Active deleted:        0


First:

On our running Postfix-Graylisting Setup, the two MySQL nodes are quite loaded:

Uptime:                 1 day 8 hours 54 min 29 sec

Threads: 320  Questions: 20519246  Slow queries: 15205  Opens: 522  Flush tables: 1  Open tables: 516  Queries per second avg: 173.204


And this is the result of implementing graylisting:

greylisting.png

But let's start from the beginning.

The scenario was like that:
Two mail servers are acting like an MX for an educational institution. 1.2 million spam mails came in per day. The two Ironport appliances behind did their best to sort them out, but in that institution spam cannot be deleted, there are laws against that. So the central cyrus mail server sorts them out via sieve scripts and puts them in the Spam boxes of every user, wasting disk space and - more important - disk i/o.

So I had the idea to implement a graylisting setup.

Each of the two Postfix nodes has its own MySQL database server running. But how to replicate data between them?




June 2010

Sun Mon Tue Wed Thu Fri Sat
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30      

About

This blog is owned by:

Pascal Gienger
Kanzleistr. 14
78462 Konstanz
Phone +49 7531 584298
Fax +49 7531 584298-9

Phone USA 1-678-791-4182

YouTube Channel: pascalgienger