# sendmail config
1. /etc/mail/access
2. /etc/mail/local-host-name
3. /etc/mail/sendmail.mc    # comment out 127.0.0.1 line
4. chkconfig sendmail on
 
# postfix  config
1. /etc/postfix/main.cf   #comment out inet=all interface
                                         #mydomain = example.com
                                         #myhostname = inst.example.com
                                         #mynetwork = 192.168.1.0/24,127.0.0.0/8
2. alternatives --config mta
3. service sendmail stop
4. servcie postfix start
5. chkconfig postfix on
 
# dovecot config
1. /etc/dovecot.conf   # comment out ssl line
                                     # comment out protocol line ,leave request pops or imaps
2. cd /etc/pki/tls/certs
3. make dovecot.pem
4. cp dovecot.pem /etc/pki/dovecot/certs
5. cp dovecot.pem /etc/pki/dovecot/privates
6. service dovecot restart
7. chkconfig dovecot on
 
#use iptables to limit 192.168.1.0/24##
iptables -I INPUT -s 192.168.1.0/24 -p tcp --dport 25 -j DROP
( restrict from smtp sendmail and postfix)
 
iptables -A INPUT -s 192.168.1.0/24 -p tcp --dport 993 995 -j DROP (restrict from dovecot imaps and pops)
 
service iptables save    # this command will keep the config over
reboot
 
#test sendmail and postfix via tealnet 25
telnet 192.168.1.10 25
helo  cache
mail from:[email protected]
data
uuuuuuuu
.
quit
 
#test access dovecot from remote machine#
mutt -f pops: //[email protected]
mutt -f imaps: //[email protected]