This is a very simple postfix example, plus iptables
1. install postfix, change it into the default email sender
yum install postfix -y
vim /etc/postfix/
turn inet_interface=all on and turn inet_interface=localhost off
service sendmail stop
chckconfig sendmail off
service postfix start
chkconfig postfix on
alternative –config mta
iptables -I INPUT -s -p tcp –dport 25 -j ACCEPT
echo ‘ test’ | mail -s ‘this is a test’ rocky@localhost