===============================================================================
COPYRIGHT AND DISCLAIMER
===============================================================================

This package is Copyright(C) 2010 Giam Teck Choon or CHOON.NET, and may be
copied according to the GNU GENERAL PUBLIC LICENSE (GPL) Version 2 or a later
version. A copy of this license is included with this package. This package
comes with no warranty of any kind.

YOU ARE FREE TO USE THIS SCRIPT/PATCHES/GUIDE BUT I AM NOT RESPONSIBLE FOR ANY
DAMAGE CAUSED! YOU HAVE BEEN WARNED!!!

===============================================================================
INTRODUCTION
===============================================================================

greetdelay is a program to introduce a small delay before an SMTP greeting. It
also enforce RFC 2821's recommendation that SMTP clients not send any commands
before receiving the greeting message.

If RELAYCLIENT is set in environment variable, greetdelay will be skipped. Set
environment variable GREETDELAY to any numberic value greater than 0 to enable
greetdelay to wait for the set value before executing other program.

If SMTP clients send any commands during the greet delay period, "554 smtp
protocol violation (#5.5.1)" will be responsed with "premature input on stdin"
will be printed in stderr and exit with exit code 111.


===============================================================================
REQUIREMENTS
===============================================================================

* make
* gcc
* ucspi-tcp (http://cr.yp.to/ucspi-tcp.html)
* qmail (http://cr.yp.to/qmail.html)


===============================================================================
HOW TO COMPILE, INSTALL AND UNINSTALL?
===============================================================================

Run "make" to compile.

Run "make install" to install (default prefix: /usr/local). So greetdelay will
be installed in /usr/local/bin/ with default prefix as /usr/local.  If you
would like to install in other location, i.e. in /usr instead of /usr/local:

make prefix=/usr install

Run "make uninstall" to uninstall.  If you install in other prefix such as
/usr instead of /usr/local, please pass the argument to make:

make prefix=/usr uninstall


===============================================================================
HOW TO USE?
===============================================================================

In your smtpd run file, place greetdelay before qmail-smtpd (assuming
greetdelay and qmail-smtpd is in your PATH):

tcpserver -R -h 0 smtp greetdelay qmail-smtpd

Set environment variable GREETDELAY to any numberic value greater than 0 and
export it in smtpd run file if you want to enable greetdelay globally or set it
in your smtpd tcpserver rules.
