Linux Sendmail Create

For Create Sendmail:

Install the following dependent package:

# yum install m4 telnet mailx

Check if sendmail is installed or not:

# rpm –qa | grep sendmail

then install the sendmail package using following command:

# yum install sendmail sendmail-cf

By default sendmail listen on local interface i.e, check using this command:

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

root      3595     1  0 00:20 ?        00:00:00 sendmail: accepting connections

smmsp     3604     1  0 00:20 ?        00:00:00 sendmail: Queue runner@01:00:00 for /var/spool/clientmqueue


# netstat -an | grep :25 | grep tcp

tcp        0      0      *


To configure the sendmail to listen to all interface at the host, just comment the following line in “”:

# vi /etc/mail/



DAEMON_OPTIONS(`Port=smtp,Addr=, Name=MTA’)dnl



dnl DAEMON_OPTIONS(`Port=smtp,Addr=, Name=MTA’)dnl


Now we need to build the “” file using m4 macro:

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


Restart Sendmail Service:

# service sendmail restart


Check using this command:

# netstat -an | grep :25 | grep tcp

tcp        0      0        *

Adding your domain entry in “/etc/mail/local-host-names” file:
Add all domains for which you will accept mail; there should be one domain per line.
For example, if this mail server was to accept mail for the domains “”,””

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


Restart the service of sendmail and make a entry for it to start at boot time:

# service sendmail restart

# chkconfig sendmail on



Firewall port that needs to be open for sendmail daemon machine:

# iptables -A INPUT -p tcp -m tcp –dport 25 -j ACCEPT


Save the Iptables rules and restart it.

service iptables save

service iptables restart


Tayfur BÖLER

Database Administrator



Bir cevap yazın

E-posta hesabınız yayımlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir