Hi,
I try to find documentation and examples to manage mailman3 with "mailman shell". By example, when i tryied just to define global configuration for all users, like in this example ( https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/thread/K... ), but it changes nothing :
|# mailman shell -l testlist@domain.tld | ||>>> from mailman.interfaces.action import Action >>> for mbr in m.members.members: mbr.moderation_action = Action.defer |||commit()|
|||>>> from mailman.interfaces.action import Action |||||||>>> english = getUtility(ILanguageManager).get('en')| >>> for mbr in m.members.members: || mbr.preferences.acknowledge_posts = False mbr.preferences.delivery_mode = DeliveryMode.regular mbr.preferences.delivery_status = DeliveryStatus.enabled mbr.preferences.hide_address = False mbr.preferences.preferred_language = english mbr.preferences.receive_list_copy = False mbr.preferences.receive_own_postings = True|commit()||
Before the shell command, the web interface was with an other language (i tested with italian one) and other options preferences, but after the shell command, after a web interface refresh, it doesn't change.
am i wrong somewhere ?
Regards,
On 16/09/2023 23:05, Stephen J. Turnbull wrote:
Hi
testeur via Mailman-users writes:
I have installed mailman3 and i want to administrate it with rest api,
Do you really mean REST API, or do you mean CLI?
i tryied with curl to manage it, i can see if there is a pending message with :
curl --user restadmin:restpass http://localhost:8001/3.1/lists/ml@domain.tld/held/count|| python3 -m json.tool|
This is a lot easier using "mailman shell" if you want to use CLI, or a Python program using mailmanclient if you really want to use the REST API for some reason.
This is explained here: https://docs.mailman3.org/projects/mailman/en/latest/src/mailman/model/docs/... but it's likely to be pretty rough going for you because it's really oriented to programmers studying to be Mailman developers, not for admins.
but how to delete all held messages ? is it possible in one time ?
No, you need to fetch the list and then loop over the messages.
And how to select a specific message to discard /accept / defer ?
do i have to use a POST ?
This is all explained here: https://docs.mailman3.org/projects/mailman/en/latest/src/mailman/rest/docs/p...
Steve
Mailman-users mailing list --mailman-users@mailman3.org To unsubscribe send an email tomailman-users-leave@mailman3.org https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/ Archived at:https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/message/...
This message sent totesteur@starinux.org