Mailman3 equivalent of list_owners binary

Hi,
In our Mailman 2 environment we have a script that uses the binaries 'mailman/bin/list_owners' and 'mailman/bin/sync_members' to keep a list of owners up to date. This is handy for sending out service notifications to all list owners. Unfortunately, there doesn't seem to be an exact equivalent in Mailman 3 for list_owners.
I've tried using the command 'mailman members --role administrator LISTSPEC' whilst looping through each list from the output of 'mailman lists'. It almost does the job, but in cases where an owner has a display name set the sync fails as it cannot parse these lines.
e.g. Cannot parse as valid email address (skipping): Smith, John <john.smith@example.com>
I can probably try to clean the output of "mailman members" before doing 'mailman syncmembers'. I just wondered if anybody is doing something similar and has a better approach I'm missing?
Thanks

On Thu, Oct 2, 2025 at 6:39 PM <l.reilly@ucl.ac.uk> wrote:
Hi,
In our Mailman 2 environment we have a script that uses the binaries 'mailman/bin/list_owners' and 'mailman/bin/sync_members' to keep a list of owners up to date. This is handy for sending out service notifications to all list owners. Unfortunately, there doesn't seem to be an exact equivalent in Mailman 3 for list_owners.
I've tried using the command 'mailman members --role administrator LISTSPEC' whilst looping through each list from the output of 'mailman lists'. It almost does the job, but in cases where an owner has a display name set the sync fails as it cannot parse these lines.
e.g. Cannot parse as valid email address (skipping): Smith, John < john.smith@example.com>
I can probably try to clean the output of "mailman members" before doing 'mailman syncmembers'. I just wondered if anybody is doing something similar and has a better approach I'm missing?
Chatgpt :)
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 In an Internet failure case, the #1 suspect is a constant: DNS. "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-) [How to ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html]

On 10/2/25 08:38, l.reilly@ucl.ac.uk wrote:
I've tried using the command 'mailman members --role administrator LISTSPEC' whilst looping through each list from the output of 'mailman lists'. It almost does the job, but in cases where an owner has a display name set the sync fails as it cannot parse these lines.
e.g. Cannot parse as valid email address (skipping): Smith, John <john.smith@example.com>
The issue here is when the display name contains a comma or other special character, it should be quoted as in "Smith, John" <john.smith@example.com> to be parsed as an email address/display name. The absence of quotes in the output of `mailman members` is not really a bug as that output is intended only for humans, but you could apply this patch to provide them. ``` --- a/src/mailman/commands/cli_members.py +++ b/src/mailman/commands/cli_members.py @@ -112,7 +112,7 @@ if email_only or not dn: print(address.original_email, file=outfp) else: - print(f'{dn} <{address.original_email}>', + print(f'"{dn}" <{address.original_email}>', file=outfp) ``` Otherwise, you could supply the -e/--email-only option to `mailman members` to not include the display names in the output. -- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (3)
-
l.reilly@ucl.ac.uk
-
Mark Sapiro
-
Odhiambo Washington