bind-interface (http://qmail.org/local-bind)

This is a modified patch of http://qmail.org/local-bind so that other patches
can be easily integrated especially for IPv6 support.

NOTE: We are using '|' character as separator instead of default ':' character
due to IPv6 addresses will have ':' characters.

control/bindroutes for IPv4
control/bindroutes6 for IPv6

Below are the original message cut and paste from http://qmail.org/local-bind
for reference only.

================================================================================
From: Chuck Foster <Chuck.Foster@uk.uu.net>
To: djb-qmail@koobera.math.uic.edu
Subject: binding to local interfaces
Date: Mon, 19 Jan 1998 09:40:42 +0000 (GMT)

Hi,

Well it finally reached the stage where I needed to do this on one of our
hosts, as I wanted mail to go out using the virtual interface ip address
and not the default one. (sigh).

Anyways, if anyone thinks they'll have a use for it, I've included the
patch to timeoutconn.c to bind to the interface, and an optional
qmail-remote.c patch to print errors returned from it (if you don't use
that then the 'standard' SMTP connection failed message gets used).

I used a file called /var/qmail/control/bindroutes, using the same
ip-address matching as tcpcontrol, ie. 1.2.3.4, 1.2.3., 1.2., 1., none.
The LHS is the outbound IP (ie. the host you're going to), and the RHS
is the interface on the local machine to bind to (ie. needs to be
valid on the host).

Eg.

10.:10.0.0.1
:301.32.1.1
555.123.123.123:this-isnt-an-ip-address

The define should be either 0 or 1; 0 means if the bind() fails then go
ahead and connect() with the os bind; 1 means that a temp error is
generated and the mail requeued.

As usual, if you use these patches yourself it's at your own risk; all
seems to work fine on my (Solaris 2.5.1) boxes, but if something busts cos
you've used them then you're on your own (but feel free to tell me!).

C.
================================================================================

Signed-off-by: Giam Teck Choon <giamteckchoon@gmail.com>

Conflicts:
	qmail/qmail-control.9