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