summaryrefslogtreecommitdiff
path: root/Mailman/Handlers/HandlerAPI.py
diff options
context:
space:
mode:
authorbwarsaw1999-11-24 19:32:20 +0000
committerbwarsaw1999-11-24 19:32:20 +0000
commit572bc02430b4379a7134bf73b040d5bf82239250 (patch)
tree08155f0157562945b2eda43706c7e5540aaa6372 /Mailman/Handlers/HandlerAPI.py
parentd531f150095caf72654a3acf5b967c9a4c6e4bf1 (diff)
downloadmailman-572bc02430b4379a7134bf73b040d5bf82239250.tar.gz
mailman-572bc02430b4379a7134bf73b040d5bf82239250.tar.zst
mailman-572bc02430b4379a7134bf73b040d5bf82239250.zip
process() => DeliverToList()
DeliverToUser(): New function which implements a pipeline for direct delivery to a specified user. This pipeline is used for all admin notifications, and other things like user post acks. It sets msg.fastrack attribute to 1 so other modules can know which delivery track this message is on. This lets us use the same module for all delivery, or separate ones for delivery to list and delivery to user.
Diffstat (limited to 'Mailman/Handlers/HandlerAPI.py')
-rw-r--r--Mailman/Handlers/HandlerAPI.py20
1 files changed, 19 insertions, 1 deletions
diff --git a/Mailman/Handlers/HandlerAPI.py b/Mailman/Handlers/HandlerAPI.py
index 1b65b3483..ac4036734 100644
--- a/Mailman/Handlers/HandlerAPI.py
+++ b/Mailman/Handlers/HandlerAPI.py
@@ -27,7 +27,9 @@ class MessageHeld(HandlerError):
-def process(mlist, msg):
+# for messages that arrive from the outside, to be delivered to all mailing
+# list subscribers
+def DeliverToList(mlist, msg):
pipeline = ['SpamDetect',
'Approve',
'Hold',
@@ -49,3 +51,19 @@ def process(mlist, msg):
func(mlist, msg)
except MessageHeld:
break
+
+
+
+# for messages crafted internally by the Mailman system. The msg object
+# should have already calculated and set msg.recips. TBD: can the mlist be
+# None?
+def DeliverToUser(mlist, msg):
+ pipeline = ['CookHeaders',
+ 'Sendmail',
+ ]
+ msg.fastrack = 1
+ for modname in pipeline:
+ mod = __import__('Mailman.Handlers.'+modname)
+ func = getattr(getattr(getattr(mod, 'Handlers'), modname), 'process')
+ # None of these modules should ever generate a MessageHeld exception
+ func(mlist, msg)