Prerequisites
-------------

In order to get gnarwl compiled and working, you need the following:

- gcc 2.95.3
- libgdbm 1.8.0 or later
- openldap2 (ver. 2.0.12)
- postfix as mailer
- GNU make, groff, gzip
- Linux 2.4.x

It may work with a different setup, but this is what I developed/tested it
under. If you (don't) get it to work in an alternate environment, drop me 
a line. I think, the only thing, really required is libgdbm (patches are
welcome ;-) ). Note for rookies ;-): You will also need the header files of
gdbmand openladap . Some distributors split programs into two packages: 
binaries and development, make sure you install them both.

WARNING: Gnarwl won't compile out of the box with openldap2 version 2.0.23,
this is because libldap does not link against it's required libs itself. In 
order to compile you have to add the according linkerflags in gnarwls Makefile
yourself. Just append "-ldl -llber -lresolv" to LFLAGS, this should do
the trick.

Installing GNARWL
-----------------

Installing gnarwl should be simple. Just

make
make install

(You may want to adjust the pathes in the main Makefile first)

Edit /etc/gnarwl.cfg to suit your needs. Note: make install will add 
a new user "gnarwl" to your system. This has several reasons:
- /etc/gnarwl.cfg should not be world readable, as it may contain LDAP
  binding credentials.
- I don't trust my own software, if gnarwl fails/segfaults/summons cthullu,
  it will leastwise do so under a save uid not messing around with your 
  mailers privileges (of course, for this to work, your mailer has to start
  gnarwl under the correct uid).

Edit /var/lib/gnarwl/blacklist.txt, put mail addresses in here, that are not 
allowed to send out vacations (potential candidates to go here are "root" or 
"webmaster@your.site.com"). Every entry in this file is matched (as is) 
against every address in the "To:" and "Cc:" field of the incomming mail.
  

Configuring LDAP
----------------

To cope with vacations, ldap requires the respective objectclasses. I recommend
installing the included billiton.schema file. It is the schema I developed
for an ISP environment. In case you are using OpenLDAPv3, just copy it to
your schema directory and put an according include statement in your 
slapd.conf, restart the LDAP server.


Testing gnarwl
--------------

It's a good idea to test gnarwl before installing it. To do this, create a
test ldap entry (see example.ldif). Call gnarwl from command line, using the 
-c and -v options (use -h for a list of options). Gnarwl should then accept
an email piped in through stdin. You don't have to give gnarwl a complete
email, since only the header will be parsed. So it's enough to type 
something like this:

From: <insert your mail address here>
To: bofh
Subject: Just a test

Gnarwl will stop reading stdin, as soon as it gets an empty line. Afterwards
it'll send out the vacation message. If it doesn't, try looking in your
maillog. Common mistakes are:

- Searchbase (in gnarwl.cfg) is not set properly
- LDAP server not specified/not responding
- Mailsystem not set up
- No corresponding LDAP entry to "To:" field, or vacation flag not set
- typos in your mailheader


Configuring the Mailserver
--------------------------

The preferred Mailserver to use with gnarwl is postfix (It'll probably 
work with other MTA as well, though), since postfix is both, flexible and
easy to administer.

Assuming you already got postfix installed to use ldap for normal mail 
delivery. You only have to add a special mailaccount, getting a blind carbon
copy of all the mails going through your server (or at least all the mails
from the users that may set vacations). You could use a line like

always_bcc = gnarwl

in main.cf. Now all you need is a .forward file in gnarwl's homedir, telling
postfix to pipe all mail through gnarwl ("make install" will create one 
automatically for you).
