It’s a mail server.

Prerequisite :

Setting up DNS for your domain (xyz.com) is to use the MX record

Step1. Install the packages

yum install m4 telnet mailx  sendmail sendmail-cf -y

Step2. Configure the mail server

ps -ef | grep -v grep | grep -i sendmail
 
vi /etc/mail/sendmail.mc
 
From:
         DAEMON_OPTIONS(Port=smtp,Addr=127.0.0.1, Name=MTA')dnl    
To:       
        dnl DAEMON_OPTIONS(Port=smtp,Addr=127.0.0.1, Name=MTA')dnl

Step3. Run command

m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

Step4. Restart the service

service sendmail restart

Step5. Add domain entry

vi /etc/mail/local-host-names
xyz.com
xyz.co.in

Step6. Restart the service

systemctl restart sendmail
systemctl enable sendmail

Step6. Validation and Testing

useradd testuser1
useradd testuser2
$ mail -s "Test mail from testuser1" testuser2

Step7. Check logs

tail -f /var/log/maillog

Step8. Check mail

$ mail

Step9. Allow port

iptables -A INPUT -p tcp -m tcp –dport 25 -j ACCEPT

Step10. Save/restart service

service iptables save
service iptables restart

LEAVE A REPLY

Please enter your comment!
Please enter your name here