diff options
| author | bwarsaw | 2002-03-11 04:20:02 +0000 |
|---|---|---|
| committer | bwarsaw | 2002-03-11 04:20:02 +0000 |
| commit | 44637b09290d6c593ab8e72fd0c819a6d00afd67 (patch) | |
| tree | 13a052120e9b22df783bc9f3b501914eb85f2edb /Mailman/Handlers/SMTPDirect.py | |
| parent | a369681c8addcf69d3c4600923c6ad991c381e48 (diff) | |
| download | mailman-44637b09290d6c593ab8e72fd0c819a6d00afd67.tar.gz mailman-44637b09290d6c593ab8e72fd0c819a6d00afd67.tar.zst mailman-44637b09290d6c593ab8e72fd0c819a6d00afd67.zip | |
process(): A slight improvement for robustness. Now we assign the
`undelivered' key in the message metadata to the list of chunks the
message will be sent to. If something breaks during delivery of this
message, the list of undelivered recipients will be saved with the
metadata, and should be restored when the message is unshunted.
Diffstat (limited to 'Mailman/Handlers/SMTPDirect.py')
| -rw-r--r-- | Mailman/Handlers/SMTPDirect.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/Mailman/Handlers/SMTPDirect.py b/Mailman/Handlers/SMTPDirect.py index d51f50b9e..292c5e677 100644 --- a/Mailman/Handlers/SMTPDirect.py +++ b/Mailman/Handlers/SMTPDirect.py @@ -101,6 +101,9 @@ def process(mlist, msg, msgdata): chunks = [recips] else: chunks = chunkify(recips, mm_cfg.SMTP_MAX_RCPTS) + # See if this is an unshunted message for which some were undelivered + if msgdata.has_key('undelivered'): + chunks = msgdata['undelivered'] # If we're doing bulk delivery, then we can stitch up the message now. if deliveryfunc is None: Decorate.process(mlist, msg, msgdata) @@ -110,11 +113,21 @@ def process(mlist, msg, msgdata): numsessions = mm_cfg.SMTP_MAX_SESSIONS_PER_CONNECTION # Open the initial connection origrecips = msgdata['recips'] + # `undelivered' is a copy of chunks that we pop from to do deliveries. + # This seems like a good tradeoff between robustness and resource + # utilization. If delivery really fails (i.e. qfiles/shunt type + # failures), then we'll pick up where we left off with `undelivered'. + # This means at worst, the last chunk for which delivery was attempted + # could get duplicates but not every one, and no recips should miss the + # message. conn = Connection() try: - for chunk in chunks: + msgdata['undelivered'] = chunks + while chunks: + chunk = chunks.pop() msgdata['recips'] = chunk deliveryfunc(mlist, msg, msgdata, envsender, refused, conn) + del msgdata['undelivered'] finally: conn.quit() msgdata['recips'] = origrecips |
