On Thu, Mar 24, 2022 at 09:27:06PM -0700, Mark Sapiro wrote:
The issue is client.create_domain doesn't support setting a Web Host. Web Hosts are the sites in the django_site table and SITE_ID is the id of the table entry. See
sites
in the Django admin UI.So when you create a domain with client.create_domain it gets arbitrarily assigned to a
site
Ok thanks, this is good to know.
How about mailing list creation using Mailman Client, like this?
domains = client.domains domains = list(filter(lambda x: (domain_name == x.mail_host), domains)) # .. check if domains is a singleton list .. domain1 = domains[0] domain1.create_list(list_name, style_name=style_name)
Do you know of any quirks/deficiencies related to this kind of code?
This code is taken from mailman3-utils: https://github.com/sfindeisen/mailman3-utils , a set of scripts I stitched together to facilitate common Mailman3 operations on the command-line. Most importantly this can apply the (currently hardcoded) set of list settings uniformly across the different lists (and different domains). (I realize part of this overlaps with the mailman command, especially in the local setting.)
Thanks Stanisław