
Use PostgreSQL database to log clients IP and their connection time
and, which can be more interesting, deny them access based on their IP.

For performance reasons, I suggest to run PostgreSQL over localhost.

Logging is done to such table:
  CREATE TABLE ircd_conn (ip cidr, date timestamp);

Quering for banned IPs is done from such table:
  CREATE TABLE ircd_kline (ip cidr);
You have to populate ircd_kline with IPs by other means, this module
will not do it for you.

Connection string is passed as last(!) option named "conn", like this:

----8><---iauth.conf---
module pgsql
	timeout = 10
	option = log,reject,conn=dbname=ircd password=secret host=localhost user=ircd
	reason = Denied access (SQL)
----8><---iauth.conf---

Queries are not configurable, if you need different tables or field names
(or different queries), you have to edit mod_pgsql.c and change pgsql_start()
function.

You will probably have to edit Makefile, too, and give it some -I and/or -L.

Have fun extending it, keep me posted.

Piotr Kucharski 

first pieces of code by Gael Martinez
