It’s a mail server.

Step1. Install Postfix

yum remove sendmail
yum install postfix

Step2. Set MTA.

alternatives --set mta /usr/sbin/sendmail.postfix

Step3. Configure Postfix

vi  /etc/postfix/ 

myhostname =
mydomain =
myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname, localhost, $mydomain
mynetworks =
relay_domains = $mydestination
home_mailbox = Maildir/

Step4. Restart service

systemctl restart postfix.service
systemctl enable postfix.service

Step5. Open Firewall Port if required

iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 25 -j ACCEPT
iptables -A INPUT -m state --state NEW -m udp -p udp --dport 25 -j ACCEPT

Step6. Monitor logs

tail -f  /var/log/maillog

Step7. Send the test mail to test user

echo "test mail" | mailx -s Test
tail -f /var/log/maillog


Please enter your comment!
Please enter your name here