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):
- 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:
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