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/main.cf
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
2
 
iptables -I INPUT -s 192.168.0.0/24 -p tcp –dport 25 -j ACCEPT
 
echo ‘ test’ | mail -s ‘this is a test’ rocky@localhost
 
 
Advertisements