Introduction
It's becoming more common for datacenters to restrict emails from sending over port 25. Mailchannel is another Smarthost provider that allows mail to be sent over an alternative port using Exim.
Procedure
To use MailChannels you will need to configure Exim to authenticate with MailChannels using the credentials they provide you.
MailChannels does offer a plugin which allows for quick configuration options, please refer to their official documentation at
MailChannels cPanel & WHM plugin for Outbound Filtering
MailChannels cPanel & WHM Plugin for Inbound Filtering
To configure this in the WHM, please navigate to Main > Service Configuration > Exim Configuration Editor, click on the Advanced Editor button, and enter the following in Section:AUTH:
begin authenticators
mailchannels_login:
driver = plaintext
public_name = LOGIN
client_send = : MailChannelsUsername : MailChannelsPassword
Replace MailChannelsUsername and MailChannelsPassword with the username and password provided by MailChannels.
The next two sections can be used interchangeably. Use the POSTMAILCOUNT instructions to utilize cPanel max hourly mail limits if you use them. If max hourly limits are not in use, you can skip to the ROUTERSTART section. Do not configure both.
Section: POSTMAILCOUNT
If you want to use Max Hourly Email limits, you will need to utilize the POSTMAILCOUNT section.
remoteserver_route: driver = manualroute transport = mailchannels_smtp domains = !+local_domains route_list = * smtp.mailchannels.net::25 randomize byname
Section: ROUTERSTART
send_via_mailchannels:
driver = manualroute
domains = ! +local_domains
transport = mailchannels_smtp
hosts_randomize = true
route_list = * smtp.mailchannels.net::25 randomize byname
host_find_failed = defer
no_more
Add the following transport to the Section: TRANSPORTSTART configuration box as shown in the following image:
mailchannels_smtp:
driver = smtp
hosts_require_auth = *
tls_tempfail_tryclear = true
headers_add = X-AuthUser: ${if match {$authenticated_id}{.*@.*}\
{$authenticated_id} {${if match {$authenticated_id}{.+}\
{$authenticated_id@$primary_hostname}{$authenticated_id}}}}
To include DKIM, please also add:
dkim_domain = $sender_address_domain
dkim_selector = default
dkim_canon = relaxed
dkim_private_key = "/var/cpanel/domain_keys/private/${dkim_domain}"
If you use mailing lists, you'll also need to configure the following "mailman_virtual_transport".
Within the Exim Advanced Editor, scroll down to "Add additional configuration setting" and then add "mailman_virtual_transport"
headers_add = "X-MC-MailingList: $original_local_part@$original_domain\n"
mailman_virtual_transport:
driver = pipe
command = /usr/local/cpanel/3rdparty/mailman/mail/mailman \
'${if def:local_part_suffix \
{${sg{$local_part_suffix}{-(\\w+)(\\+.*)?}{\$1}}} \
{post}}' \
${lc:$local_part}_${lc:$domain}
current_directory = /usr/local/cpanel/3rdparty/mailman
home_directory = /usr/local/cpanel/3rdparty/mailman
user = mailman
group = mailman
headers_add = "X-MC-MailingList:$original_local_part@$original_domain\n"
Exim 4.94 in cPanel V94 requires an additional step. Please review Unable to send mail due to DKIM / Tainted errors in cPanel 94 when using Mailchanels as a smarthost
Once everything has been configured, click save.