Postorius & multi domain
Hi, on a fresh debian 10 (mail server) I added mailman3 with:
apt-get install mailman3-full
dpkg-reconfigure mailman3 dpkg-reconfigure mailman3-web
The server name is webserver-A
Then I log in in webserver-A/mailman3 as a superuser I created a domain for webserver-A and domain-A The I created a list-A
Then I created a second domain for webserver-B and domain-B
Then I added to apache config a virtual host for webserver-B
I log in webserver-B as the some superuser of webserver-A and I created a list-B
But when I list the lists I can see both under webserver-A and webserver-B. The some problem with archiving hyperkitty.
I search internet for a while and I discovered that using FILTER_VHOST = True seems to solve the problem.
From posotrius config page:
FILTER_VHOST Filter the list of available lists in Postorius and Hyperkitty depending on the domain they are being currently served from. Mailman 3 supports multiple domains in a single installation.
But it doesn't work. I got err 500 form apache.
Were can I find an explanation or a how to configure the system to have 2 webserver with different domains working on the some server as it was with mailman 2?
P.S.: I upgrade postorius to V. 1.3.2 and djando V 2.2.12 using the packages in testing distribution.
The debian 10 official postorius package is too old (1.2.24) and does not support FILTER_VHOST
Thanks in advance
-- Gelpi ing. Andrea
I documenti vitali dimostreranno la loro vitalitˆ spostandosi spontaneamente da dove li avevate lasciati a dove non riuscirete a trovarli.
On 4/22/20 8:14 AM, Gelpi Andrea wrote:
I search internet for a while and I discovered that using FILTER_VHOST = True seems to solve the problem.
From posotrius config page:
FILTER_VHOST Filter the list of available lists in Postorius and Hyperkitty depending on the domain they are being currently served from. Mailman 3 supports multiple domains in a single installation.
But it doesn't work. I got err 500 form apache.
FILTER_VHOST is currently broken unless each domain has the same value for the web and email domains. See the thread at <https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/thread/Z7X7EPA5SPPIALA4ENQYN437QSMIEVAR/> and the issue at <https://gitlab.com/mailman/postorius/-/issues/394>.
Were can I find an explanation or a how to configure the system to have 2 webserver with different domains working on the some server as it was with mailman 2?
If each domain has the same value for the web and email hosts, FILTER_VHOST will work.
Currently though if you have domains like web host = lists.example.com and email host = example.com, FILTER_VHOST is broken.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Thank You so much for your quickly answer and explanation.
I understand that the web server name must be equal to the email domain. I read the issue.
I'm not a python programmer so I ask you if it'd be long to implement a workaround like this.
If the web server is a.example.com and the email domain is example.com
It'd be possible to drop the "a" and send the email domain only in the query?
It's a workaround. Can you help me in this?
Regards,
AG
Il 22/04/20 18:22, Mark Sapiro ha scritto:
On 4/22/20 8:14 AM, Gelpi Andrea wrote:
I search internet for a while and I discovered that using FILTER_VHOST = True seems to solve the problem.
From posotrius config page:
FILTER_VHOST Filter the list of available lists in Postorius and Hyperkitty depending on the domain they are being currently served from. Mailman 3 supports multiple domains in a single installation.
But it doesn't work. I got err 500 form apache.
FILTER_VHOST is currently broken unless each domain has the same value for the web and email domains. See the thread at <https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/thread/Z7X7EPA5SPPIALA4ENQYN437QSMIEVAR/> and the issue at <https://gitlab.com/mailman/postorius/-/issues/394>.
Were can I find an explanation or a how to configure the system to have 2 webserver with different domains working on the some server as it was with mailman 2?
If each domain has the same value for the web and email hosts, FILTER_VHOST will work.
Currently though if you have domains like web host = lists.example.com and email host = example.com, FILTER_VHOST is broken.
-- Gelpi ing. Andrea
I documenti vitali dimostreranno la loro vitalitˆ spostandosi spontaneamente da dove li avevate lasciati a dove non riuscirete a trovarli.
On 4/22/20 11:37 AM, Gelpi Andrea wrote:
I'm not a python programmer so I ask you if it'd be long to implement a workaround like this.
If the web server is a.example.com and the email domain is example.com
It'd be possible to drop the "a" and send the email domain only in the query?
It's a workaround. Can you help me in this?
I'm currently working on a better fix. I'll post here on my progress.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
On 4/22/20 11:52 AM, Mark Sapiro wrote:
I'm currently working on a better fix. I'll post here on my progress.
I've got a tentative fix at <https://gitlab.com/mailman/postorius/-/merge_requests/500/>. You can see the changes there to the file src/postorius/views/list.py.
This fix is limited in that it should enable FILTER_VHOST work in an environment where there are domains with web host different from mail host, but if there are multiple domains with the same web host but differing mail hosts, going to that domain's Postorius lists view will show all domains as if FILTER_VHOST is False.
I.e. consider the following set of domains:
mail host web host example.com lists.example.com example.net example.net example.org lists.example.org example.edu lists.example.org
With the fix installed and FILTER_VHOST = True
https://lists.example.com/postorius/lists/ will show only the example.com lists
https://example.net/postorius/lists/ will show only the example.net lists
but https://lists.example.org/postorius/lists/ will show all lists, not just the example.org and example.edu lists.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Il 23/04/20 01:08, Mark Sapiro ha scritto:
On 4/22/20 11:52 AM, Mark Sapiro wrote:
I'm currently working on a better fix. I'll post here on my progress.
I've got a tentative fix at <https://gitlab.com/mailman/postorius/-/merge_requests/500/>. You can see the changes there to the file src/postorius/views/list.py.
This fix is limited in that it should enable FILTER_VHOST work in an environment where there are domains with web host different from mail host, but if there are multiple domains with the same web host but differing mail hosts, going to that domain's Postorius lists view will show all domains as if FILTER_VHOST is False.
I.e. consider the following set of domains:
mail host web host example.com lists.example.com example.net example.net example.org lists.example.org example.edu lists.example.org
With the fix installed and FILTER_VHOST = True
https://lists.example.com/postorius/lists/ will show only the example.com lists
https://example.net/postorius/lists/ will show only the example.net lists
but https://lists.example.org/postorius/lists/ will show all lists, not just the example.org and example.edu lists.
I saw the change in the file.
As I'm not a programmer How can I test your fix?
My system was installed via Debian 10 stable repository.
I upgrade with testing repository postorius, django and mailmanclinet
Postorius V 1.3.2 Django V. 2.2.12 Django filters V 2.1.0 Djanog mailman V 1.3.2 mailmanclient V 3.3.0
Thnak You
-- Gelpi ing. Andrea
I documenti vitali dimostreranno la loro vitalitˆ spostandosi spontaneamente da dove li avevate lasciati a dove non riuscirete a trovarli.
On 4/23/20 2:48 AM, Gelpi Andrea wrote:
I saw the change in the file.
As I'm not a programmer How can I test your fix?
My system was installed via Debian 10 stable repository.
I upgrade with testing repository postorius, django and mailmanclinet
Postorius V 1.3.2 Django V. 2.2.12 Django filters V 2.1.0 Djanog mailman V 1.3.2 mailmanclient V 3.3.0
I don't know where the Debian package puts things, but you have to find the location of postorius/views/list.py. Something like
locate views/list.py
should find it. Then you need to download <https://gitlab.com/mailman/postorius/-/merge_requests/500.diff> and edit it to remove the first 15 lines so the first remaining line is the
diff --git a/src/postorius/views/list.py b/src/postorius/views/list.py
line. Then make a backup copy of postorius/views/list.py and run the command
patch postorius/views/list.py path/to/500.diff
where postorius/views/list.py is actually the full path to postorius/views/list.py and 500.diff is the edited file you downloaded.
Then restart uWSGI. If anything goes wrong, restore your backup copy of postorius/views/list.py and restart uWSGI.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Mark Sapiro a écrit le 23/04/2020 à 19:02 :
On 4/23/20 2:48 AM, Gelpi Andrea wrote:
I saw the change in the file.
As I'm not a programmer How can I test your fix?
My system was installed via Debian 10 stable repository.
I upgrade with testing repository postorius, django and mailmanclinet
Postorius V 1.3.2 Django V. 2.2.12 Django filters V 2.1.0 Djanog mailman V 1.3.2 mailmanclient V 3.3.0
I don't know where the Debian package puts things, but you have to find the location of postorius/views/list.py. Something like
locate views/list.py
On debian this file is part of the python3-django-postorius package, and is installed here: /usr/lib/python3/dist-packages/postorius/views/list.py
should find it. Then you need to download <https://gitlab.com/mailman/postorius/-/merge_requests/500.diff> and edit it to remove the first 15 lines so the first remaining line is the
diff --git a/src/postorius/views/list.py b/src/postorius/views/list.py
line. Then make a backup copy of postorius/views/list.py and run the command
patch postorius/views/list.py path/to/500.diff
where postorius/views/list.py is actually the full path to postorius/views/list.py and 500.diff is the edited file you downloaded.
You'll have also to remove the compiled files from the __pycache__ directory:
$ sudo rm /usr/lib/python3/dist-packages/postorius/views/__pycache__/list.cpython-*.pyc
Then restart uWSGI. If anything goes wrong, restore your backup copy of postorius/views/list.py and restart uWSGI.
The best way to restore is to force the re-installation of the package: $ sudo apt-get install --reinstall python3-django-postorius
It will take care of the compilation part.
_g.
On 4/23/20 10:27 AM, Gilles Filippini wrote:
You'll have also to remove the compiled files from the __pycache__ directory:
This is not necessary. If the .py file is newer than the .pyc file in the __pycache__ directory, the interpreter will use the .py file and if it has permission will rewrite the .pyc file.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Mark Sapiro a écrit le 23/04/2020 à 20:02 :
On 4/23/20 10:27 AM, Gilles Filippini wrote:
You'll have also to remove the compiled files from the __pycache__ directory:
This is not necessary. If the .py file is newer than the .pyc file in the __pycache__ directory, the interpreter will use the .py file and if it has permission will rewrite the .pyc file.
Indeed, if it has permission. When testing in user space it does not have permission. These files are owned by root.
_g.
Il 23/04/20 19:02, Mark Sapiro ha scritto:
On 4/23/20 2:48 AM, Gelpi Andrea wrote:
I saw the change in the file.
As I'm not a programmer How can I test your fix?
My system was installed via Debian 10 stable repository.
I upgrade with testing repository postorius, django and mailmanclinet
Postorius V 1.3.2 Django V. 2.2.12 Django filters V 2.1.0 Djanog mailman V 1.3.2 mailmanclient V 3.3.0
I don't know where the Debian package puts things, but you have to find the location of postorius/views/list.py. Something like
locate views/list.py
should find it. Then you need to download <https://gitlab.com/mailman/postorius/-/merge_requests/500.diff> and edit it to remove the first 15 lines so the first remaining line is the
diff --git a/src/postorius/views/list.py b/src/postorius/views/list.py
line. Then make a backup copy of postorius/views/list.py and run the command
patch postorius/views/list.py path/to/500.diff
where postorius/views/list.py is actually the full path to postorius/views/list.py and 500.diff is the edited file you downloaded.
Then restart uWSGI. If anything goes wrong, restore your backup copy of postorius/views/list.py and restart uWSGI.
I can confirm that the fix works.
Thank You so much.
-- Gelpi ing. Andrea
I documenti vitali dimostreranno la loro vitalita' spostandosi spontaneamente da dove li avevate lasciati a dove non riuscirete a trovarli.
On 4/23/20 12:11 PM, Gelpi Andrea wrote:
I can confirm that the fix works.
Thank You so much.
Thank you for testing and reporting. Note I have just made one minor change to the fix.
Where I had in the added code
if (MailDomain.objects.get( mail_domain=domain.mail_host).site.name == web_host):
I now have
if (MailDomain.objects.get( mail_domain=domain.mail_host).site.domain == web_host):
The issue is site.name is the domain's display name whereas the domain name is site.domain. This only matters if you have given the site a display name different from the domain name in Django.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Hi, we are writing from the NGO Engineering Without Borders - Spain. After having migrated from mailman2 to mailman3 in a server with Debian 11, our domains are like these: https://listas.isf.es/mailman3/ https://listas.andalucia.isf.es/mailman3/ https://listas.aragon.isf.es/mailman3/ ... I have set FILTER_VHOST = True and restarted postorius (systemctl restart mailman3-web), but when we enter in every URL, we see all the lists. Any hint to search?
Thanks a lot in advance!
P.S: apart from this conversation, I suggest to include in documentation related to migrations the fact that is important to have 'charset': 'utf8mb4' if MariaDB/MySQL is used, in order not to get migration errors doubt to encodings. We had 75 GB of mbox messages and some of them have had trouble doubt to not setting it before.
On 1/6/22 10:56 AM, jdanitxu@gmail.com wrote:
Hi, we are writing from the NGO Engineering Without Borders - Spain. After having migrated from mailman2 to mailman3 in a server with Debian 11, our domains are like these: https://listas.isf.es/mailman3/ https://listas.andalucia.isf.es/mailman3/ https://listas.aragon.isf.es/mailman3/ ... I have set FILTER_VHOST = True and restarted postorius (systemctl restart mailman3-web), but when we enter in every URL, we see all the lists. Any hint to search?
How did you install Mailman. If you are using the Debian packages, they are out of date. I'm not exactly sure the state of Postorius in them. The latest Debian mailman3-web package is 0+20200530-2 which may or may not include https://gitlab.com/mailman/postorius/-/merge_requests/500.
What is your Postorius version? if it is less than 1.3.3, FILTER_VHOST doesn't work. Even if it is 1.3.3 or newer there is an issue with FILTER_VHOST. Namely, Postorius doesn't filter lists based directly on web domain. It filters based on the email host associated with the web host. There are two possibilities. If more than one domain has the same web host but different email hosts, no filtering is done. If domains with different web hosts have the same email host, all the lists with that email host will be shown.
In short, FILTER_VHOST only works well with Postorius if each web host
domain has a unique email host. I'm guessing that in your case, the
email host for all three domains is isf.es
so all lists are shown.
P.S: apart from this conversation, I suggest to include in documentation related to migrations the fact that is important to have 'charset': 'utf8mb4' if MariaDB/MySQL is used, in order not to get migration errors doubt to encodings. We had 75 GB of mbox messages and some of them have had trouble doubt to not setting it before.
I think this should be fixed in Mailman core 3.3.5 which defines the charset and collation for many columns/tables as utf8mb4 for MariaDB/MySQL.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (4)
-
Gelpi Andrea
-
Gilles Filippini
-
jdanitxu@gmail.com
-
Mark Sapiro