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/main.cf 

myhostname = tech.example.com
mydomain = example.com
myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname, localhost, $mydomain
mynetworks = 192.168.33.81
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 test1@techservicedoc.com
tail -f /var/log/maillog

LEAVE A REPLY

Please enter your comment!
Please enter your name here