summaryrefslogtreecommitdiff
path: root/Mailman/Handlers/Hold.py
diff options
context:
space:
mode:
authorbwarsaw2001-05-31 17:30:41 +0000
committerbwarsaw2001-05-31 17:30:41 +0000
commit055abf8655e4f34b488c35cc9a0192913748e734 (patch)
tree3800c9575b34feb8877032f1aad3999cb683e27a /Mailman/Handlers/Hold.py
parent55d9729a98d400a9b8c53958dae0711aa19c792d (diff)
downloadmailman-055abf8655e4f34b488c35cc9a0192913748e734.tar.gz
mailman-055abf8655e4f34b488c35cc9a0192913748e734.tar.zst
mailman-055abf8655e4f34b488c35cc9a0192913748e734.zip
hold_for_approval(): We want the admin notification message to appear
to come from the list owner to avoid any unnecessary bounce processing. Also, and more importantly, set the message's metadata "tomoderators" flag so that the admin notification message will be sent to both the list owners and the list moderators.
Diffstat (limited to 'Mailman/Handlers/Hold.py')
-rw-r--r--Mailman/Handlers/Hold.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/Mailman/Handlers/Hold.py b/Mailman/Handlers/Hold.py
index 421d2a71f..a3aab93df 100644
--- a/Mailman/Handlers/Hold.py
+++ b/Mailman/Handlers/Hold.py
@@ -223,6 +223,7 @@ def hold_for_approval(mlist, msg, msgdata, exc):
exc = exc()
listname = mlist.real_name
sender = msg.get_sender()
+ owneraddr = mlist.GetOwnerEmail()
adminaddr = mlist.GetAdminEmail()
# We need to send both the reason and the rejection notice through the
# translator again, because of the games we play above
@@ -244,6 +245,9 @@ def hold_for_approval(mlist, msg, msgdata, exc):
# languages (the user's preferred and the list's preferred for the admin),
# we need to play some i18n games here. Since the current language
# context ought to be set up for the user, let's craft his message first.
+ #
+ # This message should appear to come from <list>-admin so as to handle any
+ # bounce processing that might be needed.
if not fromusenet and not mlist.dont_respond_to_post_requests:
lang = msgdata.get('lang', mlist.GetPreferredLanguage(sender))
subject = _('Your message to %(listname)s awaits moderator approval')
@@ -252,7 +256,9 @@ def hold_for_approval(mlist, msg, msgdata, exc):
msg.addheader('Content-Type', 'text/plain',
charset=Utils.GetCharSet(lang))
msg.send(mlist)
- # Now the message for the administrator
+ # Now the message for the list owners. Be sure to include the list
+ # moderators in this message. This one should appear to come from
+ # <list>-owner since we really don't need to do bounce processing on it.
if mlist.admin_immed_notify:
# Now let's temporarily set the language context to that which the
# admin is expecting.
@@ -266,11 +272,10 @@ def hold_for_approval(mlist, msg, msgdata, exc):
text = Utils.maketext('postauth.txt', d, raw=1, mlist=mlist)
# craft the admin notification message and deliver it
subject = _('%(listname)s post from %(sender)s requires approval')
- msg = Message.UserNotification(adminaddr, adminaddr, subject,
- text)
+ msg = Message.UserNotification(owneraddr, owneraddr, subject, text)
msg.addheader('Content-Type', 'text/plain',
charset=Utils.GetCharSet(lang))
- msg.send(mlist)
+ msg.send(mlist, **{'tomoderators': 1})
finally:
i18n.set_translation(otranslation)
# Log the held message