EasySMTP

Sample Sendmail configuration for SMTP Servers

This configuration will work with Sendmail 8.1+ which has Cyrus SASL and SSLv3/TLSv1 encryption built in by default. If you’re using an older version of Sendmail, consult the Sendmail manual for information on building with SASL and SSL/TLS support.

To begin locate the Sendmail configuration files. In most distributions this will be at /etc/mail. If that’s not the case on your system try 'locate sendmail.mc' and note the path to that file; that will be the location of your Sendmail configuration files.

Add a file called 'authinfo' Note that in sendmail 8.12+ there’s no need to add this file, the authorization entry can be added directly to the /etc/mail/access file

$ touch /etc/mail/authinfo

Add the following to the Sendmail access file. Don’t forget to replace accountid, user, and password with your account login details. Note that the domain defined here must match exactly what is defined by the SMART_HOST definition in sendmail.mc.

$ echo 'AuthInfo:ssrs.reachmail.net "U:accountiduser" "I:accountiduser" "P:P@55w0rd" "M:PLAIN"' >> /etc/mail/authinfo

Add the following to sendmail.mc. Note that the path to authinfo.db will need to be adjusted if your Sendmail installation is not in the default location.

...
define(`confAUTH_MECHANISMS', `PLAIN')dnl
define(`SMART_HOST', `ssrs.reachmail.net')dnl
FEATURE(`authinfo', `hash /etc/mail/authinfo.db')dnl
...

Rebuild the authinfo database and the Sendmail configuration, restart Sendmail and test. Note that your command to restart Sendmail may differ

$ chmod 600 /etc/mail/authinfo
$ makemap hash /etc/mail/authinfo < /etc/mail/authinfo
$ newaliases
$ make -C /etc/mail
$ /sbin/service sendmail restart
$ sendmail -Am -v -t
To: user@domain.tld
From: other.user@domain.tld
Subject: An Easy SMTP test
 
This is the test body
 
CTRL-D

Special Configurations

Relaying based on envelope sender

To make Sendmail selectively relay through Easy-SMTP, try using `smarttable` definitions to relay based on the envelope sender.

Entries for the `smarttable` file should be formatted as .

To begin, add an entry to the `smarttable` file. Note that we’re assuming a default Sendmail configuration location of /etc/mail.

$ echo "user@some-domain.tld ssrs.reachmail.net" >> /etc/mail/smarttable
$ makemap hash /etc/mail/smarttable < /etc/mail/smarttable

Add the following to sendmail.mc

...
FEATURE(`smarttable')dnl
...

Rebuild the access database and the Sendmail configuration, restart Sendmail and test. Note that your command to restart Sendmail may differ

$ make -C /etc/mail
$ /sbin/service sendmail restart
$ sendmail -Am -v -t
To: user@domain.tld
From: user@some-domain.tld
Subject: An Easy SMTP test
 
This is the test body
 
CTRL-D