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 127.0.0.1, 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 127.0.0.1:25                0.0.0.0:*

 

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

# vi /etc/mail/sendmail.mc

 

From:

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

 

To

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

 

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

# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

 

Restart Sendmail Service:

# service sendmail restart

 

Check using this command:

# netstat -an | grep :25 | grep tcp

tcp        0      0 0.0.0.0:25                  0.0.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 “xyz.com”,”vyz.com”

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

xyz.com

vyz.com

 

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