What does this program do?
ListSynchro synchronizes the Mailman list membership on a Mac OS X server to match the file server group membership in Worgroup Manager. It can also be used to generate regular list membership reports.
How does it work?
The script starts by getting the name of every Mailman list. For every list we then attempt to get the members of the matching open directory group. If we find a matching group, we store all of the account names as email addresses in a temporary file, and then call the Mailman routine sync_members to add or remove anyone that is/isn't present in the open directory group.
Finally, after the lists have been synchronized, the optional membership report is generated and saved to disk (presumably to somewhere on a shared volume). Then, if selected, the synchronization report is emailed out.
There are two files that will need to be edited. In listSynchro.py, several variables will need to be set before this script can be used:
If you will be emailing out reports, you must also edit the reportMsg.txt file to contain the recipients who will be receiving the reports.
How do I use it?
After modifying the script where necessary, run via the terminal command line or with a crontab entry. The script must be run as root because Mailman's sync_members command requires it.
When run, listSynchro will output a report, which will look something like the following:
This program has been tested on Mac OS Server 10.4.2-5 with some testing done on 10.3.9.
The directory server must be running on the same system as the script (although the dscl calls could be modified to access at a different location). To email reports Postfix must be configured sufficiently to allow email to be sent. Groups can only be nested one level deep.