After server upgrade debian 11→12 and reinstalling everything in (venv), I got this error when accessing → mailman3/lists

File "/opt/mailman/venv/lib/python3.11/site-packages/mailmanclient/restbase/connection.py", line 160, in call raise HTTPError(params.get('url'), response.status_code, urllib.error.HTTPError: HTTP Error 500: {"title": "500 Internal Server Error"} ERROR 2025-08-16 19:26:03,720 6588 django.request Internal Server Error: /mailman3/lists/mylist.myserver.tld
Can anyone help? Other things do work, including archives, users, domains etc.

On 8/16/25 7:30 PM, Wikinaut wrote:
File "/opt/mailman/venv/lib/python3.11/site-packages/mailmanclient/restbase/connection.py", line 160, in call raise HTTPError(params.get('url'), response.status_code, urllib.error.HTTPError: HTTP Error 500: {"title": "500 Internal Server Error"} ERROR 2025-08-16 19:26:03,720 6588 django.request Internal Server Error: /mailman3/lists/mylist.myserver.tld
Can anyone help? Other things do work, including archives, users, domains etc.
Is there an associated message in mailman.log?
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

there is no new ~/mm/var/logs/mailman.log file. I gzip-ed the old one and triggered the bug again.

On 8/16/25 7:53 PM, Wikinaut wrote:
there is no new ~/mm/var/logs/mailman.log file. I gzip-ed the old one and triggered the bug again.
Your original error says that mailmanclient sent a request to mailman core's REST API and received a 500 response. Mailman core should log the error that produces the 500 response.
If it doesn't, perhaps there is some permissions issue preventing writing the log.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

I already made all files owned by mailman:mailman and restartet (I will do this again).
Here ist the full error stack (redacted) https://dpaste.com/AQPMYEHEK.txt

I created another (venv) and decided to go through all steps of a full installation.
→→→ it works!

On Sat, Aug 16, 2025 at 11:40 PM Wikinaut <mail@tgries.de> wrote:
I created another (venv) and decided to go through all steps of a full installation.
→→→ it works!
With a Python version change, I discovered that creating a clean virtual environment is the best approach.
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 In an Internet failure case, the #1 suspect is a constant: DNS. "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-) [How to ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html]

Odhiambo Washington via Mailman-users writes:
On Sat, Aug 16, 2025 at 11:40?PM Wikinaut <mail@tgries.de> wrote:
I created another (venv) and decided to go through all steps of a full installation.
With a Python version change, I discovered that creating a clean virtual environment is the best approach.
As far as I know the venv module doesn't support a major (3.x to 3.y) version change at all. But even within a major version, if you're going to take the (slight) risk of a Python upgrade for the unknown benefits of the Python upgrade, you likely want the same for the whole suite of requirements.
-- GNU Mailman consultant (installation, migration, customization) Sirius Open Source https://www.siriusopensource.com/ Software systems consulting in Europe, North America, and Japan

and mails appear not to be processed any more.
One mail came through, but look to the third lien of the footer, some variables are not replaced by their values:
berlin mailing list -- berlin@xxxxx.de To unsubscribe send an email to berlin-leave@xxxxx.de %(web_page_url)slistinfo/%(_internal_name)s

On 8/16/25 8:14 PM, Wikinaut wrote:
and mails appear not to be processed any more.
One mail came through, but look to the third lien of the footer, some variables are not replaced by their values:
berlin mailing list -- berlin@xxxxx.de To unsubscribe send an email to berlin-leave@xxxxx.de %(web_page_url)slistinfo/%(_internal_name)s
This line is from a msg_footer imported from Mailman 2.1 by 'mailman import21'. The substitutions are not replaced because they are MM 2.1 syntax which MM 3 doesn't recognize.
If you have Mailman core >=3.3.10 and have set the Base Url parameter for the domain, you can replace that line in the template with simply
$mailinglist_url
If your Mailman core is older, you need to hardcode that as something like
https://example.com/mailman3/lists/$list_id
I'm only guessing here, but I suspect that you have some directories/files in the /opt/mailman/mm/var/templates/ hierarchy with mode and ownership such that they aren't readable by the Mailman user.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

Thank you. As I need to go through ~20 mailing lists, is there any way to programmatically also modify the templates?
I could not find a script for doing this but it would nice to have, as I managed, as known, to write and to run scripts, which is very helpful (because we re-generate the _whole_ mailsystem daily if there are changes in our membership database).
Thus a script to fix (at least) ml footers would also be great!

On 8/18/25 12:06 PM, Wikinaut wrote:
Thank you. As I need to go through ~20 mailing lists, is there any way to programmatically also modify the templates?
I could not find a script for doing this but it would nice to have, as I managed, as known, to write and to run scripts, which is very helpful (because we re-generate the _whole_ mailsystem daily if there are changes in our membership database).
If you want to use default templates for everything, just remove everything under /opt/mailman/mm/var/templates/.
If you want a custom footer for all lists, remove list:member:generic:footer.txt from all the /opt/mailman/mm/var/templates/lists/LIST_ID/LC/ directories and create the footer at /opt/mailman/mm/var/templates/site/LC/list:member:generic:footer.txt
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

Just two follow-up questions.
- Is this documented somewhere (where)?
- If I create /opt/mailman/mm/var/templates/site/LC/list:member:generic:footer.txt as suggested, I suppose that this then the new default for those lists, where no distinct /opt/mailman/mm/var/templates/lists/LIST_ID/LC/list:member:generic:footer.txt footer exists . Pls. can you confirm, or correct me?
Mark: thanks in advance

On 8/29/25 09:26, Wikinaut wrote:
Just two follow-up questions.
- Is this documented somewhere (where)?
See https://docs.mailman3.org/projects/mailman/en/latest/src/mailman/rest/docs/t...
Also https://gitlab.com/mailman/mailman/-/blob/master/src/mailman/utilities/i18n....
- If I create /opt/mailman/mm/var/templates/site/LC/list:member:generic:footer.txt as suggested, I suppose that this then the new default for those lists, where no distinct /opt/mailman/mm/var/templates/lists/LIST_ID/LC/list:member:generic:footer.txt footer exists . Pls. can you confirm, or correct me?
That's correct as long as there is no /opt/mailman/mm/var/templates/domains/MAIL_HOST/LC/list:member:generic:footer.txt
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

I have standard installation Tom Sawyer 3.3.10.
I setup
base_url: https://mydomain/mailman3/lists
in mailman.cfg and restarted mailman3.
The variable is however not replaced, otherwise than you said above, and now simply "$mailinglist_url" is printed unreplaced in the footer.
What did I wrong? Where exactly is base_url to be set, I searched for it but could not find a suited information in the mailman documentation.

On Fri, Sep 5, 2025 at 12:42 PM Wikinaut <mail@tgries.de> wrote:
I have standard installation Tom Sawyer 3.3.10.
I setup
base_url: https://mydomain/mailman3/lists
in mailman.cfg and restarted mailman3.
The variable is however not replaced, otherwise than you said above, and now simply "$mailinglist_url" is printed unreplaced in the footer.
What did I wrong? Where exactly is base_url to be set, I searched for it but could not find a suited information in the mailman documentation.
Looking at the official documentation for virtualenv, that base_url is is not anywhere in mailman.cfg. I only see if going into /etc/mailman3/mailman-hyperkitty.cfg. Because you mention something about the footer, I suppose you are talking about the variables in in templates, no? In which case, the file you are looking at editing (as previously told) is /opt/mailman/mm/var/templates/domains/YOUR_MAIL_HOST_HERE/en/list:member:generic:footer.txt (/en assumes English, so replace accordingly).
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 In an Internet failure case, the #1 suspect is a constant: DNS. "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-) [How to ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html]

I was directly replying to Marks answer, which does not work for me:
22:40 ...
This line is from a msg_footer imported from Mailman 2.1 by 'mailman import21'. The substitutions are not replaced because they are MM 2.1 syntax which MM 3 doesn't recognize.
If you have Mailman core >=3.3.10 and have set the Base Url parameter for the domain, you can replace that line in the template with simply
$mailinglist_url
If your Mailman core is older, you need to hardcode that as something like
https://example.com/mailman3/lists/$list_id
I'm only guessing here, but I suspect that you have some directories/files in the /opt/mailman/mm/var/templates/ hierarchy with mode and ownership such that they aren't readable by the Mailman user.

On Fri, Sep 5, 2025 at 1:02 PM Wikinaut <mail@tgries.de> wrote:
I was directly replying to Marks answer, which does not work for me:
22:40 ...
This line is from a msg_footer imported from Mailman 2.1 by 'mailman import21'. The substitutions are not replaced because they are MM 2.1 syntax which MM 3 doesn't recognize.
If you have Mailman core >=3.3.10 and have set the Base Url parameter for the domain, you can replace that line in the template with simply
$mailinglist_url
If your Mailman core is older, you need to hardcode that as something like
https://example.com/mailman3/lists/$list_id
I'm only guessing here, but I suspect that you have some directories/files in the /opt/mailman/mm/var/templates/ hierarchy with mode and ownership such that they aren't readable by the Mailman user.
Let me explain this to you the way I understand it. I have a mailing list host - lists.kictanet.or.ke. This is the domain. I have a mailing list - kictanet@lists.kictanet.or.ke. BTW, this is a real list. You can access it at https://lists.kictanet.or.ke/mm/lists/kictanet.lists.kictanet.or.ke/ Breaking this down, I have the following layout in the file system:
root@eu:/opt/mailman/mm/var/templates# pwd
/opt/mailman/mm/var/templates
root@eu:/opt/mailman/mm/var/templates# ls -al
total 20
drwxr-xr-x 5 mailman mailman 4096 Aug 4 2024 .
drwxr-xr-x 13 mailman mailman 4096 Sep 2 16:35 ..
drwxr-xr-x 3 mailman mailman 4096 Mar 20 2023 domains
drwxr-xr-x 11 mailman mailman 4096 Aug 4 2024 lists
drwxr-xr-x 3 mailman mailman 4096 Aug 4 2024 site
root@eu:/opt/mailman/mm/var/templates# ls -al lists/
total 44
drwxr-xr-x 11 mailman mailman 4096 Aug 4 2024 .
drwxr-xr-x 5 mailman mailman 4096 Aug 4 2024 ..
drwxr-xr-x 3 mailman mailman 4096 Aug 4 2024
kictanet.lists.kictanet.or.ke
drwxr-xr-x 3 mailman mailman 4096 Aug 4 2024 users.exim4u.org
root@eu:/opt/mailman/mm/var/templates# ls -al lists/
kictanet.lists.kictanet.or.ke/
total 12
drwxr-xr-x 3 mailman mailman 4096 Aug 4 2024 .
drwxr-xr-x 11 mailman mailman 4096 Aug 4 2024 ..
drwxr-xr-x 2 mailman mailman 4096 Jul 14 15:47 en
root@eu:/opt/mailman/mm/var/templates# ls -al lists/
kictanet.lists.kictanet.or.ke/en/
total 60
drwxr-xr-x 2 mailman mailman 4096 Jul 14 15:47 .
drwxr-xr-x 3 mailman mailman 4096 Aug 4 2024 ..
-rw------- 1 mailman mailman 607 Jul 14 15:41
domain:admin:notice:new-list.txt
-rw------- 1 mailman mailman 337 Jul 14 15:41 list:admin:action:post.txt
-rw-r--r-- 1 mailman mailman 299 Jul 14 15:41
list:admin:action:subscribe.txt
-rw------- 1 mailman mailman 290 Jul 14 15:42 list:admin:notice:pending.txt
-rw------- 1 mailman mailman 226 Jul 14 15:46 list:member:digest:footer.txt
-rw------- 1 mailman mailman 448 Jul 14 15:42
list:member:digest:masthead.txt
-rw------- 1 mailman mailman 1417 Jul 14 15:43
list:member:generic:footer.txt
-rw------- 1 mailman mailman 1417 Jul 14 15:43
list:member:regular:footer.txt
-rw------- 1 mailman mailman 822 Jul 14 15:44 list:user:action:invite.txt
-rw------- 1 mailman mailman 955 Jul 14 15:44
list:user:action:subscribe.txt
-rw------- 1 mailman mailman 239 Jul 14 15:44 list:user:notice:post.txt
-rw------- 1 mailman mailman 798 Jul 14 15:45 list:user:notice:probe.txt
-rw------- 1 mailman mailman 631 Jul 14 15:45 list:user:notice:welcome.txt
root@eu:/opt/mailman/mm/var/templates#
Opening the file 'lists/
kictanet.lists.kictanet.or.ke/en/list\:member\:generic\:footer.txt', it
contains the text below and other mundane texts we'd love our subscribers
to see on the footer:
${display_name} mailing list -- ${listname} To unsubscribe send an email to ${short_listname}-leave@${domain} Unsubscribe or change your options at: $mailinglist_url Archived at: $hyperkitty_url
As you can see, all the files are owned by mailman:mailman in my case.
--
Best regards,
Odhiambo WASHINGTON,
Nairobi,KE
+254 7 3200 0004/+254 7 2274 3223
In an Internet failure case, the #1 suspect is a constant: DNS.
"Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-)
[How to ask smart questions:
http://www.catb.org/~esr/faqs/smart-questions.html]

It's going about the variable $mailinglist_url in footers. Mark exlained, that in mm >= 3.3.10 this placeholder can be used in footers, given, that you have set up $base_url.
This does not work for me. I need to know, WHERE to set $base_url to make $mailinglist_url become working and replaced in footers.

On 9/5/25 03:37, Wikinaut wrote:
It's going about the variable $mailinglist_url in footers. Mark exlained, that in mm >= 3.3.10 this placeholder can be used in footers, given, that you have set up $base_url.
This does not work for me. I need to know, WHERE to set $base_url to make $mailinglist_url become working and replaced in footers.
The base url setting for this is an attribute of the domain. Setting it in the Domains view of Postorius or via REST will not be available until the next release, I.e. Mailman core 3.3.11, Postorius 1.3.14, Mailman Client 3.3.6.
In the mean time with Mailman core 3.3.10, you can set this via mailman shell
or by directly updating the domain
table in the database.
In mailman shell
d = getUtility(IDomainManager).get('mydomain') d.base_url = 'https://mydomain/mailman3/lists' commit()
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

Dear Mark, earlier in this thread *) you gave instructions how to add generic (in my case: footer) templates for the site/LC, which should work after removing list-specific templates.
I have these questions:
- I did remove the list-specific files list:member:regular:footer and list:member:digest:footer.
- I added templates in site/de (my default language).
Though, in mailman web view I do still see the old site-specific templates, even when there are no list-specific files, and I do not see the new site-generics.
I restarted mailman3 and, provisionally, also mailmanweb - same.
I did a recursive grep for all files in /opt/mailman/mm/var/templates and could not find files with the old template texts, which are shown in mailman list template view.
What's is going wrong here? Are the templates in the database but were not read from the filesystem? What steps do I have to perform to make the new site-templates become effective?
*) https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/message/...

On September 21, 2025 12:18:56 PM PDT, Wikinaut <mail@tgries.de> wrote:
What's is going wrong here? Are the templates in the database but were not read from the filesystem? What steps do I have to perform to make the new site-templates become effective?
When you set a template in Postorius, the template is stored in the database and an entry is made in Mailman core's template table with a uri to the Postorius API to get the template. As long as this entry is there, that's the template you get.
Delete the template from Postorius and you will get the template from the file system.
-- Mark Sapiro <mark@msapiro.net> Sent from my Not_an_iThing with standards compliant, open source software.

Do you have a programmatic way to delete n ( n > 20) such entries in Postorius, e.g. via a python script + REST to loop through all lists and perhaps to exclude a few based on a small condition (like a text found in old template and/or list name)?
This would be very helpful.

On 9/21/25 14:49, Wikinaut wrote:
Do you have a programmatic way to delete n ( n > 20) such entries in Postorius, e.g. via a python script + REST to loop through all lists and perhaps to exclude a few based on a small condition (like a text found in old template and/or list name)?
I don't have anything off hand, and in the time it would take me to create one and for you to customize it for your exceptions, you could probably go through well over 20 lists/templates via the web UI.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

I deleted the template. I sent a mail.
My new templates are however ignored. Is your previous explanation *) https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/message/... perhaps missing something?
/opt/mailman/mm/var/templates/sites/de$ dir insgesamt 12 4 -rw-r----- 1 mailman mailman 172 21. Sep 20:50 list:member:digest:footer.txt 4 -rw-rw---- 1 mailman mailman 173 21. Sep 20:47 list:member:generic.footer.txt 4 -rw-rw---- 1 mailman mailman 173 21. Sep 20:48 list:member:regular:footer.txt
These files were not put into footer. but somewhat from elsewhere.

