[Mailman-Developers] Re-tries for failed SMTPDirect deliveries

Thomas Wouters thomas@xs4all.net
Tue, 28 Mar 2000 23:14:00 +0200


On Tue, Mar 28, 2000 at 03:00:18PM -0500, Barry A. Warsaw wrote:
> >>>>> "TW" == Thomas Wouters <thomas@xs4all.net> writes:

>     TW> But, assides from delivery, it might be useful to store
>     TW> messages which failed elsewhere in the pipeline too; messages
>     TW> in the archive pipe, for instance, or the usenet pipe. It can
>     TW> currently happen, for instance because of a deadlock, that
>     TW> messages just get lost. I haven't looked at the new code yet,
>     TW> but imho it shouldn't be too hard to push messages back into
>     TW> those pipelines, assuming they fail 'cleanly' (and not with
>     TW> files half-written or some such.)

> That's actually a good idea.  I think a wrapper around the pipeline
> loop, perhaps using a bare try/except (hmm...) is the way to go.  What
> you'd probably have to do is have a checklist of delivery modules so
> you know 1) which ones you wanted to send the message through; 2)
> which ones failed.  And then to know what the disposal is for a
> message that failed at a particular step.  Definitely more
> complicated, but worth thinking about.  Robustifying message delivery
> should be very high on the list, but for 2.0 final we'll have to find
> a happy compromise.

How about a simple try/except in those two areas ? They are pretty isolated,
and you can add the try/except and restart-delivery code just after the
forks those portions do. (no need for the queuerunner to fork, i guess...
but it could, if necessary.)

Actually, I think I'll post a diff tomorrow morning, after I have some time
to think 'bout it ;) I already see one problem though: the new code eats the
unixfrom line the same way moderation does, screwing up the archives:

    # calculate a unique name for this file
    text = str(msg)
    filebase = sha.new(text).hexdigest()
    msgfile = os.path.join(mm_cfg.QUEUE_DIR, filebase + '.msg')


'str(msg)' will not dump the unixfrom line, (unless you want to fix this in
Mailman.Message.Message) so you need to use 'text = msg.unixfrom +
str(msg)'. See the patch i sent uhm, sometime this weekend. Also, one of the
comments in qrunner seems to be too literally copy/pasted from
cron/gate_news ;)

Rgdrs,
-- 
Thomas Wouters <thomas@xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!