On 2024-04-25 01:37, Mark Sapiro wrote:
I think the difference is http vs https, not the IP vs domain name.
Also, with either of these, you are addressing the web server and not the wsgi server. The wsgi server is presumable listening on port 8000 and in the beginning when you had the default
POSTORIUS_TEMPLATE_BASE_URL = 'http://localhost:8000'
With this default, the template URI is in the format of
http://localhost:8000/mailman3/api/templates/list/mytestlist.mydomain.com/li...
Looking at this URI in lynx (on the same server as Mailman) it returns the text of the custom Welcome template, as does curl and wget.
And it's the same if 127.0.0.1 is used in place of localhost -- ie.
http://127.0.0.1:8000/mailman3/api/templates/list/mytestlist.mydomain.com/li...
And the same result if the domain name is used with https -- ie.
https://mydomain.com/mailman3/api/templates/list/mytestlist.mydomain.com/lis...
So, the template is all good, it can be accessed by Lynx, but the part of the Mailman suite that sends out the custom Welcome message cannot access it and spits out the error.
Where are the custom templates stored? Is there a permissions issue perhaps? A grep for the text of my Welcome message turns up zero results.
# grep -Rnw '/' -e 'Test two million for welcome'
By the way, in Lynx when the template's URI uses the public ip adress -- ie.
http://my-public-ip-address/mailman3/api/templates/list/mytestlist.mydomain....
... it returns a "404 page not found" in Lynx.
Given that this is pretty much an out-of-the-box installation (venv installation as per the docs) and everything else works perfectly I'm thinking surely others have encountered this. Or is it just me?
It's completely done my head in, so if anyone can offer a glimmer of light I'll grab it.
<REDACTED-PUBLIC-IPv4-ADDRESS> instead of 127.0.0.1. Also, Have you set ALLOWED_HOSTS in your settings.py? It should be something like
ALLOWED_HOSTS = [ "localhost", # Archiving API from Mailman, keep it. "127.0.0.1", "<REDACTED-PUBLIC-IPv4-ADDRESS>", "MYDOMAIN.COM", ]
Yes.