I am using apache to run the web interface, and my Postel port, and I have the proxy routs
ProxyPass "/mailman3" "http://127.0.0.1:4386/mailman3" works
ProxyPass "/archives" "http://127.0.0.1:4386/archives" works
ProxyPass "/accounts" "http://127.0.0.1:4386/accounts" is broken
ProxyPass "/admin" "http://127.0.0.1:4386/admin" works
ProxyPass "/user-profile" "http://127.0.0.1:4386/user-profile" works
What does "is broken" mean here? Well, since I have debug on,
GET "http://127.0.0.1:4386/accounts"
yields something like (shortened to cut to the salient matter)
| <body>
| <p>
| Using the URLconf defined in <code>mailman_web.urls</code>,
| Django tried these URL patterns, in this order:
| </p>
| <ol>
| <li>postorius/</li>
| <li>hyperkitty/</li>
| <li>mailman3/</li>
| <li>archives/</li>
| <li>^user-profile/delete$
| [name='mm_user_account_delete']</li>
| <li>^user-profile/$
| [name='mm_user_profile']</li>
| <li>accounts/</li>
| <li>admin/</li>
| </ol>
| <p>
| The current path, <code>accounts</code>, didn’t match any of these.
| </p>
| </body>
Sure I have accounts/ rather than accounts, but neither are working routes endowed with a trailing slash. Digging for mailman_web.urls, I am lead to believe this is related to my settings, and as I inspect them, I am reminded that I appended
del ACCOUNT_AUTHENTICATION_METHOD ACCOUNT_LOGIN_METHODS = {'email', 'username'} del ACCOUNT_EMAIL_REQUIRED ACCOUNT_SIGNUP_FIELDS = ['email*', 'username*', 'password1*', 'password2*']
to my settings file. Commenting these lines out, restarting mailmanweb, still the same error.
Ideally an error like this should be shown to the user. Instead it leads to a endlessly repeated requests for users to verify their email address, as seen in my live system at say
https://lists.repec.info/accounts/confirm-email/
These have no CSS, pointing to an apache missconfiguration For what it's worth, here is my current apache configuration
| <VirtualHost *:443> | ServerName lists.repec.info | ServerAlias www.lists.repec.info | ServerAlias list.repec.info | ServerAlias www.list.repec.info | ServerAdmin webmaster@localhost | | RewriteEngine On | RewriteRule "^/?$" "https://lists.repec.info/mailman3/lists/" [R] | | Alias /static "/usr/local/mailman/web/static" | <Directory "/usr/local/mailman/web/static"> | Require all granted | </Directory> | | Alias /favicon.ico "/usr/local/mailman/web/static/postorius/img/favicon.ico" | | <IfModule mod_headers.c> | RequestHeader unset X-Forwarded-Proto | <If "%{HTTPS} =~ /on/"> | RequestHeader set X-Forwarded-Proto "https" | </If> | </IfModule> | | <IfModule mod_proxy.c> | ProxyPreserveHost On | ProxyPassMatch ^/static/ ! | ProxyPass "/mailman3" "http://127.0.0.1:4386/mailman3" | ProxyPass "/archives" "http://127.0.0.1:4386/archives" | ProxyPass "/accounts" "http://127.0.0.1:4386/accounts" | ProxyPass "/admin" "http://127.0.0.1:4386/admin" | ProxyPass "/user-profile" "http://127.0.0.1:4386/user-profile" | </IfModule> | | LogLevel debug | ErrorLog /var/log/apache2/lists.repec.info_error.log | | CustomLog /var/log/apache2/lists.repec.info_access.log combined | ServerSignature On | | Include /etc/letsencrypt/options-ssl-apache.conf | SSLCertificateFile /etc/letsencrypt/opt/live/repec.info/fullchain.pem | SSLCertificateKeyFile /etc/letsencrypt/opt/live/repec.info/privkey.pem | | </VirtualHost>
-- Written by Thomas Krichel http://openlib.org/home/krichel on his 22209th day.
Thomas Krichel writes:
I am using apache to run the web interface, and my Postel port, and I have the proxy routs [some routes omitted] ProxyPass "/accounts" "http://127.0.0.1:4386/accounts" is broken
What does "is broken" mean here? Well, since I have debug on, GET "http://127.0.0.1:4386/accounts"
This isn't going to match as far as I can see (but see comments below about customized systems). Here are the routes stock Postorius serves from postorius/urls.py:
r'^accounts/subscriptions/$',
r'^accounts/per-address-preferences/$',
r'^accounts/per-subscription-preferences/$',
r'^accounts/mailmansettings/$',
r'^accounts/list-options/(?P<member_id>[^/]+)/$',
(Note: I usually copy that file to /etc/mailman3/urls.py in case I make changes. In particular I usually comment out the ^postorius and ^hyperkitty routes.) But in your case, I don't know what's in
| Using the URLconf defined in <code>mailman_web.urls</code>,
You have to tell us what's in that file.
reminded that I appended
del ACCOUNT_AUTHENTICATION_METHOD ACCOUNT_LOGIN_METHODS = {'email', 'username'} del ACCOUNT_EMAIL_REQUIRED ACCOUNT_SIGNUP_FIELDS = ['email*', 'username*', 'password1*', 'password2*']
That has nothing to do with URL routing. URL routing is all defined in the URLconf, which is usually in a file named "urls.py", but you can change that name and mess with the routes if you want. It seems that you did.
Ideally an error like this should be shown to the user.
That's a Django decision. We're not going to change it. I don't think it's very useful to show it though, since the user can't do anything about it. They have to complain to the sysadmin either way.
Instead it leads to a endlessly repeated requests for users to verify their email address, as seen in my live system at say
That route doesn't exist anywhere in stock Postorius. It seems to be provided by the allauth package (allauth/account/urls.py, but I'm not sure how that gets added to the URLconf. Presumably that's from some app or middleware that you should have configured in settings.py. (That URLconf doesn't match a bare /account or /account/, either.)
In my no-social-auth installation I apparently needed the following at the end of INSTALLED_APPS:
'allauth',
'allauth.account',
'allauth.socialaccount',
and this at the beginning of MIDDLEWARE
'allauth.account.middleware.AccountMiddleware',
(these are from mailman_web/settings/base.py). You might be able to delete 'allauth.socialaccount', but I'm pretty sure mailman-web doesn't work without the other three.
These have no CSS, pointing to an apache missconfiguration
There's no linking element in the output you presented. Without a link to the CSS file (or immediate style="..." attributes), there won't be any CSS.
For what it's worth, here is my current apache configuration
That looks OK to me. I don't see a misconfiguration there, but you have a customized system. We'll help you with it if we can, but you need to provide the information we need.
| LogLevel debug | ErrorLog /var/log/apache2/lists.repec.info_error.log | | CustomLog /var/log/apache2/lists.repec.info_access.log combined | ServerSignature On
What's in those logs that's relevant to your queries?
Steve
-- GNU Mailman consultant (installation, migration, customization) Sirius Open Source https://www.siriusopensource.com/ Software systems consulting in Europe, North America, and Japan
Stephen J. Turnbull writes
What does "is broken" mean here? Well, since I have debug on, GET "http://127.0.0.1:4386/accounts"
This isn't going to match as far as I can see (but see comments below about customized systems).
I found the line
ProxyPass "/accounts" "http://127.0.0.1:8000/accounts"
in the doc at
https://docs.mailman3.org/en/latest/install/virtualenv.html
All I did is change the port.
Here are the routes stock Postorius serves from postorius/urls.py:
r'^accounts/subscriptions/$', r'^accounts/per-address-preferences/$', r'^accounts/per-subscription-preferences/$', r'^accounts/mailmansettings/$', r'^accounts/list-options/(?P<member_id>[^/]+)/$',(Note: I usually copy that file to /etc/mailman3/urls.py in case I make changes. In particular I usually comment out the ^postorius and ^hyperkitty routes.)
I much doubt I changed that file
(venv) mailman@darni:/usr/local/mailman/venv/lib/python3.13/site-packages/postorius$ ls -l urls.py -rw-rw-r-- 1 mailman mailman 8623 Mar 18 08:25 urls.py (venv) mailman@darni:/usr/local/mailman/venv/lib/python3.13/site-packages/postorius$ md5sum urls.py 19b266d9ddec888c2614ea4915c52d68 urls.py
This should be the version that came with the package.
But in your case, I don't know what's in
| Using the URLconf defined in <code>mailman_web.urls</code>,
You have to tell us what's in that file.
I don't seem to have a file by that name
root@darni ~ # find / -name mailman_web.urls find: ‘/proc/2166017’: No such file or directory root@darni ~ #
That has nothing to do with URL routing. URL routing is all defined in the URLconf, which is usually in a file named "urls.py", but you can change that name and mess with the routes if you want. It seems that you did.
I have no recollection of that. I would not even know where to start, since I am clueless about django, and so will be most folks who try to get this to run.
but you have a customized system.
I am trying to minimize customization, to try to finish this job which now in the third week. What did is use /usr/local instead of /opt. I use 4336 as the port. I use exim as the mailer and that works. I run on debian testing, but downgraded python to 3.13.
What's in those logs that's relevant to your queries?
I don't think this is relevant as the issue is clear. The logs are
Let's try to go back to first principles
http://127.0.0.1:8000/accounts
should respond without a debugging message, since the documenation references that locatin
That route doesn't exist anywhere in stock Postorius. It seems to be provided by the allauth package (allauth/account/urls.py, but I'm not sure how that gets added to the URLconf. Presumably that's from some app or middleware that you should have configured in settings.py.
ok, here is my settings.py, passwords replaced by ???
| # Mailman Web configuration file.
| # /etc/mailman3/settings.py
|
| # Get the default settings.
| from mailman_web.settings.base import *
| from mailman_web.settings.mailman import *
|
| DEBUG = True
|
| ## to avoid problem determenning the ip address
| USE_X_FORWARDED_HOST = True
| SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
| FORWARD_ALLOW_IPS = ['127.0.0.1', '95.216.35.87', '2a01:4f9:2a:23a8::2']
|
| # Settings below supplement or override the defaults.
|
| #: Default list of admins who receive the emails from error logging.
| ADMINS = (
| ('Mailman Suite Admin', 'root@localhost'),
| )
|
| # Postgresql database setup.
| DATABASES = {
| 'default': {
| 'ENGINE': 'django.db.backends.postgresql_psycopg2',
| 'NAME': 'mailmanweb',
| 'USER': 'mailman',
| # TODO: Replace this with the password.
| 'PASSWORD': '??????',
| 'HOST': 'localhost',
| 'PORT': '5432',
| # For MySQL/MariaDB, in addition to changing the 'ENGINE' setting,
| # uncomment the following to enable utf8 4-byte encodings.
| # 'OPTIONS': {'charset': 'utf8mb4'},
| }
| }
|
| # 'collectstatic' command will copy all the static files here.
| # Alias this location from your webserver to /static
| STATIC_ROOT = '/usr/local/mailman/web/static'
|
| # enable the 'compress' command.
| COMPRESS_ENABLED = True
|
| # Make sure that this directory is created or Django will fail on start.
| LOGGING['handlers']['file']['filename'] = '/usr/local/mailman/web/logs/mailmanweb.log'
|
| #: See https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
| ALLOWED_HOSTS = [
| "localhost", # Archiving API from Mailman, keep it.
| "127.0.0.1",
| "lists.repec.info",
| "list.repec.info",
| "www.lists.repec.info",
| "www.list.repec.info",
| # Add here all production domains you have.
| ]
|
| #: See https://docs.djangoproject.com/en/dev/ref/settings/#csrf-trusted-origins
| #: For Django <4.0 these are of the form 'lists.example.com' or
| #: '.example.com' to include subdomains and for Django >=4.0 they include
| #: the scheme as in 'https://lists.example.com' or 'https://*.example.com'.
| CSRF_TRUSTED_ORIGINS = [
| "https://darni.openlib.org", "http://darni.openlib.org",
| "https://lists.repec.info", "http://lists.repec.info",
| "https://www.lists.repec.info", "http://www.lists.repec.info",
| "https://list.repec.info", "http://list.repec.info",
| "https://www.list.repec.info", "http://www.list.repec.info"
| # Add here all production domains you have.
| ]
|
| #: Current Django Site being served. This is used to customize the web host
| #: being used to serve the current website. For more details about Django
| #: site, see: https://docs.djangoproject.com/en/dev/ref/contrib/sites/
| SITE_ID = 1
|
| # Set this to a new secret value.
| SECRET_KEY = '??????'
|
| # Set this to match the api_key setting in
| # /usr/local/mailman/mm/mailman-hyperkitty.cfg (quoted here, not there).
| MAILMAN_ARCHIVER_KEY = '??????'
|
| # The sender of emails from Django such as address confirmation requests.
| # Set this to a valid email address.
| DEFAULT_FROM_EMAIL = 'admin@repec.info'
|
| # The sender of error messages from Django. Set this to a valid email
| # address.
| SERVER_EMAIL = 'admin@repec.info'
|
| HAYSTACK_CONNECTIONS = {
| 'default': {
| 'PATH': "/usr/local/mailman/web/xapian_index",
| 'ENGINE': 'xapian_backend.XapianEngine'
| },
| }
|
| # Settings below supplement or override the defaults.
| # see https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/thread/U...
| del ACCOUNT_AUTHENTICATION_METHOD
| ACCOUNT_LOGIN_METHODS = {'email', 'username'}
| del ACCOUNT_EMAIL_REQUIRED
| ACCOUNT_SIGNUP_FIELDS = ['email*', 'username*', 'password1*', 'password2*']
I don't see any added middleware there.
(venv) mailman@darni:/usr/local/mailman/venv/lib/python3.13/site-packages$ ls -l allauth/account/urls.py -rw-rw-r-- 1 mailman mailman 4149 Mar 18 08:25 allauth/account/urls.py (venv) mailman@darni:/usr/local/mailman/venv/lib/python3.13/site-packages$ md5sum allauth/account/urls.py af478f57c86b628a17542307134b827b allauth/account/urls.py
appears to be what it come when I pip installed.
These have no CSS, pointing to an apache missconfiguration
There's no linking element in the output you presented. Without a link to the CSS file (or immediate style="..." attributes), there won't be any CSS.
Sure.
That looks OK to me. I don't see a misconfiguration there, but you have a customized system. We'll help you with it if we can, but you need to provide the information we need.
| LogLevel debug | ErrorLog /var/log/apache2/lists.repec.info_error.log | | CustomLog /var/log/apache2/lists.repec.info_access.log combined | ServerSignature On
What's in those logs that's relevant to your queries?
I doubt this is any good because fundamentally, the queries to
http://127.0.0.1:8000/accounts
using 8000 here to illustrate don't work. The URL should reponds other that with a debug output.
I have tried to start with a clean sheet on this server, and published on the lists what I did to wipe the server of any attempt I previously made to install mailman3 there.
I am not sure where to dig more, will take a few hours of timeout from this.
Thanks and cheers!
Written by Thomas Krichel http://openlib.org/home/krichel on his 22210th day.
On 3/26/26 3:14 PM, Thomas Krichel wrote:
Stephen J. Turnbull writes
You have to tell us what's in that file.
I don't seem to have a file by that name
root@darni ~ # find / -name mailman_web.urls find: ‘/proc/2166017’: No such file or directory root@darni ~ #
mailman_web.urls is a Python path. The file is mailman_web/urls.py
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Thomas Krichel writes:
Stephen J. Turnbull writes
What does "is broken" mean here? Well, since I have debug on, GET "http://127.0.0.1:4386/accounts"
This isn't going to match as far as I can see (but see comments below about customized systems).
I found the line
ProxyPass "/accounts" "http://127.0.0.1:8000/accounts"
That line is almost certainly correct for Apache configuration. It does not mean that the system matches any URL with that prefix.
What will match with that prefix is determined by the content of the URLconf (../site-packages/mailman_web/urls.py). But you probably haven't touched that file (I didn't realize that was a Python module rather than the reference to a filesystem path). Probably that file contains:
urlpatterns = [ path( '', RedirectView.as_view(url=reverse_lazy('list_index'), permanent=True), ), path('mailman3/', include('postorius.urls')), path('archives/', include('hyperkitty.urls')), path('', include('django_mailman3.urls')), path('accounts/', include('allauth.urls')), path('admin/', admin.site.urls), # Include alternate Postorius and HyperKitty URLs. path('postorius/', include('postorius.urls')), path('hyperkitty/', include('hyperkitty.urls')), ]
which means these routes are the ones that match /accounts:
Here are the routes stock Postorius serves from postorius/urls.py:
r'^accounts/subscriptions/$', r'^accounts/per-address-preferences/$', r'^accounts/per-subscription-preferences/$', r'^accounts/mailmansettings/$', r'^accounts/list-options/(?P<member_id>[^/]+)/$',
(venv) mailman@darni:/usr/local/mailman/venv/lib/python3.13/site-packages/postorius$ ls -l urls.py -rw-rw-r-- 1 mailman mailman 8623 Mar 18 08:25 urls.py (venv) mailman@darni:/usr/local/mailman/venv/lib/python3.13/site-packages/postorius$ md5sum urls.py 19b266d9ddec888c2614ea4915c52d68 urls.py
http://127.0.0.1:8000/accounts
should respond without a debugging message,
(You mean with port 4386, right?) It should tell you 404 No such resource, but if you set DEBUG=True it tells you that more verbosely.
I doubt this is any good because fundamentally, the queries to
http://127.0.0.1:8000/accounts
using 8000 here to illustrate don't work.
The question is *how* do they fail.
The URL should reponds other that with a debug output.
What does "GET http://127.0.0.1:4386/accounts/confirm-email/" respond with? (Don't omit the trailing "/".)
Steve
-- GNU Mailman consultant (installation, migration, customization) Sirius Open Source https://www.siriusopensource.com/ Software systems consulting in Europe, North America, and Japan
I guess our email crossed each other. The joy of working in close time zones.
Stephen J. Turnbull writes
What will match with that prefix is determined by the content of the URLconf (../site-packages/mailman_web/urls.py). But you probably haven't touched that file (I didn't realize that was a Python module rather than the reference to a filesystem path). Probably that file contains:
urlpatterns = [ path( '', RedirectView.as_view(url=reverse_lazy('list_index'), permanent=True), ), path('mailman3/', include('postorius.urls')), path('archives/', include('hyperkitty.urls')), path('', include('django_mailman3.urls')), path('accounts/', include('allauth.urls')), path('admin/', admin.site.urls), # Include alternate Postorius and HyperKitty URLs. path('postorius/', include('postorius.urls')), path('hyperkitty/', include('hyperkitty.urls')), ]
Yes, I installed this as /etc/mailman3/urls.py, and the salient parts are
mailman@darni:~$ cat /etc/mailman3/urls.py | grep path\(\' path('postorius/', include('postorius.urls')), path('hyperkitty/', include('hyperkitty.urls')), path('mailman3/', include('postorius.urls')), path('archives/', include('hyperkitty.urls')), path('', include('django_mailman3.urls')), path('accounts/', include('allauth.urls')), path('accounts', include('allauth.urls')), path('admin/', admin.site.urls),
So my fix is appending a second 'accounts' router *after* the one with the slash. Inserting it before does not fix.
The only thing I could imagine that leads to my mess is that I have a
RewriteRule "^/?$" "https://lists.repec.info/mailman3/lists/" [R]
Otherwise it shows me the "Debian Apache works" page. Further tests I have conducted now suggests that if I rewrite that rule as
RewriteRule "^/?$" "https://lists.repec.info/mailman3/lists/" [END]
this supposedly stops further processing of the request URL at that top point. Then the initial configuration works, and to answer your question,
What does "GET http://127.0.0.1:4386/accounts/confirm-email/" respond with? (Don't omit the trailing "/".)
root@darni ~ # GET http://127.0.0.1:4386/accounts/confirm-email/ | grep Verif Verify Your Email Address Verify Your Email Address
It works.
To make progress from this mess, I suggest to insert a suggestion to redirect the top level page into the documented apache configuration, something like
RewriteRule "^/?$" "https://lists.example.com/mailman3/lists/" [END]
So that apache non-wizards (like most of us) can use the provided sample more readly.
Thank you so much. I am now turning to my other mailman installation, the one had the Debian version installed before. More fun!
-- Written by Thomas Krichel http://openlib.org/home/krichel on his 22211th day.
Thomas Krichel writes:
To make progress from this mess, I suggest to insert a suggestion to redirect the top level page into the documented apache configuration, something like
RewriteRule "^/?$" "https://lists.example.com/mailman3/lists/" [END]
People have suggested that in the past, a third party misapplies it and thinks they've deleted the rest of their website. There's only so much you can do with recipe snippets. At some point you need an intervention from somebody who knows how things work.
-- GNU Mailman consultant (installation, migration, customization) Sirius Open Source https://www.siriusopensource.com/ Software systems consulting in Europe, North America, and Japan
Stephen J. Turnbull writes
(Note: I usually copy that file to /etc/mailman3/urls.py in case I make changes. In particular I usually comment out the ^postorius and ^hyperkitty routes.) But in your case, I don't know what's in
| Using the URLconf defined in <code>mailman_web.urls</code>,
You have to tell us what's in that file.
I only now understand that this file is in fact
root@darni:/usr/local/mailman/venv/lib/python3.13/site-packages/mailman_web/urls.py
root@darni ~ # ls -l /usr/local/mailman/venv/lib/python3.13/site-packages/mailman_web/urls.py -rw-rw-r-- 1 mailman mailman 1559 Mar 18 08:25 /usr/local/mailman/venv/lib/python3.13/site-packages/mailman_web/urls.py
root@darni ~ # md5sum /usr/local/mailman/venv/lib/python3.13/site-packages/mailman_web/urls.py f382f0bc9cea1277c70226b45cf86def /usr/local/mailman/venv/lib/python3.13/site-packages/mailman_web/urls.py
I strongly suspect the file is the original file I got from pipping the package.
root@darni ~ # cat /usr/local/mailman/venv/lib/python3.13/site-packages/mailman_web/urls.py | grep -v ^#
from django.conf.urls import include from django.contrib import admin from django.urls import path, reverse_lazy from django.views.generic import RedirectView
urlpatterns = [ path( '', RedirectView.as_view(url=reverse_lazy('list_index'), permanent=True), ), # Include alternate Postorius and HyperKitty URLs. path('postorius/', include('postorius.urls')), path('hyperkitty/', include('hyperkitty.urls')), # Order counts for various links. Put the above first and the following # after so the suggested Apache config still works. path('mailman3/', include('postorius.urls')), path('archives/', include('hyperkitty.urls')), path('', include('django_mailman3.urls')), path('accounts/', include('allauth.urls')), path('admin/', admin.site.urls), ]
ok, I tested your approach, even though I don't know what the ... I am doing, Copying not
mailman@darni:~/venv/lib/python3.13/site-packages/postorius/urls.py
but
mailman@darni:~/venv/lib/python3.13/site-packages/mailman_web/urls.py
following guidance of Mark gleaned from
https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/thread/V...
and added
ROOT_URLCONF='urls'
to
/etc/mailman3/settings.py
I can test. The obvious way is to add a route for acocunts. This can be done as an additional line
path('accounts', include('allauth.urls')),
There are two cases. If I place that line *after* the line
path('accounts/', include('allauth.urls')),
then on clicking the sign-in button, I get a redirect to
https://lists.repec.info/accountslogin/?next=/mailman3/lists/
which 404s. This may give the experts an addition hint where the problem is coming from. Placing
path('accounts', include('allauth.urls')),
*before*
path('accounts/', include('allauth.urls')),
seems to finally work, I can login! On the command line
mailman@darni:~$ GET http://localhost:4386/accounts/
works and
mailman@darni:~$ GET http://localhost:4386/accounts
fails.
My problem seems to be that I have to customize the installation, even though I have tried as much as I can not to, because the files as pipped seem not to work for me, for reason none of us seems to understand.
Cheers to all!
-- Written by Thomas Krichel http://openlib.org/home/krichel on his 22210th day.
participants (3)
-
Mark Sapiro -
Stephen J. Turnbull -
Thomas Krichel