Operating System - HP-UX
1825596 Members
3227 Online
109682 Solutions
New Discussion

Sendmail -> Mailq shows lot of deferred connections...

 
HPP
Regular Advisor

Sendmail -> Mailq shows lot of deferred connections...

Hi,
I am using sendmail on HP-UX 11.00. We are using the server for e-mail. Everyday more than 80000 mails are sent out from this server.
When i run "mailq", it shows lot of connections as "Host Map: lookup(abc.com): deferred" or its shows "Deferred: connection timed out with xyz.com" OR it shows "Deferred: No route to host".
Is their a way to clear all the "Deferred" connection from the mailq?

I feel because of this if i send a mail, it takes lot of time(like 2 hour) to send it out.

Thanks in advance

PAD
Be Teachable
6 REPLIES 6
Dave Kelly_1
Respected Contributor

Re: Sendmail -> Mailq shows lot of deferred connections...

You should check several things.

If you are using DNS, make sure that you have the correct IP addresses for your nameservers in /etc/resolv.conf, also check the permissions allow read access for all.

You can check whether name lookup is successful by running nslookup (without any parameters).

This will give you an indication as to whether the DNS servers can be contacted.

If you are not using DNS, you need to modify /etc/nsswitch.conf so that the hosts: line is:

hosts: files

It is then up to you to make sure that you have all the IP addresses and server names in /etc/hosts.

Again, check that your permissions allow read access for all.


Messages like "No route to host" indicates that you may have a broader network problem but it always makes sense to check the easier things first like name resolution.
Maureen Gunkel
Trusted Contributor

Re: Sendmail -> Mailq shows lot of deferred connections...

Padmanabha:
A very useful link is www.sendmail.org
I used it to familiarize myself with it when I first started using it (at the suggestion of one of the forum gurus!)
HTH
No matter where you go, there you are.
HPP
Regular Advisor

Re: Sendmail -> Mailq shows lot of deferred connections...

Dave,
thanks for reply...I appreciate it....
From this server we are sending daily more than 80000 mails. I don't thint its problem with resolv.conf OR nsswitch.conf. Resolv.conf and nsswitch is looks fine. I am able to resolve domain from nslookup.
I want to know how clear all the deferred connections thats are showing when i run mailq command? At this point of time i am seeing around 500 deferred messages in mailq.

I need help...

Thanks

Be Teachable
Dale Barnes
Advisor

Re: Sendmail -> Mailq shows lot of deferred connections...

You can use the following script, assuming your mail queue is in /var/spool/mqueue (if not change the variable):

#!/usr/bin/sh
set -u
Q=/var/spool/mqueue
find $Q -type f -follow -name 'qf*' -print|&
while read -p QF
do
IDENT=$(echo $QF | sed -e "s,^$Q/qf,,")
grep "^R" $Q/qf$IDENT
echo "delete ${IDENT}? (y/n) \c"
read answer
case $answer in
[nN]*) continue;;
*) ;;
esac
rm -f $Q/*${IDENT}
done

good luck.
"I try to avoid experience; most experience is bad." - Wilde
Kofi ARTHIABAH
Honored Contributor

Re: Sendmail -> Mailq shows lot of deferred connections...

Hi PAD:

For that volume of e-mails being sent out, you are likely to encounter servers that are busy/down/ with badly formed MX records and others.

That is why sendmail defers mails that it is not able to send - so that it retries the send process after a preset time. If you want to manually resend (or attempt to resend) the messages try:

# sendmail -q -v
(the verbose messages will show on the console)

Sometimes, if there is a network problem, you would have to manually clear the queue with the above command (expecially if sendmail is not running as a daemon)

Also, the issue about your resolvers (/etc/resolv.conf) comes to play if your DNS servers tend to be "busy" and therefore do not return responses in the time required.

when sendmail is started in daemon mode

#sendmail -bd -qxx,

(where xx=15m means 15 minutes)

you can specify how often sendmail should attempt to clear its queue.

Check your sendmail startup script (/sbin/init.d/sendmail )to verify that the retry time is acceptable, otherwise, modify it accordingly and restart sendmail.

nothing wrong with me that a few lines of code cannot fix!
Shannon Petry
Honored Contributor

Re: Sendmail -> Mailq shows lot of deferred connections...

The best way is just issue...
>/usr/sbin/sendmail -q

This forces sendmail to process it's queue immediately, and flush all unprocessed mail after.

This can be set in a cron job, during non-peak hours. Since your server is busy, pick the time when normal mail may not be processing....

Also remember that other people's mail servers may be down. Sendmail queues the mail for 5 days waiting for mail to be delivered. You can change this in the sendmail.cf file and reduce it as you need.

NOTE: Since there are so many exchange servers crashing on the net, 5 days may not be too unreasonable.....ha ha!


Regards,
Shannon
Microsoft. When do you want a virus today?