
Hello Mark, hello Stephen,
sorry for bothering again...but the amount of documentation is overwhelming... Some info about my setup: I run mailman3 in an virtual environment with postgresql-Server (all in recent versions) - operating system Ubuntu 24.04-LTS.
My aim is to provide one high-level script for the daily task of list creation.
- list creation via command-line script with two/three parameters like: ./create-list --listname myfirst.list@lists.example.org --admin-email admin-user@example.org [--admin-name "Peter Rabbit"]
The create-list script itself should be a bash- or perl-script (I am not very familiar with python - SORRY ;-) ) I would like the scripts to trigger some curl-calls on the mailman server (from outside the mailman shell and even from outside the virtual environment) Reading the RestAPI documentation here: https://docs.mailman3.org/projects/mailman/en/latest/src/mailman/rest/docs/u... several questions arise:
- Can I succeed with this plan? (Are curl-calls sufficient? Is it possible from outside the virtual environment?)
- Is this a viable curl-call to create a user?: curl -X POST -u 'admin-user:<password>' -H "Content-Type: application/json" -d '{ "email": "peter.rabbit@example.org", "display_name": "Peter Rabbit", "password": "secret" }' http://localhost:8001/3.1/users
- and in a second step can I assign this user to a list as owner with a curl-call like this?: curl -X POST -u 'admin-user:<password>' -H "Content-Type: application/json" -d '{ "list_id": "newsletter.lists.example.org", "subscriber": "peter.rabbit@example.org", "role": "owner" }' http://localhost:8001/3.1/members
- What about the commits that are used while operating in mailman shell? (Do I have to trigger commits while operating via curl-calls? And how can I trigger commits via curl?)
- In the unlikely event that I change from the dark side to the good side i.e. "python programming" ;-) is there a "to-the-point" reference for IListManager, IUserManager etc. giving available functions (with parameters) in a kind of list way? (the example kind of documentation referenced above is good, but where can I find a list of all functions?)
- I think the starting point for managing lists with python is here: https://docs.mailman3.org/projects/mailman/en/latest/src/mailman/commands/do... right?
- Going the python way will require to enter the virtual environment, right? (otherwise the libraries, environment variables etc. are not available...I think)
Thank you for some guidance here... :-)
Kind regards
Chris