diff -ur mailman-2.1.4.old/Mailman/Defaults.py.in mailman-2.1.4/Mailman/Defaults.py.in --- mailman-2.1.4.old/Mailman/Defaults.py.in 2003-12-13 17:34:17.000000000 +0100 +++ mailman-2.1.4/Mailman/Defaults.py.in 2004-05-01 12:45:08.000000000 +0200 @@ -847,6 +847,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 = Yes # Send welcome messages to new users? diff -ur mailman-2.1.4.old/Mailman/Gui/General.py mailman-2.1.4/Mailman/Gui/General.py --- mailman-2.1.4.old/Mailman/Gui/General.py 2002-12-11 13:41:56.000000000 +0100 +++ mailman-2.1.4/Mailman/Gui/General.py 2004-05-01 12:43:28.000000000 +0200 @@ -256,12 +256,13 @@ _('Notifications'), - ('send_reminders', mm_cfg.Radio, (_('No'), _('Yes')), 0, - _('''Send monthly 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.''')), + ('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.''')), ('welcome_msg', mm_cfg.Text, (4, WIDTH), 0, _('''List-specific text prepended to new-subscriber welcome diff -ur mailman-2.1.4.old/Mailman/HTMLFormatter.py mailman-2.1.4/Mailman/HTMLFormatter.py --- mailman-2.1.4.old/Mailman/HTMLFormatter.py 2003-09-29 17:01:22.000000000 +0200 +++ mailman-2.1.4/Mailman/HTMLFormatter.py 2004-05-01 12:43:28.000000000 +0200 @@ -342,9 +342,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): diff -ur mailman-2.1.4.old/cron/crontab.in.in mailman-2.1.4/cron/crontab.in.in --- mailman-2.1.4.old/cron/crontab.in.in 2002-01-06 07:28:12.000000000 +0100 +++ mailman-2.1.4/cron/crontab.in.in 2004-05-01 12:43:28.000000000 +0200 @@ -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, diff -ur mailman-2.1.4.old/cron/mailpasswds mailman-2.1.4/cron/mailpasswds --- mailman-2.1.4.old/cron/mailpasswds 2003-09-22 04:29:51.000000000 +0200 +++ mailman-2.1.4/cron/mailpasswds 2004-05-01 12:45:51.000000000 +0200 @@ -35,6 +35,9 @@ -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. @@ -42,6 +45,7 @@ import os import errno import getopt +import time from types import UnicodeType import paths @@ -86,10 +90,22 @@ +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:], 'l:h', - ['listname=', 'help']) + opts, args = getopt.getopt(sys.argv[1:], 'l:ch', + ['listname=', 'cron', 'help']) except getopt.error, msg: usage(1, msg) @@ -97,6 +113,7 @@ usage(1) listnames = None + called_from_cron = 0 for opt, arg in opts: if opt in ('-h', '--help'): usage(0) @@ -105,6 +122,8 @@ listnames = [arg] else: listnames.append(arg) + if opt in ('-c', '--cron'): + called_from_cron = 1 if listnames is None: listnames = Utils.list_names() @@ -126,7 +145,9 @@ byhost = {} for listname in listnames: 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