There are a number of reasons why you’d want to send all email from your cPanel server through a smarthost. Maybe your ISP blocks traffic on destination port 25. Or maybe you utilize your own SMTP relay or outbound spam server. Whatever your reason, setting this up is simple in WHM.
Personally, I use this feature to pass all outbound email through spam filters which sit about 1000 miles away from my web server. The message tracking in WHM is very powerful, but I like the control of my spam filters for message tracking and message suppression in the event an email account gets hijacked.
This is simple to set up (once you know how, that is). I actually struggled with this one a little bit so I thought I’d offer up the solution for anyone else who might be looking for the answer. This tutorial assumes you are using the default exim mail server with your cPanel/WHM setup.
- Login to WHM
- Under Service Configuration select Exim Configuration Manager
- Then in the Basic Editor, choose the Mail tab.
- Under the Smart Host Support option, select the radio button beside the text box and enter your smarthost info in the following format (including quotes):
“* smarthost1.com:smarthost2.com”
- That’s it. Save your changes and restart Exim.
Exim will try the smarthosts in order until it finds one that will accept the email. So in the above line, smarthost1.com will be tried first. If it is offline, smarthost2 will be tried.
What If I need to use a port other than 25?
There are rare instances where you may need to send mail to a port other than the default 25. This can be done easily as well. Just replace the line above with the following format:
“* smarthost1.com::1166:smarthost2.com::1100”
The above line would send all mail first through smarthost1.com port 1166. If that host wasn’t available, it would try smarthost2.com on port 1100.
Have questions about this procedure? Throw em’ in the comments below.
Need a high-quality cPanel/WHM host? We recommend WiredTree.
- Integrate Sendy with WHMCS Billing for less than a Latte - April 25, 2021
- Can I Really Make Money With Web Hosting? - July 5, 2016
- Can Independent Web Hosts Be Competitive? Here Are 3 Proven Ways - July 1, 2016
Hello Curtis, wich smarthost provider you recommend?
Thanks!
When I’ve set this up in the past I’ve only ever used an internal email server that we maintain so i’ve never used a smarthost provider in this capacity. I set it up as an open relay for all emails from the WHM host. If you are looking for reliably of sending, Amazon’s SES platform within AWS might be good. I’m not positive if they allow open relay from a particular IP address however. That might be an issue.
Hi Curtis,
How about a smarthost with SMTP authentication? I have done it before a long time ago but it required more adjustments than WHM offers in the GUI itself. Any thoughts or experience on this yourself?
Good question. This I have not done so I can’t offer any insight.