Install Sendmail in CentOS 6

1. Install the following packages

# yum install m4 telnet mailx

2. Check if sendmail is already installed

# rpm -qa | grep sendmail

If not, install sendmail

# yum install sendmail sendmail-cf

Sendmail configuration files are in /etc/mail directory.

Sendmail listens on local interface i.e.

# ps -ef | grep -v grep | grep -i sendmail

#netstat -tulnp | grep :25 | grep tcp

# vi /etc/mail/

Adapt the file as per the smtp settings as explained later.

# Build the file using m4 macro

# m4 /etc/mail/ > /etc/mail/

Add the domains for which you will accept mail, such that one domain is added per line. If this mail server has to accept mails for the domains and, then

# vi /etc/mail/local-host-names

Add sendmail to start script

# chkconfig –add sendmail

Restart sendmail service

# service sendmail restart

Reboot the machine

# reboot

To check the log from sendmail, check the maillog file in /var/log/maillog

# tail -f /var/log/maillog