Index: Mailman/Defaults.py.in =================================================================== RCS file: /cvsroot/mailman/mailman/Mailman/Defaults.py.in,v retrieving revision 2.61 diff -b -u -r2.61 Defaults.py.in --- Mailman/Defaults.py.in 2002/01/12 04:50:56 2.61 +++ Mailman/Defaults.py.in 2002/01/16 19:57:14 @@ -704,6 +704,10 @@ DEFAULT_UMBRELLA_MEMBER_ADMIN_SUFFIX = "-owner" # This variable controls whether monthly password reminders are sent. +# 0 - no reminders +# 1 - monthly +# 2 - quarterly +# 3 - yearly DEFAULT_SEND_REMINDERS = 1 # Send welcome messages to new users? Probably should keep this set to 1. Index: Mailman/HTMLFormatter.py =================================================================== RCS file: /cvsroot/mailman/mailman/Mailman/HTMLFormatter.py,v retrieving revision 2.25 diff -b -u -r2.25 HTMLFormatter.py --- Mailman/HTMLFormatter.py 2001/12/27 06:53:20 2.25 +++ Mailman/HTMLFormatter.py 2002/01/16 19:57:14 @@ -333,9 +333,12 @@ return '' % (name, text) def FormatReminder(self, lang): - if self.send_reminders: - return _('Once a month, your password will be emailed to you as' - ' a reminder.') + if self.send_reminders in (1, 2, 3): + frequencies = [_('Once a month'), + _('Once in a quarter'), + _('Once in a year')] + return frequencies[self.send_reminders - 1] + \ + _(', your password will be emailed to you as a reminder.') return '' def ParseTags(self, template, replacements, lang=None): Index: Mailman/MailList.py =================================================================== RCS file: /cvsroot/mailman/mailman/Mailman/MailList.py,v retrieving revision 2.55 diff -b -u -r2.55 MailList.py Index: Mailman/Gui/General.py =================================================================== RCS file: /cvsroot/mailman/mailman/Mailman/Gui/General.py,v retrieving revision 2.7 diff -b -u -r2.7 General.py --- Mailman/Gui/General.py 2001/10/27 05:08:14 2.7 +++ Mailman/Gui/General.py 2002/01/16 19:57:14 @@ -230,13 +230,14 @@ _('Notifications'), - ('send_reminders', mm_cfg.Radio, (_('No'), _('Yes')), 0, - _('''Send monthly password reminders?'''), + ('send_reminders', mm_cfg.Radio, + (_('No'), _('Monthly'), _('Quarterly'), _('Yearly')), 0, + _('''Send monthly password reminders, and how often?'''), + + _('''Turn this on if you want password reminders to be sent to + your members monthly, quaterly or yearly. Note that members may + disable their own individual password reminders.''')), - _('''Turn this on if you want password reminders to be sent once - per month to your members. Note that members may disable their - own individual password reminders.''')), - ('welcome_msg', mm_cfg.Text, (4, WIDTH), 0, _('''List-specific text prepended to new-subscriber welcome message'''), Index: cron/crontab.in.in =================================================================== RCS file: /cvsroot/mailman/mailman/cron/crontab.in.in,v retrieving revision 2.3 diff -b -u -r2.3 crontab.in.in --- cron/crontab.in.in 2002/01/06 06:28:12 2.3 +++ cron/crontab.in.in 2002/01/16 19:57:14 @@ -11,7 +11,7 @@ 0 12 * * * @PYTHON@ -S @prefix@/cron/senddigests # # 5 AM on the first of each month, mail out password reminders. -0 5 1 * * @PYTHON@ -S @prefix@/cron/mailpasswds +0 5 1 * * @PYTHON@ -S @prefix@/cron/mailpasswds --cron # # Every 5 mins, try to gate news to mail. You can comment this one out # if you don't want to allow gating, or don't have any going on right now, Index: cron/mailpasswds =================================================================== RCS file: /cvsroot/mailman/mailman/cron/mailpasswds,v retrieving revision 2.9 diff -b -u -r2.9 mailpasswds --- cron/mailpasswds 2001/11/20 17:16:48 2.9 +++ cron/mailpasswds 2002/01/16 19:57:14 @@ -29,6 +29,9 @@ Options: -h/--help Print this message and exit. + + -c/--cron + Called from cron and check for send_reminder_frequency. """ # This puppy should probably do lots of logging. @@ -36,6 +39,7 @@ import os import errno import getopt +import time import paths # mm_cfg must be imported before the other modules, due to the side-effect of @@ -66,17 +70,32 @@ +def time_to_send_reminders(mlist): + freqency = mlist.send_reminders + month = time.localtime()[1] + if frequency == 1: # monthly + return 1 + elif frequency == 2 and month % 3 == 1: # quarterly + return 1 + elif frequency == 3 and month == 1: # yearly + return 1 + return 0 + + def main(): try: - opts, args = getopt.getopt(sys.argv[1:], 'h', ['help']) + opts, args = getopt.getopt(sys.argv[1:], 'ch', ['cron', 'help']) except getopt.error, msg: usage(1, msg) if args: usage(1) + called_from_cron = 0 for opt, arg in opts: - if opt in ('-h', '--help'): + if opt in ('-c', '--cron'): + called_from_cron = 1 + elif opt in ('-h', '--help'): usage(0) # This is the list that all the reminders will look like they come from, @@ -96,7 +115,9 @@ byhost = {} for listname in Utils.list_names(): mlist = MailList.MailList(listname, lock=0) - if not mlist.send_reminders: + if mlist.send_reminders == 0: + continue + if called_from_cron and not time_to_send_reminders(mlist): continue if mm_cfg.VIRTUAL_HOST_OVERVIEW: host = mlist.host_name