With the excellent help of Mark Sapiro, I was able to resolve my issue with
password reminders. Basically, we wanted for the majority of our lists to have
the normal monthly reminders. For the select few lists, we wanted quarterly
reminders. I made a few modifications to mailpasswds which Mark cleaned
up/refined to allow on option to exclude a list from password reminders. This
was needed since my select few lists need to leave the "send_reminders" setting
to on but I didn't want the monthly reminders to go out for them. Now, my cron
job for the monthly reminders can exclude the select few lists and I can add
additional cron jobs to send reminders to only the select few lists. E.G.
# send reminders to all lists except for list-a, list-b, and list-c
0 5 1 * * mailman /usr/lib/mailman/cron/mailpasswds -x list-a -x list-b -x
list-c
# send reminders to list-a and list-c in Jan, Apr, and Oct
0 5 1 1,4,10 * mailman /usr/lib/mailman/cron/mailpasswds -l list-a -l list-c
# send reminders to list-b in Aug
0 5 1 8 * mailman /usr/lib/mailman/cron/mailpasswds -l list-b
The new option/switch added is -x or --exclude-list (in long form). I am
including a diff of the changes from Mailman v2.1.9 below. The options of -l
and -x are mutually exclusive.
Thanks,
Chris
--------------------------- Diff Begins -------------------------------
34c34,40
< allowed.
---
> allowed. This and the -x/--exclude-list option are mutually
> exclusive.
>
> -x listname
> --exclude-list
> Do not send password reminders for the excluded list. If omitted,
> reminders are sent for all lists. Multiple -x/--exclude-list options
> are allowed. This and the -l/--listname option are mutually
> exclusive.
91,92c97,98
< opts, args = getopt.getopt(sys.argv[1:], 'l:h',
< ['listname=', 'help'])
---
> opts, args = getopt.getopt(sys.argv[1:], 'l:x:h',
> ['listname=', 'exclude-list=', 'help'])
99a106
> excludedlists = None
103a111,112
> if excludedlists:
> usage(1, '-l/--listname and -x/--exclude-list are mutually
> exclusive')
107a117,123
> if opt in ('-x', '--exclude-list'):
> if listnames:
> usage(1, '-l/--listname and -x/--exclude-list are mutually
> exclusive')
> if excludedlists is None:
> excludedlists = [arg]
> else:
> excludedlists.append(arg)
111a128,130
> if excludedlists:
> listnames = set(listnames) - set(excludedlists)
>
--------------------------- Diff Ends ----------------------------------
>>> Mark Sapiro <[email protected]> Thursday, April 02, 2009 2:22 PM >>>
Chris Nulk wrote:
>
>I know I can stop password reminders from going out to list members by turning
>off the reminders in the list configuration. I also know I can comment out
>the cron entry for mailpasswd to stop it for all lists. In addition, I know I
>can send reminders using mailpasswd to a specific list(s). But, can I
>exclude sending reminders to specifics lists with mailpasswd. What I would
>like to do is send the normal monthly reminders to most of our lists. There
>is a small group of lists that I want reminders to be sent to but on a
>quarterly/yearly basis instead.
>
>Can I do this using mailpasswd or some other way? Or should I pull out the
>big hacking sword, close my eyes, and have a go at mailpasswd? And, does
>anyone really want to see the results if I do?
I don't recommend the hack away with eyes closed method, but it
shouldn't be too difficult to add a -x/--exclude option to mailpasswds.
On the other hand you could do something like
#!/bin/sh
excludes=`cat /path/to/lists/to/exclude`
for list in `/path/to/bin/list_lists --bare` ; do
skip=0
for xlist in $excludes ; do
if [ $list == $xlist ] ; then skip=1 ; fi
done
if [ $skip == 0 ] ; then
/path/to/cron/mailpasswds -l $list
fi
done
--
Mark Sapiro <[email protected]> The highway is for gamblers,
San Francisco Bay Area, California better use your sense - B. Dylan
------------------------------------------------------
Mailman-Users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Searchable Archives: http://www.mail ( http://www.mail/
)-archive.com/mailman-users%40python.org/
Unsubscribe:
http://mail.python.org/mailman/options/mailman-users/cnulk%40scu.edu
Security Policy: http://wiki.list.org/x/QIA9
------------------------------------------------------
Mailman-Users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe:
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org
Security Policy: http://wiki.list.org/x/QIA9