                            POP/IMAP/SMTP RELAY

   Want to close your mail system to SPAMMERS (third-pary relaying) yet still
allow your authenticated POP and IMAP clients to be able to relay mail?

   Normally mail systems should be set up to only relay mail from known IP
addresses or networks to prevent SPAMMERS from using the mail server as a
third-party relay.  But what about roaming POP/IMAP users?  How can they send
mail through your server to someone else on the Internet without the system
administrator having to enter their (probably temporary) IP address into a
list of allowed relay clients?

   This project aims to provide a plug-and-play mechanism whereby POP/IMAP
clients who authenticate themselves normally can be set up to relay mail through
the mail server.  This is done by temporarily putting a special timeout marker,
the IP address of the POP/IMAP client, and the RELAYCLIENT environment variable
into the TCP_WRAPPERS file (/etc/hosts.allow) or TCPRULES file (for CDB
databases).  When the user next sends mail QMAIL smtp sees the RELAYCLIENT
environment variable and allows the client to relay through the server to
somewhere else on the Internet.  The smtprelay program will also automatically
clean out old entries from the database that are older than a user-definable
time (defaults to 5 minutes) using the timeout marker.  This means that the
IP address being allowed to relay will only be allowed for the timeout period.
After that, it will no longer be allowed to relay unless a user authenticates
themself again via POP/IMAP.

   This program is normally installed in the chain of programs that receive the
incoming POP/IMAP/SMTP requests AFTER the authentication program has
completed and before the normal POP/IMAP/SMTP processing program begins.
This way, only authenticated users will be able to relay through the mail
server.

I am using this program with QMAIL and COURIER-IMAP.  I have not tried this
with any other combination of servers yet.

To configure this program, see the INSTALL file.

For program parameters, type: ./smtprelay -h
