diff options
| author | bwarsaw | 1999-11-24 21:11:49 +0000 |
|---|---|---|
| committer | bwarsaw | 1999-11-24 21:11:49 +0000 |
| commit | 5c13fb3ded141e2af0e1589e78cf7c8fdb9be5d3 (patch) | |
| tree | dc708b3d5826468c6f2c64fcf666a972f6c2c031 | |
| parent | 118a5f38fc641f80084aeb61fdd71daf600f0156 (diff) | |
| download | mailman-5c13fb3ded141e2af0e1589e78cf7c8fdb9be5d3.tar.gz mailman-5c13fb3ded141e2af0e1589e78cf7c8fdb9be5d3.tar.zst mailman-5c13fb3ded141e2af0e1589e78cf7c8fdb9be5d3.zip | |
| -rw-r--r-- | Mailman/Handlers/Hold.py | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/Mailman/Handlers/Hold.py b/Mailman/Handlers/Hold.py index 8e5e4e10f..318717d6d 100644 --- a/Mailman/Handlers/Hold.py +++ b/Mailman/Handlers/Hold.py @@ -172,27 +172,32 @@ def hold_for_approval(mlist, msg, excclass): listname = mlist.real_name reason = excclass.__doc__ sender = msg.GetSender() + adminaddr = mlist.GetAdminEmail() mlist.HoldMessage(msg, reason) # now we need to craft and send a message to the list admin so they can # deal with the held message - mlist.LogMsg('vette', '%s post from %s held: %s' % - (listname, sender, reason)) + d = {'listname' : listname, + 'hostname' : mlist.host_name, + 'reason' : reason, + 'sender' : sender, + 'subject' : msg.get('subject', '(no subject)'), + 'admindb_url': mlist.GetAbsoluteScriptURL('admindb'), + } 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', - {'listname' : listname, - 'hostname' : mlist.host_name, - 'reason' : reason, - 'sender' : sender, - 'subject' : msg.get('subject', '(no subject)'), - 'admindb_url': mlist.GetAbsoluteScriptURL('admindb'), - }, raw=1) + text = Utils.maketext('postauth.txt', d, raw=1) # craft the admin notification message and deliver it - adminaddr = mlist.GetAdminEmail() msg = Message.UserNotification(adminaddr, adminaddr, subject, text) HandlerAPI.DeliverToUser(mlist, msg) + # We may want to send a notification to the original sender too + if not mlist.dont_respond_to_post_requests: + text = Utils.maketext('postheld.txt', d) + msg = Message.UserNotification(sender, adminaddr, subject, text) + HandlerAPI.DeliverToUser(mlist, msg) + # Log the held message + mlist.LogMsg('vette', '%s post from %s held: %s' % + (listname, sender, reason)) # raise the specific MessageHeld exception to exit out of the message # delivery pipeline raise excclass |
