Hey Stephen, thank you for your answer.
Am 31.12.23 um 08:45 schrieb Stephen J. Turnbull:
My guess is that the REST API is expecting a single JSON object, and you sent it multiple parameters.
Have you played with the REST API interactively? The documentation at
https://docs.mailman3.org/projects/mailman/en/latest/src/mailman/rest/docs/r...
is really quite good as a tutorial. It's not a full API reference, and not organized that way, although the table of contents is very useful for what it does mention. But I think what you need (if you want to explore it that deeply) is a tutorial to get a "feel" for how the REST API "likes to talk".
Thanks for this advice. I did read the doc and figured out, that PUT and PATCH for my concerns should be the right way to do it: https://docs.mailman3.org/projects/mailman/en/latest/src/mailman/rest/docs/l... (PUT for all writable attributes, with PATCH, one can change one attribute at a time)
When playing around, I figured out that there are also Read-only attributes, that can't be set (just got that when Playing with PATCH-command), which are exactly the ones in the PUT-error.
So my main question is now: does anybody know of a possibility with this command to extract only writable attributes!? The ones that are too much are: "Unexpected parameters: bounces_address, created_at, digest_last_sent_at, fqdn_listname, http_etag, join_address, last_post_at, leave_address, list_name, mail_host, next_digest_number, no_reply_address, owner_address, post_id, posting_address, request_address, usenet_watermark, volume"
You should post the exact command or interactive conversation you're using.
Getting the config: curl -u restadmin:restpass localhost:8001/3.1/lists/listname.domain/config | jq > listname.domain
curl -u restadmin:restpass -d @listname.domain -H "Content-Type: application/json" -X PATCH localhost:8001/3.1/lists/listname.domain/config
-> one has to be careful when deleting attributes, at the end of an array, there must not be a "," (!) :-)
Is there another way to preserve these information about the members?
You can query the REST API (you might need to fetch the subscriber roster, then iterate over that to get the details), or you can dump the database table (or the whole database) using SQL-based utilities like psql (Postgres, I forget the MySQL equivalent).
The first point sounds reasonable and I get now with the doc, how it could work ... but maybe a little too much for now, dommage.
Just tried getting all the members: curl -u restadmin:restpass localhost:8001/3.1/lists/listname.domain/roster/member | jq > listname.domain.members
But putting them back seems to be a different thing: curl -u restadmin:restpass -d @listname.domain.members -H "Content-Type: application/json" -X PUT localhost:8001/3.1/lists/listname.domain/roster/members
(in general I don't think a lot of people put in effort to customize there memeberships ... and furthermore they would need to register, right?)
Not sure what you mean by "register", but every address that writes to Mailman gets a temporary user until a "real" user claims it via the mailbox ownership dance. If they receive mail in a mailbox, they've done the ownership dance for that mailbox. If you don't preserve that record, they'll have to do it again.
Yes. I was talking about "real" users that claim ownership by registering via their mailaddress.
Thanks for your answers again, regards.