CentrioHost Blog

Stories and News from IT Industry, Reviews & Tips | Technology Blog


How to Set Up a SMTP Relay with cPanel

  • Category : cPanel Tutorials
  • Posted on : Jul 25, 2021
  • Views : 4,934
  • By : Ashton Davies

Do your users’ emails disappear somewhere between your server and the recipient? They send emails, but the messages never reach their destination. Somewhere out there, in the wilds of the internet, a system beyond your control scrutinizes messages and thinks: Nope! Email delivery issues can be incredibly frustrating. 

Messages that go missing in this way are collateral damage in the never-ending war against spam. Internet Service Providers (ISPs) and inbox providers want to stop spam before it gets to users, and they don’t mind if a few legitimate messages are caught in the cross-fire. Server administrators are expected to make sure emails sent from their server are above suspicion.

Relaying messages through a Smarthost is one of the most reliable ways to solve delivery issues. In this article, we’re going to look at how they work and how, with help from cPanel & WHM, you can easily set up a relay to send your email to a Smarthost.

First, let’s consider why the internet’s spam-fighting system might have a low opinion of messages sent from your server.

Factors That Affect Email Deliverability

Recently we discussed about SpamAssassin with cPanel, we explored how the filter identifies incoming junk mail with language tests, message digests, and blocklists. ISPs use similar techniques, employing third-party blocklists and internal databases to assess the reputation of an IP address, the unique number that identifies a server on the internet.

If a server’s IP address gets a bad reputation, its emails are going nowhere, but how does an IP become notorious in the first place?

  • A spammer used it in the past.
  • It is part of a block of IP addresses associated with junk mail.
  • The server has been compromised and used to send spam.
  • A user sent messages to a list that includes a honeypot address.

It may be possible to re-establish an IP’s good reputation or have it removed from a blocklist, but it takes a long time and may not succeed. Plus, while IP reputation is the most important factor, it isn’t the only one. Domain reputation plays an increasing role, as do verification and authentication technologies such as SPF and DKIM.

What is a Smarthost?

A Smarthost is an email relay operated by a third party, which might be an ISP, a hosting provider, or a company that specializes in improving delivery rates. Hosts send messages to the relay, which sends them back out onto the internet.

How does that help you to deliver emails? Email relay providers are in the business of establishing and maintaining positive reputations for the IP addresses they control. ISPs and other organizations trust them not to send spam. Plus, they often filter traffic so harmful messages don’t go back out onto the internet.

When you send an email through a Smarthost, it looks as if it originated from their IP address. Because they have a good reputation, messages are much more likely to make it to their destination.

Some providers offer additional services, such as spam filtering and monitoring to let you know if users are abusing their accounts. If this sounds like the right solution for you and you have selected a provider, the next step is to configure your cPanel server to relay mail to the Smarthost.

What is an SMTP Relay?

You need to know a little about how email works to follow the configuration guide in the next section:

  • A user creates a message in a Mail User Agent (MUA) such as Roundcube, which is integrated into cPanel.
  • The MUA passes the message to a Mail Submission Agent (MSA), which hands it to a Mail Transfer Agent (MTA).
  • Messages may travel through multiple MTAs before they finally reach the Mail Delivery Agent (MDA) and the recipient’s inbox.

We’re interested in the mail transfer agent, the software behind SMTP relays. SMTP is the Simple Mail Transfer Protocol, the “language” MTAs use to communicate with each other. They accept incoming email, queue it, and then send it to another MTA or a mail delivery agent.

Our goal is to relay email through a Smarthost, which is just a sophisticated MTA. To do so, we have to configure Exim, cPanel’s built-in MTA, to tell it how to authenticate and relay messages.

How To Configure a Smarthost SMTP Relay in cPanel

Before we begin, you will need some information from your Smarthost provider, including:

  • The username and password of your account on the SMTP relay.
  • The relay’s IP address or domain name, including the port.

