On Wed, Aug 7, 2019, at 9:49 AM, Phil Thompson wrote:
On 07/08/2019 17:04, Abhilash Raj wrote:
On Wed, Aug 7, 2019, at 8:41 AM, Phil Thompson wrote:
On 06/08/2019 09:48, Phil Thompson wrote:
On 06/08/2019 03:38, Abhilash Raj wrote:
On Mon, Aug 5, 2019, at 10:06 AM, Phil Thompson wrote:
I'm in the process of setting up mailman3. The only problem I seem to be having is getting Hyperkitty to archive messages. Rather than the authorisation problems people have previously asked about on the list, I am getting a 403 error...
Aug 05 15:38:40 2019 (10229) HyperKitty failure on http://localhost/mailman3/hyperkitty/api/mailman/urls: <html><title>Forbidden</title><body> <h1>Access is forbidden</h1></body></html> (403) Aug 05 15:38:58 2019 (10222) HyperKitty failure on http://localhost/mailman3/hyperkitty/api/mailman/archive: <html><title>Forbidden</title><body> <h1>Access is forbidden</h1></body></html> (403)
Any suggestions would be appreciated.
How did you install Hyperkitty?
On Ubuntu...
apt-get install mailman3-full
You probably need to the set the API key correctly in both Core and Hyperkitty.
Have you looked at documentation here1?
Note that the MAILMAN_ARCHIVER_KEY = "value" (this value should be in quotes, single or double, doesn't matter) in your settings.py for Web (Django) should be same as the
api_key : value
(without quotes here in hyperkitty.cfg config file).That's all correct. I'm familiar with the authorisation issues that other people have had.
The only thing I'm doing differently (as far as I am aware) is that I'm using a URL prefixed with /mailman3 which is stripped off in my nginx configuration...
# mailman3. location /mailman3/ { uwsgi_pass unix:/run/mailman3/web/uwsgi.sock; include uwsgi_params; uwsgi_param SERVER_ADDR $server_addr; uwsgi_modifier1 30; uwsgi_param SCRIPT_NAME /mailman3; } location /mailman3/static { alias /var/lib/mailman3/web/static; } location /mailman3/static/favicon.ico { alias /var/lib/mailman3/web/static/postorius/img/favicon.ico; }
...but I don't see this affecting the mailman to Hyperkitty communication. Posting to lists and the Postorius and Hyperkitty frontends seem to work fine.
I have now fixed the 403 error (by setting MAILMAN_ARCHIVER_FROM to my public IP address). However I now get a 400 Bad Request error.
I have traced this to the archive() function in hyperkitty/views/mailman.py which is expect a POST but is actually getting a GET, specifically...
GET '/mailman3/hyperkitty/api/mailman/archive?key=...'
...which seems to be a fairly fundamental problem.
Again, any suggestions would be welcome.
It should be sending POST request to archive emails1. How did you grab the above request? Was it from logs?
Yes, I added DEBUG=True in mailman-web.py and captured the HTML from mailman.log.
DEBUG=True doesn't print anything more useful around the 400 error response?
Do you have anything else in the logs? There should be something in the Mailman Core or web logs should have something.
There's nothing useful in the core log.
There are 3 preceding entries in the web log...
GET /mailman3/hyperkitty/api/mailman/urls?mlist=...&key=... GET /mailman3/hyperkitty/api/mailman/urls?mlist=...&msgid=...&key=... GET /mailman3/hyperkitty/api/mailman/urls?mlist=...&msgid=...&key=...
There is one item in the spool directory.
These were all (apparently) successful. It seems odd that the last two entries were identical.
The only other thing that I can think of is, ALLOWED_HOSTS. What settings do you have in your ALLOWED_HOSTS in settings.py for Django?
You need to have 'localhost' or whatever is the value of the "Host" in the "base_url" in your hyperkitty.cfg file in Mailman Core. I am not sure what is the default value in Ubuntu system.
If you don't know, you can debug by adding a '*' in your ALLOWED_HOSTS and see if the problem goes away, this will bypass the Host header check.
-- thanks, Abhilash Raj (maxking)