What is greylisting?
See http://www.greylisting.org/, http://projects.puremagic.com/greylisting/

This software is BETA!!

Compiling
=========
gcc -o greylisting greylisting.c -I/usr/include -I/usr/include/mysql -I/usr/local/include/mysql -L/usr/lib/mysql -L/usr/local/lib/mysql -lmysqlclient
strip greylisting

Greylisting configuration
=========================
Configuration file must be placed at <qmaildir>/control/greylisting
Example file is included in this package and has to be renamed accordingly
You can override all settings by using environment variables (see below)
A row must not exceed MAXCONFIGLINESIZE(=1024) characters!

mysql_host ........... MySQL hostname/ip
mysql_port ........... MySQL port
mysql_user ........... username for login
mysql_pass ........... password for login
mysql_db ............. database to use
block_expire ......... minutes until email is accepted
record_expire ........ minutes until record expires
record_expire_good ... days until record expires after accepting email

Enviroment variables
====================
- GREYLISTING
  _MUST_ be defined in order to start greylisting. Useful for tcp-environ.
- GLDEBUG
  Set to 1 to enable debugging (to stderr)
- GLMYSQLHOST, GLMYSQLPORT, GLMYSQLUSER, GLMYSQLPASS, GLMYSQLDB
  GLBLOCKEXPIRE, GLRECORDEXPIRE, GLRECORDEXPIREGOOD
  See configuration file notes above

Example qmail-spp configuration
===============================
[rcpt]
plugins/ifauthskip
plugins/greylisting

ifauthskip skips remaining plugins if user is authed and is recommended.
plugin is available at http://xs3.b92.net/tomislavr/qmail.html

Cleanup
=======
This packages includes a simple shell script (greylisting_cleanup.sh) which
cleans expired entries. You should run this hourly (e.g. via cron).

History
=======
2009-09-23 (0.2.5, 0.1.5)
* fixed printing CRLF instead of LF to stdout (captured by qmail-spp) which
  results in printing CRCRLF to the sender. As far as we know only Novell
  Groupwise has troubles with this sequence but it's incorrect anyway.
  Thanks to Frank Koehlert for pointing this out
2007-12-03 (0.2.1, 0.1.1)
* fixed wrong operator precedence in white-/blacklist query
  causes record_expires-field to be ignored if entry is recipient/domain based
2007-11-30
* fixed/swapped ip-match comments/documentation in check_greylisted()
  /24-subnet-matching is still default. updated both versions
2007-11-14
* fixed small typo. updated both versions
2006-12-7 (0.1)
* rewrote for qmail-spp compatibility
* configuration file support
* various improvements (mysql, ipv6, ...)