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).

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

 > 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.

 > 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'

Each template that is set via Postorius gets an URI starting with that
scheme and authority.  I think that Postorius then uses the core REST
API to send that URI to Mailman core which stores it in the database.

However, I don't understand why connection would be refused, unless
Postorius (uswgi) is not running.

 > I have so many questions...
 > 
 >    1. What is it about the ASCII encoding? "ordinal not in
 >       range(128)"?  What do we even do with ASCII in 2026? I tried
 >       to send a message that only contains ASCII characters, but
 >       the result was the same, so it's probably not in the e-mail
 >       contents.

See above.  I didn't check thoroughly but I think that for modern
Mailman, every language except US English uses UTF-8.

 >    2. 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.

 >    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).

 >    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.


-- 
GNU Mailman consultant (installation, migration, customization)
Sirius Open Source    https://www.siriusopensource.com/
Software systems consulting in Europe, North America, and Japan
_______________________________________________
Mailman-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/
Archived at: 
https://lists.mailman3.org/archives/list/[email protected]/message/4GJLKOJQPKXN44TOR53ZL2AFA5D63W6K/

This message sent to [email protected]

Reply via email to