Exim Smarthost Configuration
Smarthost setup with Exim router, transport and AUTH settings
Back to DocumentationWhat does this guide do?
Ensures all emails sent from your Exim MTA servers (non-cPanel) are delivered through the MXGate smarthost (with authentication).
Prerequisites
- Root access
- Exim 4.94+ installed and running
- SMTP username and password created from MXGate panel
- TLS/SSL support (GnuTLS or OpenSSL)
Important Warning
Exim configuration file is edited directly. Incorrect configuration can stop all mail traffic. ALWAYS backup before proceeding!
1 Backup Exim Configuration File
Take a backup of the Exim configuration file just in case:
2 Router Definition
Add the following router definition to the begin routers section in your Exim configuration file:
Place this router BEFORE dnslookup or default smart host router. Otherwise emails will try to send directly.
3 Transport Definition
Add the following transport definition to the begin transports section in your Exim configuration file:
Adjust tls_verify_certificates path according to your distribution (for CentOS: /etc/pki/tls/certs/ca-bundle.crt)
4 AUTH (Authentication) Definition
Add the following authentication definition to the begin authenticators section in your Exim configuration file:
Security: Replace MXGATE_USERNAME and MXGATE_PASSWORD with actual credentials from MXGate panel. Format: : username : password (starts with colon)
The client_condition line ensures passwords are only sent over TLS encrypted connections.
5 Verify Configuration and Restart
Check the configuration file syntax before applying changes:
6 Testing and Verification
Test if the configuration is working:
Success! All your outgoing emails are now delivered encrypted and authenticated through MXGate.
Troubleshooting
Username/password incorrect. Check client_send format in AUTH section: : username : password
Router order is wrong. Ensure mxgate_smarthost router is placed BEFORE dnslookup.
Exim may not be compiled with TLS support. Or tls_verify_certificates file may not be found.
Firewall may be blocking port 587. Ensure your server IP is in MXGate whitelist.
There is a syntax error. Check spaces and tab characters. Exim is very sensitive to whitespace.
Debian/Ubuntu Exim4 Specific
Debian/Ubuntu systems may use Exim4 "split configuration". In this case: