summaryrefslogtreecommitdiff
path: root/Mailman/ListAdmin.py
diff options
context:
space:
mode:
authorbwarsaw1999-11-24 21:13:59 +0000
committerbwarsaw1999-11-24 21:13:59 +0000
commit71b68fb9f50d8d546c4edf7d3eea6ba9e1b48553 (patch)
tree88de9e53efdf74f30859cd5e93cc413828fb46cd /Mailman/ListAdmin.py
parent69da7caffe33b3195005d13ea627b98f9439b2d4 (diff)
downloadmailman-71b68fb9f50d8d546c4edf7d3eea6ba9e1b48553.tar.gz
mailman-71b68fb9f50d8d546c4edf7d3eea6ba9e1b48553.tar.zst
mailman-71b68fb9f50d8d546c4edf7d3eea6ba9e1b48553.zip
Convert message delivery to pipeline architecture by using
HandlerAPI.DeliverToUser() for fast track delivery of the notification messages.
Diffstat (limited to 'Mailman/ListAdmin.py')
-rw-r--r--Mailman/ListAdmin.py27
1 files changed, 14 insertions, 13 deletions
diff --git a/Mailman/ListAdmin.py b/Mailman/ListAdmin.py
index bbc693bda..e3761afb2 100644
--- a/Mailman/ListAdmin.py
+++ b/Mailman/ListAdmin.py
@@ -30,11 +30,12 @@ import time
import marshal
from errno import ENOENT
-from Mailman.pythonlib.StringIO import StringIO
from Mailman import Message
from Mailman import mm_cfg
from Mailman import Utils
from Mailman import Errors
+from Mailman.pythonlib.StringIO import StringIO
+from Mailman.Handlers import HandlerAPI
# Request types requiring admin approval
HELDMSG = 1
@@ -242,9 +243,9 @@ class ListAdmin:
'hostname' : self.host_name,
'admindb_url': self.GetAbsoluteScriptURL('admindb'),
})
- self.SendTextToUser(subject=subject,
- recipient=self.GetAdminEmail(),
- text=text)
+ adminaddr = self.GetAdminEmail()
+ msg = Message.UserNotification(adminaddr, adminaddr, subject, text)
+ HandlerAPI.DeliverToUser(self, msg)
def __handlesubscription(self, record, value, comment):
@@ -258,20 +259,20 @@ class ListAdmin:
self.ApprovedAddMember(addr, password, digest)
- def __refuse(self, request, recip, comment, msg=None):
+ def __refuse(self, request, recip, comment, origmsg=None):
+ adminaddr = self.GetAdminEmail()
text = Utils.maketext(
'refuse.txt',
{'listname' : self.real_name,
'request' : request,
'reason' : comment,
- 'adminaddr': self.GetAdminEmail(),
+ 'adminaddr': adminaddr,
})
# add in original message, but not wrap/filled
- if msg:
- text = text + \
- '\n---------- Original Message ----------\n' + \
- Utils.SnarfMessage(msg)[1]
+ if origmsg:
+ text = string.join([text,
+ '---------- Original Message ----------',
+ str(origmsg)], '\n')
subject = 'Request to mailing list %s rejected' % self.real_name
- self.SendTextToUser(subject=subject,
- recipient=recip,
- text=text)
+ msg = Message.UserNotification(recip, adminaddr, subject, text)
+ HandlerAPI.DeliverToUser(self, msg)