Hi All,
Im using mailman 2.1.9, and ive got close to 100 mail lists on it.
We just have had one of our IT guys leave our company, and I was wondering if there was an easy (bulk, cli) way to remove/change the email address from the "List of Administrators" (2nd text box in General Options)
Otherwise, its very a very cumbersome job to log in to each list and remove the address manually.
Cheers Spyro
This message and its attachments may contain legally privileged or confidential information. This message is intended for the use of the individual or entity to which it is addressed. If you are not the addressee indicated in this message, or the employee or agent responsible for delivering the message to the intended recipient, you may not copy or deliver this message or its attachments to anyone. Rather, you should permanently delete this message and its attachments and kindly notify the sender by reply e-mail. Any content of this message and its attachments, which does not relate to the official business of the sending company must be taken not to have been sent or endorsed by the sending company or any of its related entities. No warranty is made that the e-mail or attachment(s) are free from computer virus or other defect.
If the optional pages are still the standard ones : As administrator, open for one list the personal option page, change the password, actualize using the new password and resign for all the lists
SN ----- Original Message ----- From: Spyro Polymiadis To: mailman-users@python.org Sent: Tuesday, November 20, 2007 4:14 AM Subject: [Mailman-Users] Removing admin email addresses
Hi All,
Im using mailman 2.1.9, and ive got close to 100 mail lists on it.
We just have had one of our IT guys leave our company, and I was wondering if there was an easy (bulk, cli) way to remove/change the email address from the "List of Administrators" (2nd text box in General Options)
Otherwise, its very a very cumbersome job to log in to each list and remove the address manually.
Cheers Spyro
This message and its attachments may contain legally privileged or confidential information. This message is intended for the use of the individual or entity to which it is addressed. If you are not the addressee indicated in this message, or the employee or agent responsible for delivering the message to the intended recipient, you may not copy or deliver this message or its attachments to anyone. Rather, you should permanently delete this message and its attachments and kindly notify the sender by reply e-mail. Any content of this message and its attachments, which does not relate to the official business of the sending company must be taken not to have been sent or endorsed by the sending company or any of its related entities. No warranty is made that the e-mail or attachment(s) are free from computer virus or other defect.
Mailman-Users mailing list Mailman-Users@python.org http://mail.python.org/mailman/listinfo/mailman-users Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/ Unsubscribe: http://mail.python.org/mailman/options/mailman-users/mlmn%40apcilog.org
Security Policy: http://www.python.org/cgi-bin/faqw-mm.py?req=show&file=faq01.027.htp
Spyro Polymiadis wrote:
We just have had one of our IT guys leave our company, and I was wondering if there was an easy (bulk, cli) way to remove/change the email address from the "List of Administrators" (2nd text box in General Options)
There are a couple of ways to do this. If the owners of all lists are the same, e.g. owner1@example.com, owner2@example.com and owner3@example.com, and you just want to remove owner2 from the list leaving the other 2, you can prepare a file containing the lines
owner = ['owner1@example.com', 'owner3@example.com' ]
and run
#!/bin/bash
cd /path/to/mailman
for list in bin/list_lists --bare
do bin/config_list -i path/to/file/above $list
done
If the owner lists are different and you just want to remove ownerx@example.com from all lists in which it is an owner, you can put the following script in Mailman's bin directory, naming it del_owner.py
def del_owner(mlist): if not mlist.Locked(): mlist.Lock() try: mlist.owner.remove('ownerx@example.com') print 'ownerx@example.com removed from %s' % mlist.real_name except ValueError: print 'ownerx@example.com not owner of %s' % mlist.real_name if not mlist.owner: print 'list %s has no owners' % mlist.real_name mlist.Save() mlist.Unlock()
After saving the above as bin/del_owner.py, run
bin/withlist -a -r del_owner
Note that the file name is del_owner.py, but there is no .py in either the withlist command or the function def.
-- Mark Sapiro <msapiro@value.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Thanks Mark,
There are 2 admins on there.. 1 person is on All of them, and the person who left is on about half of them.
Which method would be best suited for that scenario? Also, is any of the script destructive to the lists themselves? Ie, if it didn't run right or something it wouldn't affect the list accepting emails to it, or blowing away the rest of the list config?
Cheers
-----Original Message----- From: Mark Sapiro [mailto:msapiro@value.net] Sent: Tuesday, 20 November 2007 3:29 PM To: Spyro Polymiadis; mailman-users@python.org Subject: Re: [Mailman-Users] Removing admin email addresses
Spyro Polymiadis wrote:
We just have had one of our IT guys leave our company, and I was
wondering if there was an easy (bulk, cli) way to remove/change the email address from the "List of Administrators" (2nd text box in General Options)
There are a couple of ways to do this. If the owners of all lists are the same, e.g. owner1@example.com, owner2@example.com and owner3@example.com, and you just want to remove owner2 from the list leaving the other 2, you can prepare a file containing the lines
owner = ['owner1@example.com', 'owner3@example.com' ]
and run
#!/bin/bash cd /path/to/mailman for list in
bin/list_lists --bare
do bin/config_list -i path/to/file/above $list doneIf the owner lists are different and you just want to remove ownerx@example.com from all lists in which it is an owner, you can put the following script in Mailman's bin directory, naming it del_owner.py
def del_owner(mlist): if not mlist.Locked(): mlist.Lock() try: mlist.owner.remove('ownerx@example.com') print 'ownerx@example.com removed from %s' % mlist.real_name except ValueError: print 'ownerx@example.com not owner of %s' % mlist.real_name if not mlist.owner: print 'list %s has no owners' % mlist.real_name mlist.Save() mlist.Unlock()
After saving the above as bin/del_owner.py, run
bin/withlist -a -r del_owner
Note that the file name is del_owner.py, but there is no .py in either the withlist command or the function def.
-- Mark Sapiro <msapiro@value.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
This message and its attachments may contain legally privileged or confidential information. This message is intended for the use of the individual or entity to which it is addressed. If you are not the addressee indicated in this message, or the employee or agent responsible for delivering the message to the intended recipient, you may not copy or deliver this message or its attachments to anyone. Rather, you should permanently delete this message and its attachments and kindly notify the sender by reply e-mail. Any content of this message and its attachments, which does not relate to the official business of the sending company must be taken not to have been sent or endorsed by the sending company or any of its related entities. No warranty is made that the e-mail or attachment(s) are free from computer virus or other defect.
Spyro Polymiadis wrote:
Which method would be best suited for that scenario? Also, is any of the script destructive to the lists themselves? Ie, if it didn't run right or something it wouldn't affect the list accepting emails to it, or blowing away the rest of the list config?
That's why I would first do a "config_list -o" to "benchmark" the configs for ALL of the lists before you make any changes, "just in case". Use a for / do loop in shell, dump the list config to listname.cfg for e.g. for each list. Looks like you shouldn't need to load the entire config but just the changes, not sure if that was the case or not 5+ yrs ago when I was doing it or if what I did was overkill.
Jonathan
Spyro Polymiadis wrote:
There are 2 admins on there.. 1 person is on All of them, and the person who left is on about half of them.
Which method would be best suited for that scenario?
If I understand correctly, The end result you want is for the one remaining owner to be the single owner of all the lists. In this case, by far the simplest and safest is to run config_list on all lists with an input containing only the line
owner = ['remaining_owner@example.com']
Also, is any of the script destructive to the lists themselves? Ie, if it didn't run right or something it wouldn't affect the list accepting emails to it, or blowing away the rest of the list config?
The config_list with the above input is safe. It won't change anything but owner and it won't allow anything you couldn't enter via the web interface.
If you screw up withlist, you can destroy a list or lists, but the script below should be safe. Also, you can do a dry run by leaving out the
mlist.Save()
line. Then it won't actually change the list, so you could run withlist with the script without the mlist.Save(), and if you're happy with the output from the prints, replace the mlist.Save() and run it again.
-----Original Message----- From: Mark Sapiro [mailto:msapiro@value.net] Sent: Tuesday, 20 November 2007 3:29 PM To: Spyro Polymiadis; mailman-users@python.org Subject: Re: [Mailman-Users] Removing admin email addresses
<snip>
If the owner lists are different and you just want to remove ownerx@example.com from all lists in which it is an owner, you can put the following script in Mailman's bin directory, naming it del_owner.py
def del_owner(mlist): if not mlist.Locked(): mlist.Lock() try: mlist.owner.remove('ownerx@example.com') print 'ownerx@example.com removed from %s' % mlist.real_name except ValueError: print 'ownerx@example.com not owner of %s' % mlist.real_name if not mlist.owner: print 'list %s has no owners' % mlist.real_name mlist.Save() mlist.Unlock()
After saving the above as bin/del_owner.py, run
bin/withlist -a -r del_owner
Note that the file name is del_owner.py, but there is no .py in either the withlist command or the function def.
-- Mark Sapiro <msapiro@value.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
On 11/20/2007, Spyro Polymiadis (spyropolymiadis@kromestudios.com) wrote:
There are 2 admins on there.. 1 person is on All of them, and the person who left is on about half of them.
In the future, you might consider just using some generic addresses, like list-admin-1, list-admin-2, etc, and then simply alias those to whoever is assigned that role - this way you just change the alias to change the admin... Thats how I do all of my admin stuff, not just for mailman...
--
Best regards,
Charles
Spyro Polymiadis wrote:
Hi All,
Im using mailman 2.1.9, and ive got close to 100 mail lists on it.
We just have had one of our IT guys leave our company, and I was wondering if there was an easy (bulk, cli) way to remove/change the email address from the "List of Administrators" (2nd text box in General Options)
Otherwise, its very a very cumbersome job to log in to each list and remove the address manually.
When I did something similar, I wrote some ad hoc scripts using "config_list -o" to dump the configs for all of the lists to text files--saving the "pristine" version in case I needed to undo all the changes--then use regex replacement to make the changes I wanted and dump to a "new" config file, then "config_list -i" to load the modified configurations. I guess it was about 5 yrs ago, probably with shell commands and awk, I'm sure it wasn't pretty but it got the job done, doubt that I have any of the scripts that I used since that was a previous job. See "config_list --help" for the options and command syntax, you might have to login as the mailman user depending how you have things configured.
Naturally, make sure you have a good backup in case something goes awry. Depending on your bravery level, it might be a good idea to do it when the lists are less active, and possibly shut down the MTA temporarily or block access to it when you make the changes so you don't have "bits in flight" when the changes occur and have something untoward happen with the queue.
Jonathan
participants (5)
-
AD-ML
-
Charles Marcus
-
Jonathan Dill
-
Mark Sapiro
-
Spyro Polymiadis