Many providers now block outbound connections on port 25, which means that a cPanel system would need to configure a Smarthost to allow for outbound emails to function. This resource covers how to set up a Smarthost using a common 3rd-party mail provider, MailJet.
Procedure
MailJet has several plans, including a free tier that allows for up to 6000 monthly, and 200 daily emails to be sent.
The MailJet smarthost setup instructions are similar to the SendGrid smarthost setup instructions. The main difference with MailJet is that it uses "ROUTERSTART" instead of "PREROUTERS".
- Sign up for Mailjet
- Log in to WHM, and navigate to "WHM / Service Configuration / Exim Configuration Manager / Advanced Editor." On this page, search for "Section: AUTH". In the text box, input the following:
- In the Section: AUTH area, add:
-
mailjet_login:
driver = plaintext
public_name = LOGIN
client_send = : USERNAME : PASSWORD - Your login information can be found within the MailJet interface.
-
- Next, go to the "Section: ROUTERSTART" section, and input the following:
- On v108 or above:
send_via_mailjet:
driver = manualroute
domains = ! +local_domains
.ifdef SRSENABLED
# if outbound, and forwarding has been done, use an alternate transport
transport = ${if eq {$local_part@$domain} \
{$original_local_part@$original_domain} \
{mailjet_smtp} {mailjet_forwarded_smtp}}
.else
transport = mailjet_smtp
.endif
route_list = * in-v3.mailjet.com - On v106 or below:
send_via_mailjet:
driver = manualroute
domains = ! +local_domains
transport = mailjet_smtp
route_list = * in-v3.mailjet.com
- On v108 or above:
- Then go to the "Section: TRANSPORTSTART" section. Input the following into the text box:
mailjet_smtp:
driver = smtp
port = 587
hosts = in-v3.mailjet.com
hosts_require_auth = in-v3.mailjet.com - Additionally, on servers running v108 or above, add the following to the TRANSPORTSTART section as well:
.ifdef SRSENABLED
mailjet_forwarded_smtp:
driver = smtp
hosts = in-v3.mailjet.com
hosts_require_auth = in-v3.mailjet.com
max_rcpt = 1
return_path = ${srs_encode {SRS_SECRET} {$return_path} {$original_domain}}
.endif - Go to the bottom of the page and click "Save". The changes will get added to the Exim configuration and will automatically restart the Exim service.
- Try sending a test email using one of the Webmail applications. If the email does not leave the server, you must examine the /var/log/exim_mainlog file to determine the cause of the issue.
Notes
This guide is a task intended for system administrators. cPanel's Technical Analysts cannot provide assistance in configuring a server's smarthost setup.
Configuring a smarthost will cause all outbound emails to go through the configured provider. The scope of this document does not cover how to configure a subset of domains to go through a smarthost; this must be configured by the system administrator of the server.
Resources
How to Set a Third-Party Smarthost
How to use SendGrid as a Smarthost
How to use MailGun as a Smarthost
How to use MailChannels as a Smarthost
How to use Amazon SES as a Smarthost
cPanel Documentation | Exim Configuration Manager - Basic Tab