Greylisting is back in town

August 16, 2006
The last thing that I missed from my oldstyle PC mailserver was the greylisting implementation for postfix, Postgrey. This was not trivial to port over to the new embedded ARM mailserver box because it was written in Perl. I spent considerable time trying to get Perl packaged and crosscompiled; I did get Perl itself to build but got lost trying to get its modules to build correctly (I since learnt more about libtool that might let me finish the job if I ever have to). Eventually I realized my life was being wasted struggling with Perl, so I looked around for an alternative greylisting solution for Postfix written in something more reasonable. I must have been having a bad day, because I landed on tumgreyspf which is written in Python. Cue another couple of days spent beating my head on Python trying to package and crosscompile another crosscompile basketcase. In a slightly shorter period of time I realized my life was wasting away so this time I looked for a greylisting addon that did not need ten tons of arguably dying language dragged in with it, and I found gps. This is written in C++ (my kinda language) and just needed a library and sqlite, or so it seemed. I managed to finally get sqlite to crosscompile and be packaged nicely today, so at last I was ready to attack gps. gps uses an interesting database abstraction library called libdbi. I packaged that, then noticed that it has a child project libdbi-drivers which actually contains the interfaces to the various SQL backends that are possible. Finally it was all packaged and sent over to the ARM board, after a little spring cleaning to make room in its 8MByte root filesystem. Well gps is broken for use with sqlite3, which it turns out is different from "sqlite" target in the config file. Thanks to this commendable sharing of solutions from Uffe Vedenbrant and a hack to allow sqlite3 in place of sqlite in the sources I was able to get it cooking. Because it runs as 'nobody' via Postfix, a little care was needed to make sure the config file and the sqlite database file were accessible for that user. However it seems the gps maintainer is a little asleep at the wheel, since Uffe's patch was not taken in since nearly a year to the main project and it means out of the tarball gps doesn't work at all with sqlite. Anyway the end result is once again I have some protection from spam just like the old days, except whereas before the box to do this was pulling down ~250W 24/7 the embedded solution only pulls 1.5W, for the same capabilities! Edit: Ooooh yes, two spams waiting for me thismorning instead of 20, lovely