On 2/26/26 13:20, Ibiam Chihurumnaya via Mailman-users wrote:
I'm doing it in `mailman shell`, list_name is a List object, and it seems to
have a `settings`
attribute as `list_name.settings` returns
{'acceptable_aliases': [], ...}
I would really like to know what Mailman version this is, and how it was
installed? In my case with Mailman core from the head of the GitLab branch:
```
$ 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
>>> m.settings
Traceback (most recent call last):
File "<console>", line 1, in <module>
AttributeError: 'MailingList' object has no attribute 'settings'
>>> m.settings['accept_these_nonmembers']
Traceback (most recent call last):
File "<console>", line 1, in <module>
AttributeError: 'MailingList' object has no attribute 'settings'
>>>
```
Presumably in your case, you could do
```
list_name.settings['accept_these_nonmembers'].append('[email protected]')
or
list_name.settings['accept_these_nonmembers'].extend(['[email protected]',
'[email protected]', '[email protected]'])
```
but as I've said previously, `accept_these_nonmembers` is not the
preferred way to do this. Something like
```
$ mailman addmembers --delivery disabled FILE LIST
```
where FILE contains the addresses to add, one per line and LIST is the
list name would add the addresses as members with delivery disabled. To
add them as nonmembers with moderation_action Defer:
```
$ 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
>>> from mailman.app.membership import add_member
>>> addresses = ('[email protected]', '[email protected]',
... '[email protected]')
>>> for addr in addresses:
... rr = RequestRecord(addr)
... nm = add_member(m, rr, role=MemberRole.nonmember)
... nm.moderation_action = Action.defer
...
>>>commit()
```
Of course, all of this can be done, perhaps more easily, using the
Postorius web UI.
--
Mark Sapiro <[email protected]> The highway is for gamblers,
San Francisco Bay Area, California better use your sense - B. Dylan
_______________________________________________
Mailman-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/
Archived at:
https://lists.mailman3.org/archives/list/[email protected]/message/RGCTDBV423SQXZ3E64UJZM4H2BBN2A4V/
This message sent to [email protected]