Koozali.org: home of the SME Server

How long retry before failing?

Christo Pretorius

How long retry before failing?
« on: August 30, 2000, 03:54:03 PM »
Hi,

I'd like to know for how long e-smith keeps an undeliverable message in
the queue before removing it and informing the sender that it was undeliverable.
I've had messages in the queue for up to 10 days waiting to be delivered.
Eventually, I deleted them myself.

Furthermore, if a message has been in the queue, say for 2 days, does
it carry a higher priority than a message which has just arrived in the
queue? Thus would e-smith try to deliver the 2 day old message before
it tries to deliver the new message (even though it has already tried
numerous times to deliver the 2 day old message)?

Any info would be greatly appreciated.

Regards,
Christo Pretorius

Peter Samuel

RE: How long retry before failing?
« Reply #1 on: August 30, 2000, 07:23:12 PM »
By default, qmail will wait for one week before deciding that a message could not be delivered.

If you wish to change this value, you'll need to create a file called

   /var/qmail/control/queuelifetime

and its contents will be the number of seconds before a message expires. One day is 86400 seconds. One week is 604800 seconds.

After creating this file, you'll need to stop qmail and restart it (no need to stop/start the SMTP and/or POP daemons).

qmail uses a quadratic message retry schedule for every message.

For local messages

   time in queue = 100 * attempt ** 2

   delay until next retry = 200 * attempt + 100

For remote messages

   time in queue = 400 * attempt ** 2

   delay until next retry = 800 * attempt + 400

So for a remote message, the delivery times will be (in seconds)

   0, 400, 1600, 3600, ....

If the default timeout of one week is in force, there will be about 39 delivery attempts before a message is deemed undeliverable.

This mechanism is hard coded into the qmail system. It cannot be changed without patching the source code and recompiling.

There is also another retry schedule for remote deliveries.  Quoting from the qmail-tcpto man page

       After  an  SMTP connection attempt times out, qmail-remote
       records the relevant IP  address.   If  the  same  address
       fails  again (after at least two minutes with no interven­
       ing successful  connections),  qmail-remote  assumes  that
       further attempts will fail for at least another hour.

You can view the list of timed out remote IP addresses by running the command

   /var/qmail/bin/qmail-tcpto

You can clear the list of timed out remote IP addresses by running the command

   /var/qmail/bin/qmail-tcpok

Probably much more info than you wanted, but it's all spelled out now.

Christo Pretorius

RE: How long retry before failing?
« Reply #2 on: August 31, 2000, 07:47:55 PM »
Thanks.