9 Feb
2024
9 Feb
'24
11:39 p.m.
On 2/7/24 02:37, Zaheer Abbas wrote:
I do the above via postorius because I couldn't find a way to do this via mailman shell.
Something like
mark@msapiro:~$ mailman shell -l list@example.com
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.
The variable 'm' is the list@example.com mailing list
>>> NEW_NONMEMBERS = [('First User', 'user1@example.com'),
... ('Second User', 'user2@example.com'),
... ('Third User', 'user3@example.com'),
... ]
>>> from mailman.app.membership import add_member
>>> from mailman.interfaces.subscriptions import RequestRecord
>>> for display_name, email in NEW_NONMEMBERS:
... record = RequestRecord(email,
... display_name=display_name,
... delivery_mode=None,
... )
... member = add_member(m, record, role=MemberRole.nonmember)
... member.moderation_action = Action.accept
...
>>> commit()
>>>
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan