-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 27 Jul 00, at 15:25, Robert J. Munro wrote:

> Linux IPChains has an option called redirect, which is designed for
> putting transparent web caches on networks. Could I use this to trap
> attempts to go to an outside mail server, and redirect them to the
> local qmail, where there message can be queued and forwarded as
> normal, or would qmail not like e-mails that think they are going to
> another server?

You can do that.

1. You set up qmail as open-relay.
2. You let qmail-smtpd listen at (say) port 26.
3. You block access to port 26 (well, you may open it for internal 
hosts, but you don't have to).
4. You redirect outgoing port-25 packets to your port 26.
5. You use a simple patch for tcpclient to correctly obtain 
TCPREMOTEINFO if you're using ident lookups. (This patch 
thanks to Janos Farkas.)
diff -urpN ucspi-tcp-0.80-orig/tcpserver.c ucspi-tcp-0.80/tcpserver.c
- --- ucspi-tcp-0.80-orig/tcpserver.c   Sun Jan 18 08:17:43 1998
+++ ucspi-tcp-0.80/tcpserver.c  Thu Sep  3 19:55:22 1998
@@ -449,6 +449,8 @@ char **argv;
               if (!env_put2("TCPREMOTEHOST",tmp.s)) drop_nomem();
           }
         if (flagremoteinfo) {
+         /* NAT compatibility */
+          portlocal = ntohs(salocal.sin_port);
           tcpremoteinfo = 
remoteinfo_get(&ipremote,portremote,&iplocal,portlocal,(int) timeout);
           if (tcpremoteinfo)
             if (!env_put2("TCPREMOTEINFO",tcpremoteinfo)) drop_nomem();



-----BEGIN PGP SIGNATURE-----
Version: PGP 6.0.2 -- QDPGP 2.60 
Comment: http://community.wow.net/grt/qdpgp.html

iQA/AwUBOYBEOlMwP8g7qbw/EQKr1wCgidTwNDmmyYIJA3PlGAajdbMPASwAnRJE
hd6jbZo5n+MYkFF/i80rTifs
=61qs
-----END PGP SIGNATURE-----
--
Petr Novotny, ANTEK CS
[EMAIL PROTECTED]
http://www.antek.cz
PGP key ID: 0x3BA9BC3F
-- Don't you know there ain't no devil there's just God when he's drunk.
                                                             [Tom Waits]

Reply via email to