1829744 Members
1198 Online
109992 Solutions
New Discussion

sendmail and -qTIME

 
Fred Martin_1
Valued Contributor

sendmail and -qTIME

We started a discussion here at the office about how often sendmail should process the mail queue. It's set at 30 minutes on my system, why not 5 minutes?

If, for example, an outbound email can't be processed because my internet gateway is down for 3 minutes, why should the mail wait around for 30 minutes?

Is there any other reasoning beyond the resources used by the server to do the actual processing?
fmartin@applicatorssales.com
2 REPLIES 2
Steven E. Protter
Exalted Contributor

Re: sendmail and -qTIME

If you have a lot of users sending mail, you really don't want the sendmail daemon to eat the entire box.

Also, if you have a help desk, you want to give the mail a fair amount of time prior to bounce in case the DSL connection drops or there is some congestion.

Imagine a shop with 100 outbound emails a minute during a quick power cycle of the DSL modem. It could get ugly. That would generate 200 help desk calls in my ship.

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
Christopher Caldwell
Honored Contributor

Re: sendmail and -qTIME

-qTime is personal preference - we run it every 15 minutes.

Things to consider:
1) [generally] how long is the queue and how long does it take to process -- you [probably] don't want the queue more often than the average length of a single pass.
2) why is mail being queued?
-load
-transient failures
-host not found failures

Let's say you get a lot of host not found failures or domain must resolve failures; generally these types of failures won't resolve themselves; I wouldn't be too interested in running the queue more often to try an deliver mail that can't be delivered. Depending on how you have sendmail configured, you see a lot of failures like this because of spam (btw, you should be rejecting mail for domains that won't resolve).

Transient dns failures (because you have a slow resolver or the DNS of a customer is slow) can be mitigated by running the queue more often. In addition, if you queue mail for busy mail hubs, you can smooth out delay by running the queue more often.

For known failures (one of my hosts rejected mail for a significant amount of time), I run the queue by hand:

sendmail -v -q

you can also pick which messages to send:

sendmail -v -qR@faileddomain.com

attempts to send mail from the queue that has recipients
from faileddomain.com.

There are similar flags for senders and individual messages.

In short, use what suits you. There's nothing special about HP's stock default of 30 minutes.

Make your decision persist in /sbin/init.d/sendmail