diff options
| author | bwarsaw | 2000-06-20 05:47:31 +0000 |
|---|---|---|
| committer | bwarsaw | 2000-06-20 05:47:31 +0000 |
| commit | e4c77cc40facd1297c0e3fa4c820403892eb5c32 (patch) | |
| tree | 68e5ff6c737d654c8071cc18f4b8795dd1b8d43b /Mailman/Handlers/HandlerAPI.py | |
| parent | 84e36e0ab8cd513ec35c5778dad69054117aeba2 (diff) | |
| download | mailman-e4c77cc40facd1297c0e3fa4c820403892eb5c32.tar.gz mailman-e4c77cc40facd1297c0e3fa4c820403892eb5c32.tar.zst mailman-e4c77cc40facd1297c0e3fa4c820403892eb5c32.zip | |
Diffstat (limited to 'Mailman/Handlers/HandlerAPI.py')
| -rw-r--r-- | Mailman/Handlers/HandlerAPI.py | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/Mailman/Handlers/HandlerAPI.py b/Mailman/Handlers/HandlerAPI.py index 16b9b6a01..78ceed921 100644 --- a/Mailman/Handlers/HandlerAPI.py +++ b/Mailman/Handlers/HandlerAPI.py @@ -71,9 +71,7 @@ LIST_PIPELINE = ['SpamDetect', -# Central mail delivery handler -def DeliverToList(mlist, msg, msgdata): - pipeline = msgdata.get('pipeline', LIST_PIPELINE[:]) +def do_pipeline(mlist, msg, msgdata, pipeline): while pipeline: modname = pipeline.pop(0) mod = __import__('Mailman.Handlers.' + modname) @@ -82,11 +80,11 @@ def DeliverToList(mlist, msg, msgdata): func(mlist, msg, msgdata) except DiscardMessage: # Throw the message away; we need do nothing else with it. - return 0 + pipeline = [] except MessageHeld: # Let the approval process take it from here. The message no # longer needs to be queued. - return 0 + pipeline = [] except SomeRecipientsFailed: # The delivery module being used (SMTPDirect or Sendmail) failed # to deliver the message to one or all of the recipients. Push @@ -136,6 +134,15 @@ def DeliverToList(mlist, msg, msgdata): traceback.print_exc(file=s) syslog('error', s.getvalue()) break + return pipeline + + + +# Central mail delivery handler +def DeliverToList(mlist, msg, msgdata): + pipeline = msgdata.get('pipeline', LIST_PIPELINE)[:] + if not msgdata.get('_enqueue_immediate', 0): + pipeline = do_pipeline(mlist, msg, msgdata, pipeline) msgdata['pipeline'] = pipeline if pipeline: msg.Enqueue(mlist, newdata=msgdata) |
