On Tue, Jun 20, 2000 at 09:21:45AM -0500, Jonathan Maier wrote:
> Sorry, let me clarify:
>
> I am trying control at a more finite level, the ability to tell qmail that
> if the recipient's mail host is not responding to try 4 times, at 60 minute
> intervals, before qmail should give up.
>
> I have been told that this may not be possible, because qmail uses a
> quadratic backoff algorithm. I am unfamiliar with this algorithm, so if
> someone could briefly explain it to me, that would help my determination on
> what kind of policy I need to setup for unreachable mail hosts.
http://Web.InfoAve.Net/~dsill/lwq.html#retry-schedule
See also the code in qmail-send.c:
(Row 1081 uses the function nextretry)
static datetime_sec squareroot(x) /* result^2 <= x < (result + 1)^2 */
datetime_sec x; /* assuming: >= 0 */
{
datetime_sec y;
datetime_sec yy;
datetime_sec y21;
int j;
y = 0; yy = 0;
for (j = 15;j >= 0;--j)
{
y21 = (y << (j + 1)) + (1 << (j + j));
if (y21 <= x - yy) { y += (1 << j); yy += y21; }
}
return y;
}
datetime_sec nextretry(birth,c)
datetime_sec birth;
int c;
{
int n;
if (birth > recent) n = 0;
else n = squareroot(recent - birth); /* no need to add fuzz to recent */
n += chanskip[c];
return birth + n * n;
}
/magnus
--
http://x42.com