summaryrefslogtreecommitdiff
path: root/cron
diff options
context:
space:
mode:
authormailman1998-03-18 22:01:31 +0000
committermailman1998-03-18 22:01:31 +0000
commita7374a15736ddefa68dce0219371270f6d505ac3 (patch)
tree19ecfb72a0936ad3e502fbee7f0801b7f4715dda /cron
parentc3037d18dc98393993bec7fd986a46b4a9d6d6b7 (diff)
downloadmailman-a7374a15736ddefa68dce0219371270f6d505ac3.tar.gz
mailman-a7374a15736ddefa68dce0219371270f6d505ac3.tar.zst
mailman-a7374a15736ddefa68dce0219371270f6d505ac3.zip
Describe the requests that are pending in the notification message.
Track transition of list_names to mm_utils, including import of mm_utils.
Diffstat (limited to 'cron')
-rwxr-xr-xcron/checkdbs62
1 files changed, 46 insertions, 16 deletions
diff --git a/cron/checkdbs b/cron/checkdbs
index af7610099..ff84b3dbb 100755
--- a/cron/checkdbs
+++ b/cron/checkdbs
@@ -8,23 +8,53 @@ import sys, os
sys.path.append('/home/mailman/mailman/modules')
-import maillist, mm_cfg, mm_message
+import maillist, mm_cfg, mm_message, mm_utils
-for name in maillist.list_names():
- try:
+def main():
+
+ for name in mm_utils.list_names():
list = maillist.MailList(name)
- except:
- continue
- count = list.RequestsPending()
- if count:
- list.SendTextToUser(subject = '%d %s admin request(s) waiting' %
- (count, list.real_name),
- recipient = list.GetAdminEmail(),
- text = '''
- The %s mailing list has %d request(s) waiting
- for your consideration at:
+ list.Unlock()
+ count = list.RequestsPending()
+ if count:
+ list.SendTextToUser(subject = '%d %s admin request(s) waiting' %
+ (count, list.real_name),
+ recipient = list.GetAdminEmail(),
+ text = '''
+The %s mailing list has %d request(s) waiting
+for your consideration at:
+
%s
- Please attend to this at your earliest convenience.''' %
- (list.real_name, count, list.GetScriptURL('admindb')))
- list.Unlock()
+Please attend to this at your earliest convenience. A reminder like this
+of the pending requests, if any, will be sent out daily.
+
+%s
+ ''' % (list.real_name, count, list.GetScriptURL('admindb'),
+ pending_requests(list)))
+
+def pending_requests(list):
+ import time, string
+ pending = []
+ requests = list.requests
+ # First the pending subscriptions:
+ if requests.has_key('add_member'):
+ pending.append("Pending subscriptions:")
+ for req in requests['add_member']:
+ id, when, digested, who, pwd = req
+ pending.append("\t%s %s" %
+ (string.strip(who),
+ time.ctime(when)))
+ if requests.has_key('post'):
+ if pending:
+ pending.append("")
+ pending.append("Pending posts:")
+ for req in requests['post']:
+ id, when, (who, msg), objection = req
+ pending.append("\t%s %s:\n\t\t%s" % (string.strip(who),
+ time.ctime(when),
+ `string.strip(objection)`))
+ return string.join(pending, '\n')
+
+if __name__ == "__main__":
+ main()