Difference between revisions of "Configure Sendmail Relays - CentOS 7"

From Michael's Information Zone
Jump to navigation Jump to search
(Created page with "<ref>http://serverfault.com/questions/215388/how-to-configure-sendmail-to-relay-through-a-specific-server</ref> Looking in the /etc/mail/sendmail.mc file add a smarthost entry...")
 
Line 1: Line 1:
 +
==Purpose==
 +
To configure sendmail to send email.
 +
==Basic Relay Config==
 +
This will change the server you send emails through, instead of looking up MX records and sending directly to the recipient. Such as Amazon SES<br>
 
<ref>http://serverfault.com/questions/215388/how-to-configure-sendmail-to-relay-through-a-specific-server</ref> Looking in the /etc/mail/sendmail.mc file add a smarthost entry that looks like the following
 
<ref>http://serverfault.com/questions/215388/how-to-configure-sendmail-to-relay-through-a-specific-server</ref> Looking in the /etc/mail/sendmail.mc file add a smarthost entry that looks like the following
 
<br>
 
<br>
 
  define(`SMART_HOST', `insidemail.tld')dnl
 
  define(`SMART_HOST', `insidemail.tld')dnl
 
I had to use a fqdn and a host entry to resolve it with. There is a way to use an IP but I have not spent enough time working on this. Just needed it to send mail internally for now.
 
I had to use a fqdn and a host entry to resolve it with. There is a way to use an IP but I have not spent enough time working on this. Just needed it to send mail internally for now.
 +
==SMTP Authentication==
 +
For when you want to send emails using an external SMTP server that requires authentication.<ref>https://unix.stackexchange.com/questions/204299/centos-sendmail-smtp-smarthost-with-authentication</ref>
 +
<pre>
 +
yum install sendmail sendmail-cf
 +
sed -i 's/smtp\.your\.provider/email-smtp\.us-east-1\.amazonaws\.com/; s/^dnl\ define(`SMART/define(`SMART/' /etc/mail/sendmail.mc
 +
</pre>

Revision as of 11:41, 4 May 2018

Purpose

To configure sendmail to send email.

Basic Relay Config

This will change the server you send emails through, instead of looking up MX records and sending directly to the recipient. Such as Amazon SES
[1] Looking in the /etc/mail/sendmail.mc file add a smarthost entry that looks like the following

define(`SMART_HOST', `insidemail.tld')dnl

I had to use a fqdn and a host entry to resolve it with. There is a way to use an IP but I have not spent enough time working on this. Just needed it to send mail internally for now.

SMTP Authentication

For when you want to send emails using an external SMTP server that requires authentication.[2]

yum install sendmail sendmail-cf
sed -i 's/smtp\.your\.provider/email-smtp\.us-east-1\.amazonaws\.com/; s/^dnl\ define(`SMART/define(`SMART/' /etc/mail/sendmail.mc