{"id":56501,"date":"2020-08-07T11:13:41","date_gmt":"2020-08-07T16:13:41","guid":{"rendered":"https:\/\/blog.cpanel.com\/?p=56501"},"modified":"2020-08-07T11:13:41","modified_gmt":"2020-08-07T16:13:41","slug":"how-to-set-up-a-smarthost-smtp-relay-with-cpanel","status":"publish","type":"post","link":"https:\/\/devel.www.cpanel.net\/blog\/tips-and-tricks\/how-to-set-up-a-smarthost-smtp-relay-with-cpanel\/","title":{"rendered":"How to Set Up a Smarthost SMTP Relay with cPanel"},"content":{"rendered":"\n
Do your users\u2019 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. <\/p>\n\n\n\n
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\u2019t 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.<\/p>\n\n\n\n
Relaying messages through a Smarthost is one of the most reliable ways to solve delivery issues. In this article, we\u2019re 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.<\/p>\n\n\n\n
First, let\u2019s consider why the internet\u2019s spam-fighting system might have a low opinion of messages sent from your server.<\/p>\n\n\n\n
In our recent article about configuring SpamAssassin with cPanel<\/a>, 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.<\/p>\n\n\n\n If a server\u2019s IP address gets a bad reputation, its emails are going nowhere, but how does an IP become notorious in the first place?<\/p>\n\n\n\n It may be possible to re-establish an IP\u2019s 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\u2019t the only one. Domain reputation<\/a> plays an increasing role, as do verification and authentication technologies such as SPF and DKIM<\/a>.<\/p>\n\n\n\n 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.<\/p>\n\n\n\n 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.<\/p>\n\n\n\n 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.<\/p>\n\n\n\n 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.<\/p>\n\n\n\n You need to know a little about how email works to follow the configuration guide in the next section:<\/p>\n\n\n\n We\u2019re interested in the mail transfer agent, the software behind SMTP relays. SMTP is the Simple Mail Transfer Protocol, the \u201clanguage\u201d 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.<\/p>\n\n\n\n Our goal is to relay email through a Smarthost, which is just a sophisticated MTA. To do so, we have to configure Exim, cPanel\u2019s built-in MTA, to tell it how to authenticate and relay messages.<\/p>\n\n\n\n Before we begin, you will need some information from your Smarthost provider, including:<\/p>\n\n\n\n To configure Exim, open WHM and navigate to the Exim Configuration Manager<\/em> in the Service Configuration<\/em> section of the sidebar menu.<\/p>\n\n\n\n Before you make any changes, be sure to back up the current Exim configuration in the Backup<\/em> tab.<\/p>\n\n\n\n Select the Advanced Editor<\/em> tab. Search for the text \u201cbegin authenticators.\u201d Below the entries for Dovecot\u00ae is a text box, into which you should enter your authentication details.<\/p>\n\n\n\n If you are unsure what to enter here, consult your Smarthost provider\u2019s documentation. The basic format is as follows, but it may differ depending on the provider\u2019s system:<\/p>\n\n\n\n mySmartHost_login:\u00a0 Replace \u201cmySmartHost,\u201d \u201cUsername,\u201d and \u201dPassword\u201d with your information.<\/p>\n\n\n\n Next, we need to tell Exim where to send outgoing email. Search for \u201cPOSTMAILCOUNT,\u201d and you will see a text box.<\/p>\n\n\n\n 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:<\/p>\n\n\n\n send_via_mySmartHost:\u00a0 These settings use the manualroute router to send all mail not addressed to local domains to port 25\u2014the default SMTP port\u2014 on the server at \u201csmtp.mysmarthost.com.\u201d If you want to know more about the format of the route_list line, take a look at the Exim manualroute documentation<\/a>.<\/p>\n\n\n\n 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.<\/p>\n\n\n\n Finally, don\u2019t forget to scroll to the bottom of the Exim Advanced Editor<\/em>, where you\u2019ll find the save button. Once you\u2019ve done that, all email originating from your server is relayed through the Smarthost. <\/p>\n\n\n\n A Smarthost is the fastest and most reliable way to improve email delivery for your clients. With cPanel & WHM, it\u2019s straightforward to send your outgoing mail through a reputable SMTP relay, ensuring they reach their destination without interference from spam filters and blocklists.<\/p>\n\n\n\n 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\u2019ll find us on Discord<\/a>, the cPanel forums<\/a>, and Reddit<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":" Do your users\u2019 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 […]<\/p>\n","protected":false},"author":77,"featured_media":65457,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[61],"tags":[],"class_list":["post-56501","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tips-and-tricks"],"acf":[],"yoast_head":"\nWhat is a Smarthost?<\/strong><\/h2>\n\n\n\n
What is an SMTP Relay?<\/strong><\/h2>\n\n\n\n
How To Configure a Smarthost SMTP Relay in cPanel<\/strong><\/h2>\n\n\n\n
<\/figure>\n\n\n\n
<\/figure>\n\n\n\n
<\/figure>\n\n\n\n
\u00a0 \u00a0 driver = plaintext\u00a0
\u00a0 \u00a0 public_name = LOGIN\u00a0
\u00a0 \u00a0 client_send = : Username : Password<\/em>
<\/p>\n\n\n\n<\/figure>\n\n\n\n
\u00a0 \u00a0 driver = manualroute\u00a0
\u00a0 \u00a0 domains = !+local_domains\u00a0
\u00a0 \u00a0 transport = remote_smtp\u00a0
\u00a0 \u00a0 route_list = * smtp.example.com::25<\/em>
<\/p>\n\n\n\n