Okay, I spotted my mistake: I wrote "sites" but I needs to be "site".
Problem solved.

Wikinaut wrote:
/opt/mailman/mm/var/templates/sites/de$ dir insgesamt 12 4 -rw-r----- 1 mailman mailman 172 21. Sep 20:50 list:member:digest:footer.txt 4 -rw-rw---- 1 mailman mailman 173 21. Sep 20:47 list:member:generic.footer.txt 4 -rw-rw---- 1 mailman mailman 173 21. Sep 20:48 list:member:regular:footer.txt
As you have noted, it's site
, not sites
, but that's not what I'm writing about. In the above, list:member:generic.footer.txt is never used. list:member:generic.footer.txt is an alternate name for both list:member:digest:footer.txt and list:member:regular:footer.txt. it will be used if and only if the primary name is not found. I.e., if both the regular and digest footer templates are the same, you can put the footer template in list:member:generic.footer.txt and that will be used for both but only if the other files are not there. If the other files are there, they will be used and the generic
file will be ignored.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

Mark, this is great news, a little bit like expected! Thanks again for clarifying the term "generic" here. It's helpful to have it for definition of both, "regular" and "digest".
Is this documented somewhere? I think, I need to create a wiki for mailman3.

On 9/22/25 05:21, Wikinaut wrote:
Mark, this is great news, a little bit like expected! Thanks again for clarifying the term "generic" here. It's helpful to have it for definition of both, "regular" and "digest".
Is this documented somewhere?
I don't think so.
I think, I need to create a wiki for mailman3.
We have a wiki at https://wiki.list.org/ for all versions of Mailman. See the first paragraph at that page for info on obtaining write access.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

