Is there a way to see all the list's held messages
I run mailman but do not admin the lists. Is there a way for me to see all the held messages for all the lists?
On 10/11/22 07:04, bob B via Mailman-users wrote:
I run mailman but do not admin the lists. Is there a way for me to see all the held messages for all the lists?
There are various things you can do depending on what you want. Does 'I
run mailman' mean you are an admin of the server on which it is
installed? If so, you can do this in mailman shell
, but what do you
want to see? I.e., just a summary by list of subject, sender and hold
reason or also the message content.
Also, the Django superuser has full admin access to all the lists and again depending on what you want, that may suffice.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
As always, thanks Mark, I have been meaning to dig into the shell, so now is a good time as any.
Mark Sapiro wrote:
On 10/11/22 07:04, bob B via Mailman-users wrote: [...] run mailman' mean you are an admin of the server on which it is installed? If so, you can do this in mailman shell, but what do you
in my case: yes
want to see? I.e., just a summary by list of subject, sender and hold reason
how would I do this?
Additional question: how would I set/change the owner of a number of lists identifyable by a regular expression?
On 10/15/22 02:47, Martin Lorenz wrote:
Mark Sapiro wrote:
On 10/11/22 07:04, bob B via Mailman-users wrote: [...] run mailman' mean you are an admin of the server on which it is installed? If so, you can do this in mailman shell, but what do you
in my case: yes
want to see? I.e., just a summary by list of subject, sender and hold reason
how would I do this?
For example, a mailman shell
interaction like this
$ /opt/mailman/mm/bin/mailman shell
Welcome to the GNU Mailman shell
Use commit() to commit changes.
Use abort() to discard changes since the last commit.
Exit with ctrl+D does an implicit commit() but exit() does not.
>>> for mlist in getUtility(IListManager):
... requests = IListRequests(mlist)
... first = True
... for request in requests.held_requests:
... key, data = requests.get_request(request.id)
... if first:
... first = False
... print(mlist.list_id)
... print(f"""\
... Sender: {data['_mod_sender']}
... Subject: {data['_mod_subject']}
... Date: {data['_mod_hold_date']}
... Reason: {data['_mod_reason']}
... """)
...
Additional question: how would I set/change the owner of a number of lists identifyable by a regular expression?
Something like this:
>>> import re
>>> newowner = 'newowner@example.com'
>>> user_manager = getUtility(IUserManager)
>>> # get the address record for the new owner
>>> address = user_manager.get_address(newowner)
>>> # create one if necessary
>>> if address is None:
... user = user_manager.create_user(newowner)
... address = list(user.addresses)[0]
...
>>> for mlist in getUtility(IListManager):
... if not re.search('the criterion', mlist.list_id):
... continue
... # remove existing owners
--- for owner in mlist.owners.members:
... owner.unsubscribe()
... # add new owner
... mlist.subscribe(address, MemberRole.owner)
...
>>> commit()
>>>
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (3)
-
bob B
-
Mark Sapiro
-
Martin Lorenz