Operating System - HP-UX
1819804 Members
3169 Online
109607 Solutions
New Discussion юеВ

Deferred Mail queue flush in Sendmail

 
SOLVED
Go to solution
Sanjay Duhan
Occasional Contributor

Deferred Mail queue flush in Sendmail

Hello all,

I have a sendmail 8.8.6 on HP UX 10. I do not use DNS and was able to forward mails to DSsmarthost.com (after a lot of sweat). I some times see a lot of deferred mails in the queue which I presume comes when the smarthost is unreachable. Now wehn the smarthost comes up, the queue still waits there (maybe sendmail will try after some timeout). Is there a way to flush this queue immidiately.
I tired restarting sendmail but to no use.


Thanx a lot.
Sanjay Duhan
8 REPLIES 8
Michael Steele_2
Honored Contributor

Re: Deferred Mail queue flush in Sendmail

This is the -q parameter in sendmail. For example the usual startup syntax of sendmail is :

sendmail -bd -q30m

The -q30m is check the queue every 30 minutes.

If you reduce this to 5m then that's check every 5 minutes.

sendmail -bd -q5m

Support Fatherhood - Stop Family Law
Robin Wakefield
Honored Contributor
Solution

Re: Deferred Mail queue flush in Sendmail

Hi,

And if you want to do a one-off queue run:

sendmail -q

will process each message in the queue (add the -v option for logging).

rgds, Robin
Tim Maletic
Valued Contributor

Re: Deferred Mail queue flush in Sendmail

If you have no need to run sendmail as a daemon, it's probably a good idea to have root's cron run a "sendmail -q" every hour or so. -Tim

Re: Deferred Mail queue flush in Sendmail

Hi Sanjay,

sendmail is started with -q30m, which means that a queue run will be done every 30 minutes. You can do a queue run manually with sendmail -q from the command line (better also -v). If you want to change the interval sendmail is automatically doing the queue run, you have to change this in the startup script /sbin/init.d/sendmail.

Regards,

Birgit
Ron Cornwell
Trusted Contributor

Re: Deferred Mail queue flush in Sendmail

By default, when sendmail starts up it will try to flush the sendmail queue every 30 minutes. To flush it immediately, run sendmail -q from the command line.
Jean-Louis Phelix
Honored Contributor

Re: Deferred Mail queue flush in Sendmail

Hi,

Perhaps this is related to your system load average. There is a parameter in /etc/mail/sendmail.cf to change the average load after which sendmail will start to defer messages instead of sending. Default value is 8, but you could try to increase it. Search for keyword "load" in sendmail.cf. There are a lot of comments.

Regards.
It works for me (┬й Bill McNAMARA ...)
Jeff Schussele
Honored Contributor

Re: Deferred Mail queue flush in Sendmail

Hi Sanjay,

Another parameter to look at is
O Timeout.queuereturn
This is the max time value used to hold the msg & retry sending. If after the value, the mail cannot be delivered, it will be returned to sender.
This is set in the /etc/mail/sendmail.cf file & the default is 5 days.

There is a companion option named
O Timeout.queuewarn
This sets the time value where a warning msg is sent to sender if the msg cannot be delivered for whatever reason.
Again in sendmail.cf & default is 4 hours

You may have msgs "stuck" in the queue simply due to misaddressing or problems on the receiving end. They will be pruned out according to the time setting in the first parameter above. Senders receive notice of non-delivery according to the time setting in the latter.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Steven E. Protter
Exalted Contributor

Re: Deferred Mail queue flush in Sendmail

Diagnostic tool:

/usr/sbin/sendmail -v -d8.99 -d38.99 stevenprotter@juf.org > /tmp/sendmail.out

Run this type a line of text
hit enter
type a dot(period) .
hit enter

You will get good diagnostics.

A common problem is that if you are doing mail relay with the DS directive in sendmail.cf, and the mail relay server is rejecting your mail.

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