Question : How to redirect http queries to local IP, and email queries to remote IP?

I have two servers.  One is an Apache HTTP server where I want my http queries to go to, the other server is my email server which is located on another network.  How can I set up ENSIM to redirect email queries to the proper server?

I need a ENSIM friendly script that will do this for me...

Thanks in advance!

Answer : How to redirect http queries to local IP, and email queries to remote IP?

You could always port forward everything that comes in on tcp port 25 of your http machine to the address of the mail machine.  The advantage to this is you don't have to have sendmail running at all on your webserver (even though it probably is anyway.)

The best way to forward a port is with iptables/chains but don't have the syntax memorized to show that here.  You could also use an app to do it.

Below is a simple port forwarder:
http://portfwd.sourceforge.net/

Now that I start thinking about it, are you sure this can't be done in DNS?

You point your domain at your webserver's IP.  Then you also point the hostname www to your webserver's IP. Then you point the hostname mail to your mail server.  Then you set up an MX record to point to mail.  This will make all web traffic go to your web server and all mail traffic go to your mail server.
Random Solutions  
 
programming4us programming4us