Mark Sapiro writes:
On 9/22/25 05:21, Wikinaut wrote:
Mark, this is great news, a little bit like expected! Thanks again for clarifying the term "generic" here. It's helpful to have it for definition of both, "regular" and "digest".
Is this documented somewhere?
I don't think so.
I thought I had seen it "somewhere", but I can't find it now. It should be here: https://docs.mailman3.org/projects/mailman/en/release-3.1/src/mailman/rest/d....
See https://gitlab.com/mailman/mailman/-/issues/1243.
Besides templates.html, this should be documented briefly in the forms for changing the generic, regular, and digest templates, something as simple as adding "if empty, falls back to generic:template" would do for the regular and digest specific templates, and "shadowed by regular:template and digest:template" for the generic template.
Note that that is in the developer's documentation for the REST API. :-( We really need to reorganize the docs to be more discoverable for typical admins.
I think, I need to create a wiki for mailman3.
We have a wiki at https://wiki.list.org/ for all versions of Mailman. See the first paragraph at that page for info on obtaining write access.
But note that this is *not* appropriate for the wiki, which is more oriented to FAQs and news. Wikis are fine for formal documentation, but only if that's the ground truth. For better or worse, we chose not to do that.
-- GNU Mailman consultant (installation, migration, customization) Sirius Open Source https://www.siriusopensource.com/ Software systems consulting in Europe, North America, and Japan
participants (4)
-
Mark Sapiro
-
Odhiambo Washington
-
Stephen J. Turnbull
-
Wikinaut