command line tool to list ban_list, discard_these_nonmembers, accept_these_nonmembers, etc
![](https://secure.gravatar.com/avatar/2b8b4785c960b044823e65d0fbe59d1b.jpg?s=120&d=mm&r=g)
Is there a succinct way to list "auxiliary" addresses that are configured in a list? By "auxiliary" I'm referring to addresses other than member, owner, or moderator, since those are easy to find with list_owners and find_members.
I'm trying to practice better list hygiene, and remove all relevant address when someone leaves the organization. The best way I've currently found is use a foreach loop to grab each list's config.pck and run dumpdb against it. I then filter out the uninteresting addresses and manually scan the results for relevant addresses.
I can't simply grep the output for relevant addresses, because a subscriber john.doe@domain.com may be allowed (or disallowed) to post from jd123@free-email.com. I don't mind the manual scanning, but parsing the output if dumped is time consuming. I'm guessing there's a way to grep for the relevant settings and all relevant following lines, but my regex skills have not been up to the task.
I took a look at https://www.msapiro.net/scripts/non_members, but it appears to require that I know the addresses in advance, and not allow me to discover the relevant addresses. It also doesn't support ban_list, which is admittedly a rare occurrence for me, but I don't know if there are other unincluded settings I should be considering.
I suppose this raises a question of other possible list hygiene best-practices. Besides removing subscriptions and removing/reassigning administrator or moderator responsibilities, when else should I be doing to clean up when someone leaves?
Thanks!
--
Matthew Needham mneedham@hdfgroup.org 217-531-6110
The HDF Group 1800 South Oak Street, Suite 203 Champaign, IL 61820
![](https://secure.gravatar.com/avatar/56f108518d7ee2544412cc80978e3182.jpg?s=120&d=mm&r=g)
On 7/8/16 10:11 AM, Matthew Needham wrote:
Is there a succinct way to list "auxiliary" addresses that are configured in a list? By "auxiliary" I'm referring to addresses other than member, owner, or moderator, since those are easy to find with list_owners and find_members.
Since it was trivial to do, I just created <https://www.msapiro.net/scripts/list_etc.py>. Try it.
Note that the output is a bit cleaner if you redirect stderr from the withlist command to /dev/null.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
![](https://secure.gravatar.com/avatar/2b8b4785c960b044823e65d0fbe59d1b.jpg?s=120&d=mm&r=g)
Mark,
On Jul 8, 2016, at 17:39 PM, Mark Sapiro <mark@msapiro.net> wrote:
On 7/8/16 10:11 AM, Matthew Needham wrote:
Is there a succinct way to list "auxiliary" addresses that are configured in a list? By "auxiliary" I'm referring to addresses other than member, owner, or moderator, since those are easy to find with list_owners and find_members.
Since it was trivial to do, I just created <https://www.msapiro.net/scripts/list_etc.py>. Try it.
Thanks! However, I'm seeing "ValueError: zero length field name in format" whether I run it for all lists or one:
[root@lw4 mailman]# ./bin/withlist -a -r list_etc Importing list_etc... Running list_etc.list_etc()... Loading list hdf5lib_lists.hdfgroup.org (unlocked) Traceback (most recent call last): File "./bin/withlist", line 299, in <module> main() File "./bin/withlist", line 274, in main r = [do_list(listname, args, func) for listname in Utils.list_names()] File "./bin/withlist", line 202, in do_list return func(m, *args) File "/usr/local/cpanel/3rdparty/mailman/bin/list_etc.py", line 29, in list_etc print('List:{}'.format(mlist.real_name)) ValueError: zero length field name in format Finalizing
[root@lw4 mailman]# ./bin/withlist -r list_etc hdf-forum_lists.hdfgroup.org Importing list_etc... Running list_etc.list_etc()... Loading list hdf-forum_lists.hdfgroup.org (unlocked) Traceback (most recent call last): File "./bin/withlist", line 299, in <module> main() File "./bin/withlist", line 277, in main r = do_list(listname, args, func) File "./bin/withlist", line 202, in do_list return func(m, *args) File "/usr/local/cpanel/3rdparty/mailman/bin/list_etc.py", line 29, in list_etc print('List:{}'.format(mlist.real_name)) ValueError: zero length field name in format Finalizing
Have I missed something?
Thanks again.
--
Matthew Needham mneedham@hdfgroup.org 217-531-6110
The HDF Group 1800 South Oak Street, Suite 203 Champaign, IL 61820
![](https://secure.gravatar.com/avatar/56f108518d7ee2544412cc80978e3182.jpg?s=120&d=mm&r=g)
On 07/11/2016 08:35 AM, Matthew Needham wrote:
Thanks! However, I'm seeing "ValueError: zero length field name in format" whether I run it for all lists or one:
[root@lw4 mailman]# ./bin/withlist -a -r list_etc Importing list_etc... Running list_etc.list_etc()... Loading list hdf5lib_lists.hdfgroup.org (unlocked) Traceback (most recent call last): File "./bin/withlist", line 299, in <module> main() File "./bin/withlist", line 274, in main r = [do_list(listname, args, func) for listname in Utils.list_names()] File "./bin/withlist", line 202, in do_list return func(m, *args) File "/usr/local/cpanel/3rdparty/mailman/bin/list_etc.py", line 29, in list_etc print('List:{}'.format(mlist.real_name)) ValueError: zero length field name in format Finalizing
The issue is this "'List:{}'.format(mlist.real_name)" requires Python 2.7. With Python 2.6 it needs to be 'List:{0}'.format(mlist.real_name). For older versions, there is no format string method, so string interpolation as in 'List:%s' % mlist.real_name needs to be used.
I have updated the scripts at <https://www.msapiro.net/scripts/list_etc.py> and the mirror at <https://fog.ccsf.edu/~msapiro/scripts/list_etc.py> to work with older Python versions.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
![](https://secure.gravatar.com/avatar/2b8b4785c960b044823e65d0fbe59d1b.jpg?s=120&d=mm&r=g)
Thanks, Mark. That works perfectly.
--
Matthew Needham mneedham@hdfgroup.org 217-531-6110
The HDF Group 1800 South Oak Street, Suite 203 Champaign, IL 61820
participants (2)
-
Mark Sapiro
-
Matthew Needham