I’m attempting to re-reoute smtp traffic that will come to my web server address to our new mail server. Both are Centos / Interworx systems. It does not seem to be working.
I’ve modified the /etc/afp/preroute.rules as follows:
Now you’ve confused me. I’m looking for a solution that will solve the following scenario:
User x has myserver.com as it’s smtp connection myserver.com is my webserver (for it all used to be on one machine)
I cannot change x’s smtp credentials or settings
when user x connects to my server at myserver.com via port 25 I want myserver to route the entire port to mymailserver.myserver.com
Your pointer to the faq talks about SENDING messages from interworx not receiving/relaying.
Sorry, I think perhaps your getting slightly confused.
Brett’s link is a manual edit if you wanted to use that, whereas iw-cp smtp route does this for you. I’m sorry though, I’m currently onsite at clients do I have not had a look at Brett link yet, but I remember it.
If your client is using email, it will use whichever server address you supply, which I
In turn will resolve to which ever IP address you set in dns records, which you would usually set MX and use MX records for this.
The smtp route is a way of transferring outgoing email to a smarthost.
If you want to send all outgoing via the MX record set, you can disable the email locally in full for all domains from nodeworx, plugin, email or manually edit a given siteworx account and disable email locally, siteworx, administration, email
This though, would not change the MX record set in dns and to be honest, given your description, I would do the following
Set the MX record to your email server and disable email locally.
We use the above as I describe with some of our clients, as we are an ESP, and have full dedicated managed mail systems and it works lovely, certainly I have never heard of any issues with relation to this setup from our clients.
We’re not talking about MX records here. To clarify user x is not a real person, nor a traditional mail client, it is a device simply using our SMTP to send an email. I do not want this device to use my webserver as an SMTP server anymore.
"User x has myserver.com as it’s smtp connection myserver.com is my webserver (for it all used to be on one machine)
I cannot change x’s smtp credentials or settings when user x connects to my server at myserver.com via port 25 I want myserver to route the entire port to mymailserver.myserver.com"
I think I fully understand your question now, sorry but feel free to correct me
You are wanting to foward all connections to port 25 or 587 on a specific IP address to be sent directly to different IP address in use on another server, so that it never uses in full any service connected with your IW hosting server.
If that is the case, you will need to look at your distro and put a forwarder port onto the port, which is nothing to do with IW-cp.
I guess it would be at routing level, but looking at your first post, you may achieve this if you run the code directly.
I’m sorry I cannot help any more as we have always set smtp clients to use MX.
Many thanks, I can be a little slow sometimes sorry.
No sorry, apf has nothing to do with smtp routes, albeit I understand why you think it might have.
Apf or iptables can be changed manually as well as from IW-cp, and these process at a lower level then smtp routes I believe from memory.
To be honest, thinking about it, both options will give same result your looking for, and both options are using your IW hosting server.
To fully not use your IW hosting server for port 25 or 587, you would need to have a firewall or similar device infront of your IW hosting server, and route port on this device. This then would not use any service on you IW hosting server as it’s changed before it gets to your IW hosting server.
please see below for preroute.rules entries your looking for, but please change as you see require, and make sure you set the correct eth (eth0 or eth1 etc…)
I hope that helps a little
Many thanks
John
/sbin/iptables -t nat -A PREROUTING -p tcp --dport 25 -i eth1 -j DNAT --to [myemailserverip]:25
/sbin/iptables -t nat -A PREROUTING -p tcp --dport 587 -i eth1 -j DNAT --to [myemailserverip]:587