To configure Exim, open WHM and navigate to the Exim Configuration Manager in the Service Configuration section of the sidebar menu.

Exim Configuration Manager

Before you make any changes, be sure to back up the current Exim configuration in the Backup tab.

Exim Backup Config

Select the Advanced Editor tab. Search for the text “begin authenticators.” Below the entries for Dovecot® is a text box, into which you should enter your authentication details.

Exim Authentication

If you are unsure what to enter here, consult your Smarthost provider’s documentation. The basic format is as follows, but it may differ depending on the provider’s system:

mySmartHost_login: 
    driver = plaintext 
    public_name = LOGIN 
    client_send = : Username : Password

Replace “mySmartHost,” “Username,” and ”Password” with your information.

Next, we need to tell Exim where to send outgoing email. Search for “POSTMAILCOUNT,” and you will see a text box.

Exim Post Mail Count

In this section, we will tell Exim about the Smarthost and how to route mail to it. As before, the details you enter here depend on your provider, but the following is a basic template:

send_via_mySmartHost: 
driver = manualroute 
domains = !+local_domains 
transport = remote_smtp 
route_list = * smtp.example.com::25

These settings use the manualroute router to send all mail not addressed to local domains to port 25—the default SMTP port— on the server at “smtp.mysmarthost.com.” If you want to know more about the format of the route_list line, take a look at the Exim manualroute documentation.

It is also possible to enter the route configuration in the ROUTERSTART section instead of POSTMAILCOUNT, but doing so will stop some mail limits from working. We advise you to use POSTMAILCOUNT unless you have a good reason not to.

Finally, don’t forget to scroll to the bottom of the Exim Advanced Editor, where you’ll find the save button. Once you’ve done that, all email originating from your server is relayed through the Smarthost. 

A Smarthost is the fastest and most reliable way to improve email delivery for your clients. With cPanel & WHM, it’s straightforward to send your outgoing mail through a reputable SMTP relay, ensuring they reach their destination without interference from spam filters and blocklists.

As always, if you have any feedback or comments, please let us know. We are here to help in the best ways we can. You’ll find us on https://www.centriohost.com/contact-us/

Subscribe Now

10,000 successful online businessmen like to have our content directly delivered to their inbox. Subscribe to our newsletter!

Archive Calendar

SatSunMonTueWedThuFri
 1
2345678
9101112131415
16171819202122
23242526272829
3031 

Over 20000 Satisfied Customers!

  • web hosting reviewer
    Valerie Quinn
    CTO, Acteon Group

    Centriohost staff were fantastic, I had a concern with a domain and they got back to me very quickly and they helped me to resolve the issue! ~ . . . Read more

  • Joomla hosting reviewer
    Collin Bryan
    Photographer, Allister Freeman

    I'm using centrio for my portfolio since 2006. The transition was seamless, the support was immediate, and everything works perfectly. ~ . . . Read more

  • dedicated server reviewer
    Harry Collett
    Actor, A&J Artists

    Very easy to understand & use even though I am not very technologically minded. No complications whatsoever & I wouldn't hesitate to recommend it to all. ~ . . . Read more

  • vps web hosting reviewer
    Porfirio Santos
    Technician, Diageo PLC

    Centrio support team have been amazingly responsive and helpful to any of my queries, thank you so much to the Centriohost have been amazingly responsive and helpful to any of my queries 👍👍👍 ~ . . . Read more

  • wordpress hosting plans reviewer
    Catherine Auer
    Doctor, SmartClinics

    Anytime I've had a problem I can't solve, I've found Centriohost to be diligent and persistent. They simply won't let an issue go until the client is happy. ~ . . . Read more

  • reseller hosting reviewer
    Effectivo Social
    Freelancer, Fiverr

    Recommend their shared hosting for all my SME web design clients. Their cloud or VME offerings are too great to deal with. Pricing is perfect and suitable for all users (͠≖ ͜ʖ͠≖) 👌 ~ . . . Read more

Top