summaryrefslogtreecommitdiff
path: root/Mailman/Handlers/Hold.py
diff options
context:
space:
mode:
authorbwarsaw1999-11-24 19:32:47 +0000
committerbwarsaw1999-11-24 19:32:47 +0000
commit7329048d8212f12722536ae52bb828f59e1680aa (patch)
tree0a93d3179008a313882b1911a30fd0778d09ef45 /Mailman/Handlers/Hold.py
parent572bc02430b4379a7134bf73b040d5bf82239250 (diff)
downloadmailman-7329048d8212f12722536ae52bb828f59e1680aa.tar.gz
mailman-7329048d8212f12722536ae52bb828f59e1680aa.tar.zst
mailman-7329048d8212f12722536ae52bb828f59e1680aa.zip
Diffstat (limited to 'Mailman/Handlers/Hold.py')
-rw-r--r--Mailman/Handlers/Hold.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/Mailman/Handlers/Hold.py b/Mailman/Handlers/Hold.py
index 13a78ef5f..8e5e4e10f 100644
--- a/Mailman/Handlers/Hold.py
+++ b/Mailman/Handlers/Hold.py
@@ -39,6 +39,7 @@ except ImportError:
import pickle
import HandlerAPI
+from Mailman import Message
from Mailman import mm_cfg
from Mailman import Utils
@@ -177,6 +178,7 @@ def hold_for_approval(mlist, msg, excclass):
mlist.LogMsg('vette', '%s post from %s held: %s' %
(listname, sender, reason))
if mlist.admin_immed_notify:
+ # get the text from the template
subject = '%s post from %s requires approval' % (listname, sender)
text = Utils.maketext(
'postauth.txt',
@@ -187,10 +189,10 @@ def hold_for_approval(mlist, msg, excclass):
'subject' : msg.get('subject', '(no subject)'),
'admindb_url': mlist.GetAbsoluteScriptURL('admindb'),
}, raw=1)
- # TBD: we should send the message to the admin using the same
- # mechanism used to post messages to the list (e.g. if we're doing
- # sendmail injection, we should use it for all sent messages)
- mlist.SendTextToUser(subject=subject,
- recipient=mlist.GetAdminEmail(),
- text=text)
+ # craft the admin notification message and deliver it
+ adminaddr = mlist.GetAdminEmail()
+ msg = Message.UserNotification(adminaddr, adminaddr, subject, text)
+ HandlerAPI.DeliverToUser(mlist, msg)
+ # raise the specific MessageHeld exception to exit out of the message
+ # delivery pipeline
raise excclass