Introduction
It's becoming more common for data centers 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 that allows for quick configuration options. For details, please refer to their official documentation at
MailChannels cPanel & WHM plugin for Outbound Filtering
MailChannels cPanel & WHM Plugin for Inbound Filtering
- Sign up for MailChannels
- 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:
-
mailchannels_login:
driver = plaintext
public_name = LOGIN
client_send = : MailChannelsUsername : MailChannelsPassword - Replace MailChannelsUsername and MailChannelsPassword with the username and password provided by MailChannels.
-
- Next, go to the "Section: POSTMAILCOUNT" section, and input the following:
Please note that if outbound TCP port 25 is blocked, you will have to replace the port number on theroute_list
line with 2525 or 587.
- On v108 or above:
send_via_mailchannels:
driver = manualroute
domains = ! +local_domains : ! +manualmx_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} \
{mailchannels_smtp} {mailchannels_forwarded_smtp}}
.else
transport = mailchannels_smtp
.endif
route_list = * smtp.mailchannels.net::25 randomize byname - On v106 or below:
send_via_mailchannels:
driver = manualroute
transport = mailchannels_smtp
domains = ! +local_domains : ! +manualmx_domains
route_list = * smtp.mailchannels.net::25 randomize byname
- On v108 or above:
- Then go to the "Section: TRANSPORTSTART" section. Input the following into the text box:
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}}}}
dkim_domain = ${perl{get_dkim_domain}}
dkim_selector = default
dkim_canon = relaxed
dkim_private_key = "/var/cpanel/domain_keys/private/${dkim_domain}"
message_linelength_limit = 2048 - Additionally, on servers running v108 or above, add the following to the TRANSPORTSTART section as well:
.ifdef SRSENABLED
mailchannels_forwarded_smtp:
driver = smtp
hosts_require_auth = *
max_rcpt = 1
return_path = ${srs_encode {SRS_SECRET} {$return_path} {$original_domain}}
tls_tempfail_tryclear = true
headers_add = X-AuthUser: ${if match {$authenticated_id}{.*@.*}\
{$authenticated_id} {${if match {$authenticated_id}{.+}\
{$authenticated_id@$primary_hostname}{$authenticated_id}}}}
dkim_domain = ${perl{get_dkim_domain}}
dkim_selector = default
dkim_canon = relaxed
dkim_private_key = "/var/cpanel/domain_keys/private/${dkim_domain}"
.endif - Go to the bottom of the page and click "Save." The changes will be added to the Exim configuration and 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.
Mailing Lists
If you use mailing lists, you must also configure the following in "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"
Once everything has been configured, click save.
Comments
0 comments
Article is closed for comments.