Install and Setup Sendmail as Mail Relay

Install Sendmail

# yum install sendmail
# yum install sendmail-cf

Go to /etc/mail Directory
# cd /etc/mail

Edit File:

dnl #DAEMON_OPTIONS(`Port=smtp,Addr=, Name=MTA')dnl
dnl #FEATURE(`accept_unresolvable_domains')dnl
DAEMON_OPTIONS(`Port=smtp, Name=MSA, M=E')dnl

Recompile Sendmail Configuration

# m4 /usr/share/sendmail-cf/m4/cf.m4 ./ > ./

Add Allowed IPs to connect file, edit access file:

vi access
Connect:localhost RELAY
Connect: RELAY
Connect: xx.x.x.xx RELAY
Connect: xx.x.x.xx RELAY
Connect: xx.x.x.xx RELAY

Run makemap hash Command

# makemap hash ./access.db < ./access

CENTOS 6 Command

# service sendmail start | stop | restart

CENTOS 7 Command

# systemctl start | stop | restart sendmail

Be the first to comment

Leave a Reply

Your email address will not be published.