cPanel/WHM Smarthost Configuration
Authenticated smarthost setup with Exim Configuration Manager. All emails sent from your cPanel/WHM server are relayed through MXGate, encrypted and authenticated.
Ensures all emails sent from your cPanel/WHM server are delivered through the MXGate smarthost (with authentication). This puts your outbound emails under MXGate protection.
Prerequisites
- WHM root access
- SMTP username and password created from the MXGate panel
- cPanel version 92+ (Exim 4.94+ recommended)
Setup in 7 Steps
Access Exim Configuration Manager in WHM
Log in to the WHM panel as the root user and search for "Exim" to find the Exim Configuration Manager.
Switch to the Advanced Editor Tab
On the opened page, click the Advanced Editor tab from the top menu. You can directly edit the Exim configuration file in this section.
Section: ROUTERCONFIG - Smarthost Router
Add the following configuration in the ROUTERCONFIG section. This ensures all outgoing mail goes through MXGate:
Section: TRANSPORTCONFIG - Transport Configuration
Add the transport definition containing the SMTP authentication settings in the TRANSPORTCONFIG section:
Section: AUTH - SMTP Authentication
Add the MXGate SMTP authentication settings in the AUTH section. Use the username and password obtained from the MXGate panel:
Save Configuration and Restart Exim
After making all changes, click the Save button at the bottom of the page. WHM will automatically validate and restart the Exim configuration.
Testing and Verification
Test whether the configuration is working. Send an email and check the Exim logs:
Common Errors
How do I fix the "535 Authentication failed" error in cPanel/WHM Exim?
Check your authentication credentials. Make sure the username and password are correct in the MXGate panel. Ensure the colons (:) are correctly placed in the AUTH section.
Why does the cPanel smarthost return a "Connection refused" error?
Check your firewall settings. Ensure outbound access to port 587 is allowed.
How do I resolve the "TLS required" error in Exim?
Ensure hosts_require_tls is present in the transport section, or remove the TLS requirement.
Why does cPanel Exim throw a "Router not found" error?
Ensure the smarthost_router definition is added to the ROUTERCONFIG section. Check for indentation errors.