It’s a mail server.

Prerequisite :

Setting up DNS for your domain ( 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/
         DAEMON_OPTIONS(Port=smtp,Addr=, Name=MTA')dnl    
        dnl DAEMON_OPTIONS(Port=smtp,Addr=, Name=MTA')dnl

Step3. Run command

m4 /etc/mail/ > /etc/mail/

Step4. Restart the service

service sendmail restart

Step5. Add domain entry

vi /etc/mail/local-host-names

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


Please enter your comment!
Please enter your name here