Craig Leres via Mailman-users writes:
One feature the existing mailman 2 lists uses that I can't get working with mailman 3 are templates. After using "mailman import21" I found files with names such as list:member:regular:footer.txt in the list tree. However they were ignored so I removed them I tried tried creating a template using the web postorius gui. When a message is injected, I see an error log from the out runner:
Apr 25 12:32:22 2026 (82977) Cannot connect to SMTP server 127.0.0.1 on port 25Following the error message, the out runner goes cpu bound, creating and deleting queue files in queue/out with .pck and .bak extensions, very quickly.
That is a bug. The error isn't a temporary failure, at least not if it occurs several times.
Also, I don't see how that error could result from the exception below.
I updated the code to print the exception and it tells a completely different story:
Apr 25 12:38:15 2026 (83339) Cannot connect to SMTP server 127.0.0.1 on port 25 (HTTPConnectionPool(host='localhost', port=8000): Max retries exceeded with url: /api/templates/list/test.example.com/list:member:regular:footer (Caused by NewConnectionError("HTTPConnection(host='localhost', port=8000): Failed to establish a new connection: [Errno 61] Connection refused")))
That suggests that Postorius isn't running. Port 8000 is the default port used by Postorius (and if running, HyperKitty). The problem is that Postorius and HyperKitty are intentionally separate applications because a lot of sites wanted the ability write their own. I don't really understand the design, but what happens is that when you configure a template via Postorius, it gets stored in storage accessible to Postorius. What Postorius returns to Mailman is a URL for Mailman core to query to retrieve the template from Postorius. Core fetches from that URL, then applies it to the outgoing message.
The first thing to do is to check that all your host and port configurations are consistent. The defaults are all localhost (but you should specify either 127.0.0.1 or ::1 because Postfix doesn't look in /etc/hosts at all and we've seen cases where one program thinks it's using IPv4 and the other IPv6), and the ports are 8000 for Django (Postorius and HyperKitty, configured in settings.py) and 8001 for the core REST API (configured in mailman.cfg). (If the defaults are satisfactory you may not see any settings for those in settings.py and mailman.cfg, depending on how you created those conffiles.)
Then make sure Postorius is running.
At least try running Postorius and then "mailman unshunt" to see if that is the problem. If for some reason you want to normally run Mailman core without Postorius, then you will have to either edit the templates in place in the Mailman package, or add local directory to the search path (offhand I don't know if there is one, the fallback template directory may be hard-coded).
I guess it would also be possible to write a very lightweight template manager process that emulates the Postorius API endpoint, but that wouldn't give you a GUI for template management. You'd still need to run Postorius for that unless you're really into web development.
I'm using the default webservice port (8001)
"webservice" in mailman.cfg refers to the REST API. The web UIs run in different processes and use 8000 (by default).
so I would not expect anything to ever be listening on 8000.
When I stop the runners, the problematic queue file is moved to the shunt queue.
That's normal. Once you get the configuration straightened out, "mailman unshunt" should cause those posts and other mail to flow properly.
! except socket.error:
Ah, that's quite generic, and I see now why that would catch the attempt to fetch the template. It's obnoxious that the dev who wrote the code chose to throw away the exception data in favor of a generic "something's broke" message, but that happens. It was probably written before the web GUI for managing templates was added.
Regards, Steve
-- GNU Mailman consultant (installation, migration, customization) Sirius Open Source https://www.siriusopensource.com/ Software systems consulting in Europe, North America, and Japan