Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
cancel
Showing results for 
Search instead for 
Did you mean: 

sendmail is slow in linux

hanyyu1
Advisor

sendmail is slow in linux

I found the sendmail daemon have problem , if I send the mail to my mail box via sendmail is very slow , and it takes about 5 minutes to stop/start this daemon , ( i think it only need a few seconds to complete it ), could suggest what is wrong ? thx.
7 REPLIES
Vipulinux
Respected Contributor

Re: sendmail is slow in linux

Sendmail can be slow due to no of reasons: 1 what comes to mind is to check for the DNS Server MX records and see if there is latency out there.

Most sendmail issues seesm to be with name resolution, check your dns.

Cheers
Vipul
Muthukumar_5
Honored Contributor

Re: sendmail is slow in linux

May be a problem with hostname resolvation.

check these files and post informations,

a) /etc/nsswitch.conf file for hosts: entry
b) /etc/resolv.conf for dns
c) /etc/hosts

Check connectivity as,

a) nslookup
b) traceroute

to the destination user account mail Id server.

--
Muthu
Easy to suggest when don't know about the problem!
Steven E. Protter
Exalted Contributor

Re: sendmail is slow in linux

Shalom,

Its almost always DNS configuration, /etc/nsswitch.conf and more important /etc/resolv.conf that causes this.

It could be the DNS server itself if other machines with similar configurations are affected.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Stuart Browne
Honored Contributor

Re: sendmail is slow in linux

The delay stopping/starting the daemon is odd though.

Is this publicly exposed, and do you have a large mail queue? ('mailq -OMaxQueueRunSize=1;mailq -Ac -OMaxQueueRunSize=1' will show you how big the queues are).

Mind you, I've got a machine here with in excess of 20,000 messages in the queue, and sendmail still restarts within 2 seconds.
One long-haired git at your service...
hanyyu1
Advisor

Re: sendmail is slow in linux

thx replies,

yes , it should be the problem of resolve host name , if I add the host name to the /etc/hosts as below, it works perfect . But I concern whether this setting will affect the DNS lookup problem of the system, is there any impact of this setting ? thx

vi /etc/hosts

127.0.0.1 localhost.localdomain localhost my_host_name
Stuart Browne
Honored Contributor

Re: sendmail is slow in linux

Generally, if your machine has a static IP address, it's best to add the hostname on the line with the static address.

Recent distributions however have been adding the hostname to the 127.0.0.1 line, and this works alright for most things.

If you are not part of a network where this machine is acting for the mail server, then it's fine. If there are multiple machines using this one as a mail server, it should have a static IP and the hostname should be on a line in /etc/hosts on that line.
One long-haired git at your service...
Steven E. Protter
Exalted Contributor

Re: sendmail is slow in linux

How fast your system sends mail to itself is of little relavence, though I know its annoying when you are waiting for it to do something.

If the machine is expected to get mail to other machines, thats when DNS performance matters. So you need to make sure the response of your DNS servers, listed in /etc/resolv.conf is appropriate.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com