diff options
Diffstat (limited to 'cron')
-rwxr-xr-x | cron/disabled | 15 | ||||
-rwxr-xr-x | cron/gate_news | 6 | ||||
-rwxr-xr-x | cron/mailpasswds | 10 | ||||
-rwxr-xr-x | cron/nightly_gzip | 6 | ||||
-rwxr-xr-x | cron/senddigests | 20 |
5 files changed, 40 insertions, 17 deletions
diff --git a/cron/disabled b/cron/disabled index ac62582a..409fba60 100755 --- a/cron/disabled +++ b/cron/disabled @@ -1,6 +1,6 @@ #! @PYTHON@ # -# Copyright (C) 2001-2007 by the Free Software Foundation, Inc. +# Copyright (C) 2001-2013 by the Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -185,21 +185,24 @@ def main(): # other reason. status = mlist.getDeliveryStatus(member) if status == MemberAdaptor.BYBOUNCE: + # Bouncing member with no bounce info. Just log it and continue. syslog( 'error', '%s disabled BYBOUNCE lacks bounce info, list: %s', member, mlist.internal_name()) continue + # Disabled other than by bounce. Create bounce info (why?) info = _BounceInfo( member, 0, today, - mlist.bounce_you_are_disabled_warnings, - mlist.pend_new(Pending.RE_ENABLE, - mlist.internal_name(), - member)) - mlist.setBounceInfo(member, info) + mlist.bounce_you_are_disabled_warnings) lastnotice = time.mktime(info.lastnotice + (0,) * 6) if force or today >= lastnotice + interval: notify.append(member) + # Get a fresh re-enable cookie and set it. + info.cookie = mlist.pend_new(Pending.RE_ENABLE, + mlist.internal_name(), + member) + mlist.setBounceInfo(member, info) # Now, send notifications to anyone who is due for member in notify: syslog('bounce', 'Notifying disabled member %s for list: %s', diff --git a/cron/gate_news b/cron/gate_news index c66c09e0..8b6476a3 100755 --- a/cron/gate_news +++ b/cron/gate_news @@ -1,6 +1,6 @@ #! @PYTHON@ # -# Copyright (C) 1998-2011 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2015 by the Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -101,7 +101,7 @@ def open_newsgroup(mlist): readermode=True, user=mm_cfg.NNTP_USERNAME, password=mm_cfg.NNTP_PASSWORD) - except (socket.error, nntplib.NNTPError, IOError), e: + except (socket.error, nntplib.NNTPError, IOError, EOFError), e: syslog('fromusenet', 'error opening connection to nntp_host: %s\n%s', mlist.nntp_host, e) @@ -212,7 +212,7 @@ def process_lists(glock): # Open the newsgroup, but let most exceptions percolate up. try: conn, first, last = open_newsgroup(mlist) - except (socket.error, nntplib.NNTPError), e: + except (socket.error, nntplib.NNTPError, IOError, EOFError), e: syslog('fromusenet', "%s: couldn't open newsgroup %s: skipping\n%s", listname, mlist.linked_newsgroup, e) diff --git a/cron/mailpasswds b/cron/mailpasswds index db9c4875..da643761 100755 --- a/cron/mailpasswds +++ b/cron/mailpasswds @@ -141,9 +141,7 @@ def main(): for host in byhost.keys(): # Site owner is `mailman@dom.ain' userinfo = {} - virtlist = {} for mlist in byhost[host]: - virtlist = mlist listaddr = mlist.GetListEmail() for member in mlist.getMembers(): # The user may have disabled reminders for this list @@ -220,7 +218,7 @@ def main(): # Add the table to the end so it doesn't get wrapped/filled text += (header + '\n' + NL.join(table)) msg = Message.UserNotification( - addr, sitebounce, + addr, siteowner, _('%(host)s mailing list memberships reminder'), text.encode(enc, 'replace'), poplang) # Note that text must be encoded into 'enc' because unicode @@ -230,7 +228,11 @@ def main(): msg['X-No-Archive'] = 'yes' del msg['auto-submitted'] msg['Auto-Submitted'] = 'auto-generated' - msg.send(virtlist, **{'errorsto': sitebounce, + # We want to make this look like it's coming from the siteowner's + # list, but we also want to be sure that the apparent host name is + # the current virtual host. Look in CookHeaders.py for why this + # trick works. Blarg. + msg.send(sitelist, **{'errorsto': sitebounce, '_nolist' : 1, 'verp' : mm_cfg.VERP_PASSWORD_REMINDERS, }) diff --git a/cron/nightly_gzip b/cron/nightly_gzip index 0a0f4e33..de493d0e 100755 --- a/cron/nightly_gzip +++ b/cron/nightly_gzip @@ -1,6 +1,6 @@ #! @PYTHON@ # -# Copyright (C) 1998,1999,2000,2001,2002 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2014 by the Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -56,12 +56,16 @@ import paths from Mailman import mm_cfg from Mailman import Utils from Mailman import MailList +from Mailman import i18n program = sys.argv[0] VERBOSE = 0 +_ = i18n._ +i18n.set_language(mm_cfg.DEFAULT_SERVER_LANGUAGE) + def usage(code, msg=''): if code: fd = sys.stderr diff --git a/cron/senddigests b/cron/senddigests index edf27a2a..9997096c 100755 --- a/cron/senddigests +++ b/cron/senddigests @@ -1,6 +1,6 @@ #! @PYTHON@ # -# Copyright (C) 1998-2007 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2016 by the Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -28,7 +28,12 @@ Options: -l listname --listname=listname Send the digest for the given list only, otherwise the digests for all - lists are sent out. + lists are sent out. May be repeated to do multiple lists. + + -e listname + --exceptlist listname + Don't send the digest for the given list. May be repeated to skip + multiple lists. """ import os @@ -63,22 +68,31 @@ def usage(code, msg=''): def main(): try: - opts, args = getopt.getopt(sys.argv[1:], 'hl:', ['help', 'listname=']) + opts, args = getopt.getopt(sys.argv[1:], 'hl:e:', + ['help', 'listname=', 'exceptlist=']) except getopt.error, msg: usage(1, msg) if args: usage(1) + exceptlists = [] listnames = [] for opt, arg in opts: if opt in ('-h', '--help'): usage(0) elif opt in ('-l', '--listname'): listnames.append(arg) + elif opt in ('-e', '--exceptlist'): + exceptlists.append(arg) if not listnames: listnames = Utils.list_names() + for listname in exceptlists: + try: + listnames.remove(listname) + except ValueError: + pass for listname in listnames: mlist = MailList.MailList(listname, lock=0) |