Cloud House Technologies Logo
CloudHouse Technologies
HomeServicesProjectsBlogAbout UsCareersContact UsLogin
    Cloud House Technologies Logo
    CloudHouse Technologies
    HomeServicesProjectsBlogAbout UsCareersContact UsLogin

    WHM Exim Smarthost Configuration: Route Outgoing Mail Through a Relay for Better Deliverability

    Priya

    Content Writer & Researcher

    Last Updated: 25 June 2026
    WHM Exim Smarthost Configuration: Route Outgoing Mail Through a Relay for Better Deliverability
    🖥️

    Stop Losing Email Deliverability to Poor IP Reputation

    CloudHouse's server management engineers configure WHM Exim smarthosts daily across hundreds of cPanel servers — let us set up your relay correctly the first time. Get expert help today before another batch of outbound emails lands in spam.

    🔧 Book Free DiagnosisCall NowWhatsApp
    🖥️12,400+PCs Fixed
    ⭐4.9★Google Rating
    ⚡<15 minAvg. Response
    🛡️ISO 27001Certified

    If outgoing mail from your cPanel server keeps landing in spam folders or getting blocked outright, WHM Exim smarthost configuration is likely the fix you need. A smarthost — also called an outbound SMTP relay — routes all outgoing email through a trusted third-party mail gateway before it reaches recipients, effectively borrowing that gateway's strong IP reputation. This guide walks hosting sysadmins through every step: from a global relay setup in the WHM Exim Configuration Manager to per-domain routing that lets different accounts send through different smarthosts.

    Why Hosting Sysadmins Route Outgoing Mail Through a Smarthost

    Shared hosting servers are a deliverability minefield. A single compromised account sending spam can get the entire server's IP blacklisted within hours. Even without an active abuse issue, new server IPs start with zero reputation — and major inbox providers like Gmail, Outlook, and Yahoo treat unknown IPs with deep suspicion.

    A smarthost relay solves this by acting as an authenticated intermediary. Your Exim server hands off outbound mail to a relay provider (SendGrid, SparkPost, Amazon SES, Mailchannels, or a dedicated SMTP gateway) that already has:

    • Established IP reputation built over millions of legitimate sends
    • Active feedback loops with major inbox providers
    • Automatic bounce and complaint handling
    • Dedicated IP warmup programs for high-volume senders

    The result: your server's outbound mail bypasses the reputation problems tied to the server IP entirely. This is why cpanel exim outgoing mail relay configuration is one of the first things an experienced sysadmin sets up on a new shared hosting node.

    Beyond deliverability, smarthosts give you centralized logging, rate limiting per account, and the ability to apply content filtering before mail ever leaves your infrastructure — capabilities that Exim alone does not provide out of the box.

    💡 None of these worked? Skip the guesswork.

    Get Expert Help →

    Prerequisites: What to Check Before Configuring Exim in WHM

    Before touching the Exim Configuration Manager, confirm the following:

    1Relay provider credentials in hand

    You need the smarthost hostname, port (usually 587 or 465), and SMTP authentication credentials from your relay provider. Have these ready before you open WHM.

    2Backup your current Exim configuration

    In WHM, navigate to Service Configuration > Exim Configuration Manager, click the Backup tab, and download the current config. If anything goes wrong you can restore in seconds without reading a 5,000-line config file from scratch.

    3Check your current IP blacklist status

    Run your server IP through MXToolbox (https://mxtoolbox.com/blacklists.aspx) and check your PTR (reverse DNS) record. If the IP is on major blacklists, contact your data centre to delist it in parallel — a smarthost solves future sends but does not retroactively fix existing blacklistings.

    4Confirm Exim is the active MTA

    In WHM, go to Service Manager and verify Exim is enabled. Run exim -bV via SSH to confirm the version — this guide applies to Exim 4.x, which is what all modern cPanel installs ship with.

    5Check for conflicting custom Exim rules

    If you or a previous admin added custom routers or transports to Exim's advanced config, a new smarthost route could conflict. Review /etc/exim.conf.local if it exists, and the advanced editor in WHM for any existing manualroute entries.

    1Open the Exim Configuration Manager

    Log in to WHM as root. In the left sidebar search box, type exim and click Exim Configuration Manager. This opens the Basic Editor by default.

    2Switch to the Advanced Editor

    Click the Advanced Editor tab. This gives you direct access to Exim's raw configuration sections. The interface is divided into labelled blocks: ACL, Routers, Transports, Retry Rules, etc.

    3Locate the Routers section and add a smarthost router

    Find the text begin routers or use the browser's in-page search for POSTMAILCOUNT (a cPanel-specific marker). Just above the lookuphost router block (which handles normal direct delivery), insert the following router definition:

    smarthost_router:
      driver = manualroute
      domains = !+local_domains
      transport = smarthost_transport
      route_list = * relay.yourprovider.com::587
      no_more

    Replace relay.yourprovider.com with your relay provider's hostname. The double-colon notation (::587) specifies the port. Use ::465 for SMTPS if your provider requires it.

    4Add the smarthost transport with authentication

    Scroll down to the begin transports section and add:

    smarthost_transport:
      driver = smtp
      hosts_require_auth = relay.yourprovider.com
      hosts_require_tls = relay.yourprovider.com
    5Add authenticator credentials

    Scroll to the begin authenticators section and add a plain authenticator:

    smarthost_login:
      driver = plaintext
      public_name = LOGIN
      client_send = : your_smtp_username : your_smtp_password

    Replace your_smtp_username and your_smtp_password with the credentials from your relay provider. For security, some providers support storing credentials in a file — consult your provider's documentation for file-based credential options if you prefer not to embed them in the config.

    6Save and restart Exim

    Scroll to the bottom of the Advanced Editor and click Save. WHM will validate the configuration syntax before applying it. If there are errors, WHM will highlight them. Once saved, Exim restarts automatically. Confirm via SSH:

    service exim restart
    exim -bV
    1Create the domain-to-smarthost mapping file

    Via SSH as root, create /etc/exim_smarthosts:

    touch /etc/exim_smarthosts
    chmod 0644 /etc/exim_smarthosts
    chown root:root /etc/exim_smarthosts

    Add entries in this format — one domain per line, domain and relay separated by a space or colon:

    domain1.com   relay1.provider.com::587
    domain2.com   relay2.anotherprovider.com::587
    domain3.com   smtp.sendgrid.net::587
    2Add a per-domain router in WHM Advanced Editor

    In the Routers section, add this router above your global smarthost router (so it's evaluated first):

    domain_specific_smarthost:
      driver = manualroute
      domains = !+local_domains
      transport = smarthost_transport
      route_list = * ${lookup{$sender_address_domain}lsearch{/etc/exim_smarthosts}}
      no_more
      condition = ${lookup{$sender_address_domain}lsearch{/etc/exim_smarthosts}{true}{false}}

    This router fires only when the sending domain exists in /etc/exim_smarthosts. Domains not listed fall through to the global smarthost router or direct delivery as normal.

    3Handle per-domain SMTP credentials

    If different relay providers require different credentials, create a parallel file /etc/exim_smarthosts_credentials:

    domain1.com   username1:password1
    domain2.com   username2:password2

    Then reference it in a custom authenticator that performs a lookup on $sender_address_domain. The exact syntax depends on your Exim version — refer to the Exim specification chapter on authenticators for the plaintext driver with dynamic client_send strings.

    4Test the per-domain routing before going live

    Use Exim's routing test mode to verify a specific domain will be routed correctly without sending a real email:

    exim -bt user@domain1.com
    exim -bh 127.0.0.1 << EOF
    EHLO localhost
    MAIL FROM:<test@domain1.com>
    RCPT TO:<recipient@example.com>
    DATA
    Subject: Test
    .
    QUIT
    EOF

    The -bt flag (address test mode) shows exactly which router and transport Exim will use — you'll see router = domain_specific_smarthost for domains in the list and a different router for domains not in the list.

    1Send a test email and watch the main log

    Send a test email from a command line on the server:

    echo "Test email body" | mail -s "Smarthost Test" testrecipient@gmail.com

    Then tail the Exim main log immediately:

    tail -f /var/log/exim_mainlog

    Look for a line like:

    SMTP connection outbound ... to relay.yourprovider.com [x.x.x.x]:587

    This confirms Exim is handing off to the relay. If you see connect to relay.yourprovider.com followed by 250 OK, delivery succeeded.

    2Check for authentication failures

    Authentication errors appear in the main log as:

    SMTP error from remote mail server after AUTH: 535 5.7.8 Authentication credentials invalid

    Double-check the username and password in your authenticator block. Some providers use the API key as the password with a fixed username (e.g., SendGrid uses apikey as the username).

    3Check for TLS failures

    If TLS negotiation fails you'll see:

    TLS error on connection to relay.yourprovider.com: SSL_connect: error

    Try adding tls_verify_certificates = /etc/ssl/certs/ca-certificates.crt to the transport block, or temporarily set hosts_require_tls to a blank string to test without TLS (never leave TLS disabled in production).

    4Use the WHM Mail Delivery Reports tool

    WHM provides a built-in GUI log viewer under Email > Mail Delivery Reports. Filter by time range and check the relay column to confirm all outbound messages are showing your smarthost as the delivery route rather than direct delivery.

    5Verify with an inbox placement test

    After confirming the relay is working at the log level, use a tool like mail-tester.com or GlockApps to send a test message and check inbox placement scores, SPF/DKIM alignment, and header routing. The Received: headers in the email should show your relay provider's servers, confirming the message passed through the smarthost.

    If you need expert help managing your Exim configuration, cPanel environment, or overall server email stack, CloudHouse provides a comprehensive server management service with experienced Linux and cPanel engineers available around the clock.

    FAQs: WHM Exim Smarthost Troubleshooting

    See the FAQ section below for answers to the most common questions about WHM Exim smarthost setup and troubleshooting.

    Conclusion

    Properly configured WHM Exim smarthost routing transforms a deliverability liability into a controlled, auditable outbound mail pipeline. Whether you route all traffic through a single global relay or implement granular per-domain routing for individual client accounts, the Exim Configuration Manager gives you the flexibility to match any hosting environment's requirements. Start with a thorough backup, test each change with exim -bt and live log tailing, and monitor inbox placement scores after every configuration change. For hosting providers managing dozens or hundreds of cPanel servers, standardising smarthost configuration across the fleet is one of the highest-leverage steps you can take to protect both your infrastructure's reputation and your clients' email deliverability.

    Get the Free Linux Server Admin Cheatsheet (PDF)

    Essential commands for server management, networking, and troubleshooting — all on one printable page.

    Running Linux servers? Let us manage them for you.

    Our Managed Linux Server plans cover updates, security hardening, monitoring, and 24/7 incident response — so your servers stay up and your team stays focused.

    • Proactive OS patching and security updates
    • 24×7 monitoring with instant alerting
    • Backup configuration and disaster recovery
    • Dedicated Linux engineers on call
    See Pricing Plans →

    What our customers say

    “Our production server went down at 2 AM. CloudHouse had it back online in under 20 minutes. Incredible response time.”

    Arun S.

    CTO, SaaS Startup

    “They migrated our entire infrastructure from Ubuntu 18 to 22 with zero downtime. Couldn't have asked for better.”

    Deepak N.

    DevOps Lead

    Frequently Asked Questions

    A smarthost is an outbound SMTP relay server that your Exim installation hands all outgoing mail to instead of delivering it directly. You need one when your server's IP address has a poor reputation — due to blacklisting, being on a residential or shared IP range, or simply being new — because the smarthost's established IP reputation is what inbox providers trust. It also centralises bounce handling, rate limiting, and delivery analytics in one place.

    Book your free 15-minute diagnosis

    A certified technician will call you back within 15 minutes during business hours.

    Share this article

    Leave a Comment

    Comments (0)

    Loading comments...

    Need Help With WHM Exim Smarthost Setup?

    Misconfigured Exim relay settings can silently drop email or cause authentication failures that are frustratingly hard to diagnose. CloudHouse's cPanel-certified engineers have set up smarthosts on hundreds of servers — we'll get yours right the first time. Reach out now for a fast, reliable configuration.

    Call Now — FreeWhatsApp Us

    Why CloudHouse?

    • ISO 27001:2022 certified
    • 12,400+ devices supported
    • 4.9★ on Google
    • Sub-15-minute response

    CloudHouse Technologies

    Innovative cloud solutions for modern businesses. We deliver cutting-edge technology with exceptional service.

    Contact Us

    CloudHouse Technologies Pvt.Ltd
    Special Economic Zone(SEZ),
    Infopark Thirissur,4B-15,
    Indeevaram,Nalukettu Road,
    Koratty, Kerala, India-680308
    0480-27327360
    info@cloudhousetechnologies.com

    Quick Links

    • Our Services
    • Gold Loan Software
    • About Us
    • Contact
    • Terms and Conditions
    • Privacy Policy
    ISO27001:2022
    Certified

    © 2026 CloudHouse Technologies Pvt.Ltd. All rights reserved.

    Back to top