duplicate SITE_IDs and broken /postorius/lists/ display; Mailman Client
Hi
I am having 4 different virtual domains (FILTER_VHOST = True). However on the domain list page in Postorius: https://.../postorius/domains/ I can see only 3 different SITE_IDs: 1,1,4,3. If I recall correctly, the "3" and "4" were created manually using the Postorius Web UI, whereas the two "1"s were created using the Mailman Client:
client.create_domain(name)
Is this a bug? Or did I mess something up? What significance do those SITE_IDs have?
What I also noticed is that in the Postorius Web UI: https://.../postorius/lists/ both "1" domains display the lists contained in "3", whereas both "3" and "4" display correctly their lists. Except the "3", all domains are empty at the moment (no lists) (so "4" correctly displays no lists). Not sure if this is related?...
Mailman Core Version GNU Mailman 3.3.3 (Tom Sawyer) Mailman Core API Version 3.1 Mailman Core Python Version 3.9.2 (default, Feb 28 2021, 17:03:44) [GCC 10.2.1 20210110]
Thanks! Stanisław
I manually deleted both "1" domains in the Postorius Web UI, then recreated them there (so they now have new SITE_IDs, this time unique), and it solved all these problems. Now those newly created domains even have owners.
It looks the domain creation in the Mailman Client is somewhat broken?...
Thanks Stanisław
If you have domains registered here: https://.../admin/sites/site/ but not here: https://.../postorius/domains/ then all lists from other domains are displayed. Might this be the case with your situation?
If you register the domain here: https://.../postorius/domains/ and have no lists, then no list is shown I think.
Am 24.03.22 um 09:11 schrieb Stanisław Findeisen via Mailman-users:
What I also noticed is that in the Postorius Web UI:https://.../postorius/lists/ both "1" domains display the lists contained in "3", whereas both "3" and "4" display correctly their lists. Except the "3", all domains are empty at the moment (no lists) (so "4" correctly displays no lists). Not sure if this is related?...
On 3/24/22 01:11, Stanisław Findeisen via Mailman-users wrote:
Hi
I am having 4 different virtual domains (FILTER_VHOST = True). However on the domain list page in Postorius: https://.../postorius/domains/ I can see only 3 different SITE_IDs: 1,1,4,3. If I recall correctly, the "3" and "4" were created manually using the Postorius Web UI, whereas the two "1"s were created using the Mailman Client:
client.create_domain(name)
Is this a bug? Or did I mess something up? What significance do those SITE_IDs have?
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
What I also noticed is that in the Postorius Web UI: https://.../postorius/lists/ both "1" domains display the lists contained in "3", whereas both "3" and "4" display correctly their lists. Except the "3", all domains are empty at the moment (no lists) (so "4" correctly displays no lists). Not sure if this is related?...
FILTER_VHOST = True is imperfect. Lists have no Web Host attribute, only a Mail Host. Thus, with FILTER_VHOST = True, we get the Mail Host from the domains that have a Web Host matching the host in the http request. If that results in only one Mail Host, we limit the display to only those lists with that Mail Host, but otherwise we don't limit by domain.
In other words, FILTER_VHOST = True only works if each Mail Host domain has a unique Web Host. If you have multiple Mail Host domains with the same Web Host (SITE_ID), FILTER_VHOST won't work for that Web Host.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
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
On 3/25/22 06:33, Stanisław Findeisen via Mailman-users wrote:
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?
It looks fine to me.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (3)
-
Jens Günther
-
Mark Sapiro
-
Stanisław Findeisen