Using the API to create nonmembers with a different moderation action than the list default
Hi,
My next challenge is to script the setup of a bunch of nonmembers who have a moderation action of accept (or maybe defer) whilst the list itself has a nonmember action of hold.
This is due to a relatively heavy use of nested lists, and have a fair number of people who might possibly send to all lists, and are important enough they wouldn't want to be manually allowed each time even if it only once.
When using the mailmanclient python bindings I have worked out I can add nonmembers with something like:
mailing_list.add_role('nonmember', 'nonmember@yourdomain.com', display_name='Non Member')
However I can't see anything in the mailmanclient docs which suggest it is possible to configure a member_moderation_action or moderation_action field for that member.
I assume I'll need to fall back to using the REST API directly, and most likely something along these lines:
1/ Obtain the member ID for an email address of someone who already been added as a nonmember.
2/ Patch an endpoint which looks something like: /members/{member_id}
I'm not able to use the mailman binary (e.g mailman shell) on the mailman-core host itself as I would like to query an existing database of people and reach out to a mailman endpoint from the database host rather than opening that host up to further network access.
I figured it might be a good stage in which to ask for a little help and pointers before I continue, perhaps there is something I have missed for a better way to approach this.
Thanks.
Regards, Perry
On Fri, 7 Jun 2024, at 12:06 PM, Perry Kollmorgen wrote:
However I can't see anything in the mailmanclient docs which suggest it is possible to configure a member_moderation_action or moderation_action field for that member.
Take a look at this: https://docs.mailman3.org/projects/mailmanclient/en/latest/src/mailmanclient...
Setting moderation action for a member/nom-member should be same, you can get non-member using their email address with mailinglist.get_nonmeber('<email>')
-- thanks, Abhilash Raj (maxking)
Oh great, thanks, that is working for me.
Also, thanks for the docker-mailman project, containers in the homelab space seem to be gaining popularity and everything is becoming easier for it all to work smoothly.
Cheers, Perry
From: Abhilash Raj <maxking@asynchronous.in> Sent: Friday, 7 June 2024 5:10 PM To: Perry Kollmorgen <pcjkollmorgen@hotmail.com>; Mailman users <mailman-users@mailman3.org> Subject: Re: [MM3-users] Using the API to create nonmembers with a different moderation action than the list default
On Fri, 7 Jun 2024, at 12:06 PM, Perry Kollmorgen wrote:
However I can't see anything in the mailmanclient docs which suggest it is possible to configure a member_moderation_action or moderation_action field for that member.
Take a look at this: https://docs.mailman3.org/projects/mailmanclient/en/latest/src/mailmanclient...
Setting moderation action for a member/nom-member should be same, you can get non-member using their email address with mailinglist.get_nonmeber('<email>')
-- thanks, Abhilash Raj (maxking)
On 6/6/24 11:36 PM, Perry Kollmorgen wrote:
Hi,
My next challenge is to script the setup of a bunch of nonmembers who have a moderation action of accept (or maybe defer) whilst the list itself has a nonmember action of hold.
This is due to a relatively heavy use of nested lists, and have a fair number of people who might possibly send to all lists, and are important enough they wouldn't want to be manually allowed each time even if it only once.
Note that beginning with Mailman 3.3.10 (not yet released) you can put things like @list2@example.com in accept_these_nonmembers of list1@example.com to accept posts from non_members who are members of list2@example.com. See https://gitlab.com/mailman/mailman/-/merge_requests/1154
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Oh great, that will be very useful when it is ready.
It is easy for standard users to maintain a list which can be used also for sending access to other lists, particularly when nested.
This along with the extra URL variables for use in templates look handy also. I already have added some URLs to our templates manually however if we expand to other domains it would save on some updating of templates.
Usually, I would look to merge in useful PRs to my own branch of the source code used in production however with the use of docker this time around it isn't quite as easy. Likely not too difficult, but it might be good to wait too.
Regards, Perry
From: Mark Sapiro <mark@msapiro.net> Sent: Saturday, June 8, 2024 3:59:46 AM To: mailman-users@mailman3.org <mailman-users@mailman3.org> Subject: [MM3-users] Re: Using the API to create nonmembers with a different moderation action than the list default
On 6/6/24 11:36 PM, Perry Kollmorgen wrote:
Hi,
My next challenge is to script the setup of a bunch of nonmembers who have a moderation action of accept (or maybe defer) whilst the list itself has a nonmember action of hold.
This is due to a relatively heavy use of nested lists, and have a fair number of people who might possibly send to all lists, and are important enough they wouldn't want to be manually allowed each time even if it only once.
Note that beginning with Mailman 3.3.10 (not yet released) you can put things like @list2@example.com in accept_these_nonmembers of list1@example.com to accept posts from non_members who are members of list2@example.com. See https://gitlab.com/mailman/mailman/-/merge_requests/1154
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Mailman-users mailing list -- mailman-users@mailman3.org To unsubscribe send an email to mailman-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 to pcjkollmorgen@hotmail.com
participants (3)
-
Abhilash Raj
-
Mark Sapiro
-
Perry Kollmorgen