CentOS 7: sendmail

  LEMP

Probably want this installed,

yum install sendmail sendmail-cf m4

Now edit /etc/mail/sendmail.mc uncommenting out:

dnl #
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
dnl #

Though you’re probaby locked down and protected from external servers using your sendmail (don’t be an open relay) you can still lock down who can send by adding FEATURE(`relay_hosts_only’)dnl above the mailer options:
FEATURE(`relay_hosts_only')dnl
MAILER(smtp)dnl

Now add your hosts e.g.
hostname >> /etc/mail/relay-domains

Recompile, restart, enable;
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
systemctl restart sendmail
systemctl enable sendmail

You can also add/update your SPF record to auth your server to send mail as your domain.