How do I setup relays for a domain in CPanel. Just like I always do in the /etc/mail/mailertable in Sendmail.
I have a domain's email that I have to relay to a private IPAddress on the internal network
domain.com smtp:[192.168.0.9]
Thank you
How do I setup relays for a domain in CPanel. Just like I always do in the /etc/mail/mailertable in Sendmail.
I have a domain's email that I have to relay to a private IPAddress on the internal network
domain.com smtp:[192.168.0.9]
Thank you
Not tried it, but I guess you could use a smart router in exim:
http://www.exim.org/exim-html-4.40/d...20.html#IX1704
Jonathan Michaelson
Need your cPanel servers secured and tuned?
cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
http://www.configserver.com
Just cracked it - spent the afternoon trawling around google, and finally pieced together this solution - a quick how-to:
1. Type the following when logged in via SSH
2. Add entries in the format:Code:touch /etc/staticroutes pico /etc/staticroutes
3. Press CTRL-O to save the file, then CTRL-X to exit the pico editor.Code:domainname.com: target.mail.server
4. In WHM, under 'Service Configuration' choose 'Exim Configuration Editor', then click 'Switch to Advanced Editor'.
5. Scroll down to the 'ROUTERS CONFIGURATION' section, and in the white space underneath, add the following:
6. Scroll to the bottom of the page and click 'Save' - Exim will automatically restart.Code:static_route: driver = manualroute transport = remote_smtp route_data = ${lookup{$domain}lsearch{/etc/staticroutes}}
Well chuffed, since I can now route mail for some of my customers domains, once they've been scanned for viruses and spam on my cpanel servers (I use the RVSKin virus/spam solution/howto), to their Exchange servers...
Excellent! Well donethank you for posting the implementation too.
Jonathan Michaelson
Need your cPanel servers secured and tuned?
cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
http://www.configserver.com
Wow.. works like a charm.
Thanks very much for the BRILLIANT post...![]()
Cheers
A ndy![]()
What happens if the remote mail server is down? Does the mail accumulate on the source server until the remote server becomes available?
Ron...
I'm not 100% sure, but it most likely would queue it for later delivery.
Jonathan Michaelson
Need your cPanel servers secured and tuned?
cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
http://www.configserver.com
Originally Posted by projectandrew
I also posted a post on this, and I was told to search for smart routers. It seems to work just fine, until I specify the port number; then I get:
2005-12-14 22:25:16 1Eme7f-0004EB-TZ == xxx@xxx R=static_route T=remote_smtp defer (22): Invalid argument
Anyways, I have to forward mail to another port too; any possibilities on that ?
Thanks
I'm sure I got this from chirpy but this is what I'm doing and it works perfect.
ROUTERS
Code:smart_route: driver = manualroute route_data = ${lookup{$domain}lsearch{/etc/staticroutes}} transport = remote_smtp_smart
TRANSPORTS
Code:remote_smtp_smart: driver = smtp port = 6625 hosts = ${lookup{$domain}lsearch{/etc/staticroutes}} hosts_override
Okay, thanks for that, I added the second code block, changing 6625 to the port of the destination mail server..
But now I get the following error for all queued and new sent messages:
2005-12-15 14:30:44 1Em8pc-0001lO-6H == xxx@xxx R=static_route T=remote_smtp defer (-53): retry time not reached for any host
Any ideas?
Thanks
Frederic
The error would suggest that exim is not able to connect from your server to the remote IP on that port. Have you tried logging into the cPanel server and using:
telnet ip-of-server 6625
Make sure that you get the SMTP banner. type quit to end the session.
If that works, then perhaps you don't have the correct details in your /etc/staticroutes file?
Jonathan Michaelson
Need your cPanel servers secured and tuned?
cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
http://www.configserver.com
Sorry to open an old post.
Will the steps below get cpanel server to accept mail and scan it for spam and then relay it on ?
ROUTERS
Code:
Code:smart_route: driver = manualroute route_data = ${lookup{$domain}lsearch{/etc/staticroutes}} transport = remote_smtp_smart
TRANSPORTS
Code:
Ive got this in routes and it DOESNT scan the email it just relays it on fine.Code:remote_smtp_smart: driver = smtp port = 6625 hosts = ${lookup{$domain}lsearch{/etc/staticroutes}} hosts_override
ROUTERS
Code:static_route: driver = manualroute transport = remote_smtp route_data = ${lookup{$domain}lsearch{/etc/staticroutes}}
nope looks like using static_route and smart_route do NOT scan email for spam...
anyoen know how to ge tthat to work ?
I got this direct from cpanel to make the relaying server also scan the emails.
This can be done simply by adding the aforementioned condition to the static_route router, which is presently defined in your exim configuration:
static_route:
driver = manualroute
condition = "${perl{checkspam}}"
transport = remote_smtp
route_data = ${lookup{$domain}lsearch{/etc/staticroutes}}