summaryrefslogtreecommitdiff
path: root/Mailman/ListAdmin.py
diff options
context:
space:
mode:
authormailman1998-03-13 16:28:19 +0000
committermailman1998-03-13 16:28:19 +0000
commit0367b9e1d431a03e9914fcbff70aaed8b3cf9c88 (patch)
treeccbd34f3fae32a33c8452c3272c6a983745b1997 /Mailman/ListAdmin.py
parent7bada60e098c596833b8294b82f607b6e50a133c (diff)
downloadmailman-0367b9e1d431a03e9914fcbff70aaed8b3cf9c88.tar.gz
mailman-0367b9e1d431a03e9914fcbff70aaed8b3cf9c88.tar.zst
mailman-0367b9e1d431a03e9914fcbff70aaed8b3cf9c88.zip
Implement admin_immed_notify, where list admins can choose to have
notices sent whenever a new admin request (vetted subscriptions or list postings) arrives, in addition to daily notice. Repair what is logged (was using list. instead of self.). Relocate message body texts to "constants" just after imports, at the least so they don't screw up emacs tracking of indentation levels.
Diffstat (limited to 'Mailman/ListAdmin.py')
-rw-r--r--Mailman/ListAdmin.py46
1 files changed, 45 insertions, 1 deletions
diff --git a/Mailman/ListAdmin.py b/Mailman/ListAdmin.py
index 6fefd74dc..caf56fdd6 100644
--- a/Mailman/ListAdmin.py
+++ b/Mailman/ListAdmin.py
@@ -4,6 +4,26 @@
import mm_err, mm_cfg, mm_message
import os, marshal, time, string
+SUBSCRIPTION_AUTH_TEXT = """
+Your authorization is required to approve or deny a subscription for
+%s to the %s@%s mailing list. Please visit:
+
+ %s
+
+at your convenience to process the request."""
+
+POSTING_AUTH_TEXT = """
+Your authorization is required to approve or deny a posting for
+%s to the %s@%s mailing list.
+
+Reason for hold: %s
+
+Please visit:
+
+ %s
+
+at your convenience to process the request."""
+
class ListAdmin:
def InitVars(self):
# Non-configurable data:
@@ -22,11 +42,35 @@ class ListAdmin:
self.LogMsg("vette", ("%s: %s for %s" % (self.real_name,
"Subscription request",
args[2])))
+ if self.admin_immed_notify:
+ who = args[1]
+ subj = 'New %s subscription request: %s' % (self.real_name,
+ who)
+ self.SendTextToUser(subject = subj,
+ recipient = self.GetAdminEmail(),
+ text = (SUBSCRIPTION_AUTH_TEXT
+ % (who,
+ self.real_name,
+ self.host_name,
+ self.GetScriptURL('admindb'))))
raise mm_err.MMNeedApproval, "Admin approval required to subscribe"
+
elif request == 'post':
sender = args[0][0]
+ reason = args[1]
self.LogMsg("vette",
- ("%s: %s %s" % (self.real_name, `args[1]`, sender)))
+ "%s: %s %s" % (self.real_name, reason, sender))
+ if self.admin_immed_notify:
+ subj = '%s posting approval, sender %s' % (self.real_name,
+ sender)
+ self.SendTextToUser(subject = subj,
+ recipient = self.GetAdminEmail(),
+ text = (POSTING_AUTH_TEXT
+ % (sender,
+ self.real_name,
+ self.host_name,
+ reason,
+ self.GetScriptURL('admindb'))))
raise mm_err.MMNeedApproval, args[1]
def CleanRequests(self):