Skip to main content
This guide walks you through configuring Sendmail to relay all outbound mail through MailChannels Outbound Filtering.
Sendmail requires libsasl to send authentication requests to MailChannels servers. The saslauthd daemon is not required unless you plan to receive authentication requests on the same server. See the Sendmail SASL support page for more information.

Prerequisites

  • Root or sudo access to your Sendmail server
  • Your MailChannels SMTP username and password
  • libsasl installed on your server

Configure the relay

1

Add authentication credentials

Sendmail stores SMTP credentials in /etc/mail/access. Add the following line to the file, replacing the placeholders with your actual MailChannels SMTP username and password:
/etc/mail/access
AuthInfo:smtp.mailchannels.net "U:MailChannelsSMTPUsername" "P:MailChannelsSMTPPassword" "M:PLAIN"
Do not use your MailChannels Console login username here. The SMTP authentication username is different — it is the account ID provided in your activation email.
2

Configure the smart host

Edit /etc/mail/sendmail.mc and add the following lines to set MailChannels as the smart host. Add lines 1, 3, and 4 around the existing FEATURE line (line 2):
/etc/mail/sendmail.mc
define(`SMART_HOST', `smtp.mailchannels.net')dnl
FEATURE(`access_db')dnl
define(`RELAY_MAILER_ARGS', `TCP $h 25')dnl
define(`ESMTP_MAILER_ARGS', `TCP $h 25')dnl
Also comment out the following line in the same file if it is present:
/etc/mail/sendmail.mc
# FEATURE(`access_db', , `skip')dnl
3

Add the X-AuthUser header

Append the following lines just before the MAILER DEFINITIONS section in /etc/mail/sendmail.mc. This adds an authenticated sender header that MailChannels uses to track per-sender reputation:
/etc/mail/sendmail.mc
LOCAL_CONFIG
HX-AuthUser: ${auth_authen}
The X-AuthUser header is only added when the sender is authenticated. Messages without this header are treated as forwarded mail and subject to different policies.
4

Compile the configuration and restart Sendmail

Run the following commands as root to compile the updated configuration files:
cd /etc/mail
m4 sendmail.mc > sendmail.cf
makemap hash access < access
Then restart Sendmail. On newer distributions:
service sendmail restart
On older distributions:
/etc/init.d/sendmail restart