How to setup Sendmail to use SMTP with Outmail
How to setup a Mail Relay in sendmail?
Follow the guide below to configure sendmail to use outMail as a Internet Mail Relay.
This article is written for sendmail version 8.11+ and although tested on Centos6, should be applicable for other distributions.
It already assumes your server has sendmail 8.11+ installed already, it has correctly configured access to the Internet and you have a terminal connection to your server with the necessary access rights to manage and administer sendmail.
You need to edit the /etc/mail/sendmail.mc file.
There should be a line like below:
dnl define(`SMART_HOST', `smtp.your.provider')dnl
The dnl stands for 'delete till new line' and so effectively comments out the whole line. Remove the FIRST 'dnl' and space and replace the 'smtp.your.provider' with the Outmail server you were sent when you signed up. The line should look like:
NOTE - strings in this file are started with the 'backtick' character ( ` ) and ended with the apostrophe character ( ' )
We now need to setup the authentication.
Further down the file, there are a number of lines starting with FEATURE( , we need to add a new line immediately after these that looks like: (remember to check the ` and ' )
Save the file.
Now create a new file called /etc/mail/authinfo containing the following line (replace mx??????, USERNAME and PASSWORD with the case-sensitive credentials you were provided with):
AuthInfo:mx??????.smtp-engine.com "U:USERNAME" "P:PASSWORD"
Make sure that the hostname matches that in the sendmail.mc file
If you don't have sendmail-cf installed, install it using:-
yum install sendmail-cf
Now you can rebuild the sendmail configuration with
make -C /etc/mail
Summary of server details
Uninstalling / Removing outMail
To change your outgoing SMTP server settings away from outMail simply follow the setup guide above and where asked to enter the outgoing SMTP mail server address and login credentials please use those provided to you for the service provider you are moving to.