Stephen J. Turnbull <steve@turnbull.jp> ezt írta (időpont: 2026. márc. 26., Cs, 8:37):
MegaBrutal via Mailman-users writes:
I get different errors depending on whether I define the list:user:notice:rejected template.
When the template is not defined:
Mar 26 01:48:02 2026 (28606) Uncaught runner exception: 'ascii' codec can't encode character '\xed' in position 21: ordinal not in range(128)
The 21st byte of the stock version of the template is interpolated from $listname. It appears to either be (Latin1) LOWERCASE LETTER I WITH ACUTE or the leading byte of a 3-byte UTF-8 character (that appears to be a private use block).
Hmm, probably I set "Hírlevél" for the list's title or something (it means "newsletter").
The 'ascii' codec for English is a legacy misfeature. We should be
able to use UTF-8 but this can have bad effects on some systems. You can try to use UTF-8 instead by adding
[language.en] charset: utf-8
Where do I set this? Just append to settings.py?
And this is what happens when I define the template:
How did you define the template? In the file system, or via Postorius? I'm guessing Postorius because of the "port=8000" and the "/mailman3/api/..." path, but please confirm.
In Postorius.
Mar 26 01:35:55 2026 (28606) Uncaught runner exception:
HTTPConnectionPool(host='localhost', port=8000): Max retries exceeded with url: /mailman3/api/templates/list/ hirlevel.lista.autistaktol.hu/list:user:notice:rejected (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0xf46e5910>: Failed to establish a new connection: [Errno 111] Connection refused'))
I don't understand this error. The ultimate reason that Mailman core is looking for a template via HTTP at Postorius is that core and the management UI may not be able to access a common file system. So Postorius puts it somewhere, and provides a callback to core to access it. On the Postorius side that is set in settings.py, like this:
POSTORIUS_TEMPLATE_BASE_URL = 'http://localhost:8000'
I don't have this variable defined, so it's probably using the default. I shall add it with 128.8.0.1:8000 then... But it didn't help! Restarted the mailman service, but it still wants to fetch the template from localhost. May it be hardcoded?
See above. I didn't check thoroughly but I think that for modern
Mailman, every language except US English uses UTF-8.
To be fair, in the past I was trying to set my mailing lists to my native language, but then I found that many templates have no translation. In cases like this, most software just falls back to English, which would be fine for my use case. However, Mailman doesn't: I just noticed that empty automatic notifications are being sent out.
- I configured uwsgi to listen on 127.8.0.1:8000, practically
because I didn't want to litter the main 127.0.0.1 address with a plethora of ports.I don't understand what you mean by "litter the address with a plethora of ports". You need to use two separate ports, one for mailman-web's Django (aka uwsgi in your case, usually 8000) and one for Mailman core's REST API (usually 8001). That's all. Not sure why that is a problem.
Yeah, it might not be a big deal, but 8000+ ports are often used for various local HTTP services, I may have another one running on 127.0.0.1:8000. Then true there are many ports being available, so I could just pick a different one, but using a dedicated localhost IP like 127.8.0.1 looked just nicer. I can immediately identify the listen ports belonging to Mailman; and I get to use the default port numbers appearing in the documentation. Alternate port numbers might have caused confusion later. So I just felt I got the best of both worlds with this method, and didn't expect these problems to come along.
Why does it ever want to use localhost:8000 for anything?
See above about the arm's length relation between core and Postorius in template handling. Undoubtedly somebody was incautious about properly handling configuration, and that's the default buried in the fallback configuration.
File a bug (I need to run and pick up my wife at work). Cite this email in it (get the URL from the Archived-At header).
Is this the official bug tracker on Launchpad? https://bugs.launchpad.net/mailman
Would be quite convenient, as I used to file bugs for Ubuntu, so I already have an account there. Surprised that you use Ubuntu's tracker though. I know it's free to use, but I thought you tend towards BugZilla or something.
Hope you succeeded to pick up your wife. My replies are also sporadic because at standard work hours I have a regular job that I must prioritize.
Grepping through the config files, I'm consistent about
127.8.0.1:8000, where does it get localhost (that is 127.0.0.1) from?
You've outsmarted yourself. Try modifying or adding
POSTORIUS_TEMPLATE_BASE_URL = 'http://127.8.0.1:8000'
in /etc/mailman3/settings.py (or wherever your primary settings file is). No promises about getting your templates, but that should at least fix your "can't connect" problem. You may have to edit and save the template to get the core side updated, though.
Yeah, certainly outsmarted. :D Unfortunately it didn't work, as I told above.