Postorius is not currently exposing non-members management. Our Mailman 2 users are currently using accept_these_nonmembers, hold_these_nonmembers and reject_these_nonmembers. We know that mailman import21 will change these to nonmembers entries in Mailman 3. Since list owners will still want to manage them, we tend to move all of them to members and turn off delivery status for them.
However, we met some difficulties when we try to develop using mailman client.
- If those non-members addresses already exist as members, we will encounter error when we subscribe for them: urllib.error.HTTPError: HTTP Error 409: b'Member already subscribed'
- We cannot change the moderation_action: urllib.error.HTTPError: HTTP Error 400: b'Cannot convert parameters: moderation_action'
- We cannot change the preference: urllib.error.HTTPError: HTTP Error 400: b'Cannot convert parameters: delivery_status'
Are there any better ways to enable the list owners to manage those previously configured nonmembers' addresses through the web? Otherwise, we probably need to have some manual effort to overcome the above three issues. We know that we can always do the above manually but we got a lot of lists to migrate to Mailman 3.
On Tue, Dec 18, 2018, at 2:55 AM, Alan So wrote:
Postorius is not currently exposing non-members management. Our Mailman 2 users are currently using accept_these_nonmembers, hold_these_nonmembers and reject_these_nonmembers. We know that mailman import21 will change these to nonmembers entries in Mailman 3.
Since list owners will still want to manage them, we tend to move all of them to members and turn off delivery status for them.
I have been (slowly) working on exposing non-member management in Postorius (Mailman's web ui). I am hoping to complete it soon, but there is not clear ETA for it yet. I hope that it will be done soon.
However, we met some difficulties when we try to develop using mailman client.
Can you also please share the snippet of code you used for the these operations below so that we can help you fix them?
- If those non-members addresses already exist as members, we will encounter error when we subscribe for them: urllib.error.HTTPError: HTTP Error 409: b'Member already subscribed'
Do you expect something else here?
Any response with non-2XX status code is raised as HTTP Error in MailmanClient.
- We cannot change the moderation_action: urllib.error.HTTPError: HTTP Error 400: b'Cannot convert parameters: moderation_action'
I'd need to see the code fr this one, not sure what value did you pass here.
You should be able to do:
member1.moderation_action = 'hold' member1.save()
Allowed values should be:
- hold
- reject
- discard
- accept
- defer = 4
- We cannot change the preference: urllib.error.HTTPError: HTTP Error 400: b'Cannot convert parameters: delivery_status'
This is again depends on what you are passing as value for the parameter.
Allowed values are:
- enabled
- by_user (disabled by user)
- by_bounces (disabled due to bounces)
- by_moderator (disabled due to moderator)
- unknown (disabled for unknown reason
Are there any better ways to enable the list owners to manage those previously configured nonmembers' addresses through the web?
I am working on adding the support in the web ui, so yes, there will be better ways to manage those in future.
Otherwise, we probably need to have some manual effort to overcome the above three issues. We know that we can always do the above manually but we got a lot of lists to migrate to Mailman 3.
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/
-- thanks, Abhilash Raj (maxking)
Many thanks for your reply. Sorry for replying late as I was on vacation.
Here is the snippet of code I use. I originally want to test whether a non-member is already a member before subscribing. However, if he/she is not, the python script exit due to HTTP error. If I comment out the code, then there is error when it try to add the non-member as member. Concerning the moderation_action and delivery_status, thanks for showing me the allowed values. I have corrected that part.
One more question, can we remove the non-members? I am actually referring to the Example Usage doc (http://docs.mailman3.org/projects/mailmanclient/en/latest/src/mailmanclient/...)
Snippet of code: print ("\nNon-members:") for nonmember in my_list.nonmembers: print ("%s: role=%s moderation_action=%s" % (nonmember, nonmember.role, nonmember.moderation_action)) print ("Converting nonmember to member.....") importedmember = my_list.get_member(nonmember.email) if (importedmember): print ("Already imported " + nonmember.email) else: imported = my_list.subscribe(nonmember.email, 'Import from nonmember', pre_verified=True, pre_confirmed=True, pre_approved=True) importedmember = my_list.get_member(nonmember.email) importedmember.save() print ("Importing " + nonmember.email) importedmember.moderation_action = 'accept' importedmember.save() prefs = importedmember.preferences prefs['delivery_status'] = 'by_user' prefs.save()
I manage to use the following code to catch the http error code 409 so that the script won't exit. I hope that it is the appropriate way to handle.
So, the remaining question is whether a non-member can be removed as we do not want the remaining non-member setting affect member setting if such a member is removed using the web UI.
try: imported = my_list.subscribe(nonmember.email, 'Import from nonmember', pre_verified=True, pre_confirmed=True, pre_approved=True) importedmember = my_list.get_member(nonmember.email) print ("Importing " + nonmember.email) importedmember.moderation_action = nonmember.moderation_action importedmember.save() prefs = importedmember.preferences prefs['delivery_status'] = 'by_user' prefs.save() except HTTPError as e: if (e.code == 409): print ("Already imported " + nonmember.email) else: raise
participants (2)
-
Abhilash Raj
-
Alan So