This directory contains sample scripts of `rq' remote-rcpt existence
checking server and client.


[Overview]

You are managing some two SMTP servers, one is real(destination) server
and another is relaying server to real server.  In such case, you might
be going to be suffered from `dictionary attack' of spam:

	[Internet]
	   :
	   :Spammer sends to:
	   : <RandomFromDictionary@goal.example.com>
	   :
	   :
	+-------------------+    +-------------------------+
	|   Secondary SMTP  |    |     Primary SMTP        |
	| (or SMTP gateway) |    | (or Real MTA within LAN)|
	|   +antibadmail    +-->>|                         |
	+-------[ A ]-------+    +----------[ B ]----------+
          @gate.example.com            @goal.example.com
             172.16.1.1                 192.168.1.1
             Run `rq'                   Run `run'

Usually, a gateway SMTP server, Server[A] above, receives all messages
for goal domains that should be locally delivered on real server,
Server[B], even if reciepient does not exist on [B] because [A] doesn't
have full recipient list on [B].

The `rq' script check the existence of rcpt on another SMTP server.
The `run' script responds the query of `rq' by running `q' program via
tcpserver.


[Scripts]


* ./run		Server program, which should be run on [B]
  You can use this directory as /service/* under the control of daemontools.
  If you have running daemontools in /service/*, simply do as follows.

	# ln -s <ThisDirectory> /service

* ./rq		Client program, which should be run on [A]
  For antibadmail on [A], create the file named `goal.example.com' as
  follows;

	#!/bin/sh
	rq 192.168.1.1

  Put this script in /var/abm/rq/ or wherever `rq/' under the
  antibadmail installation prefix of your choice.

  If you have three SMTP servers behind one gateway server as follows;

	# mail-domain:RealSMTPserver
	goal.example.com:192.168.1.1
	foo.example.net:10.1.1.1
	bar.example.com:10.1.1.1

  Put three scripts as follows.

	$ ls -lF /var/abm/rq
	total 1
	-rwxr-xr-x 1 yuuji 22 May 25 13:37 bar.example.com*
	lrwxr-xr-x 1 yuuji 15 May 25 13:37 foo.example.net@ -> bar.example.com
	-rwxr-xr-x 1 yuuji 25 May 25 13:38 goal.example.com*

	$ head /var/abm/rq/*
	===> /var/abm/rq/bar.example.com <==
	#!/bin/sh
	rq 10.1.1.1

	===> /var/abm/rq/foo.example.net <==
	#!/bin/sh
	rq 10.1.1.1

	===> /var/abm/rq/goal.example.com <==
	#!/bin/sh
	rq 192.168.1.1


