Be careful, the code is containing errors, but it’s not too bad…
If you use Postgrey (and you should do it) on your mail servers and you want to have some statistics on the amount of greylisted messages and other information, you should find useful the following…
Source: How-To create statistics for Greylisted messages using Postgrey