Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[Software] Mailman3 connect to Hyperkitty

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
Artim
Posts: 46
Joined: 2022-12-15 10:26

[Software] Mailman3 connect to Hyperkitty

#1 Post by Artim »

A while back, I was able to move from mailman 2 to mailman3. But I've noticed that no messages are archived by hyperkitty. Thus the logs of mailman3 are filled to the brink with these error messages:

Code: Select all

May 01 20:44:02 2023 (1372) Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 169, in _new_conn
    conn = connection.create_connection(
  File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 96, in create_connection
    raise err
  File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 86, in create_connection
    sock.connect(sa)
OSError: [Errno 113] No route to host

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 699, in urlopen
    httplib_response = self._make_request(
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 382, in _make_request
    self._validate_conn(conn)
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 1012, in _validate_conn
    conn.connect()
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 353, in connect
    conn = self._new_conn()
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 181, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7f9e9d8fa820>: Failed to establish a new connection: [Errno 113] No route to host

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/requests/adapters.py", line 439, in send
    resp = conn.urlopen(
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 755, in urlopen
    retries = retries.increment(
  File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 574, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='domain.tld', port=443): Max retries exceeded with url: /hyperkitty/api/mailman/archive?key=HNBotwTdj6Oap_6xE8TmkCPbhm7Ynie8 (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f9e9d8fa820>: Failed to establish a new connection: [Errno 113] No route to host'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/mailman_hyperkitty/__init__.py", line 154, in _archive_message
    url = self._send_message(mlist, msg)
  File "/usr/lib/python3/dist-packages/mailman_hyperkitty/__init__.py", line 198, in _send_message
    result = requests.post(
  File "/usr/lib/python3/dist-packages/requests/api.py", line 119, in post
      return request('post', url, data=data, json=json, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='domain.tld', port=443): Max retries exceeded with url: /hyperkitty/api/mailman/archive?key=HNBotwTdj6Oap_6xE8TmkCPbhm7Ynie8 (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f9e9d8fa820>: Failed to establish a new connection: [Errno 113] No route to host'))
Anybody got a clue what exactly could be wrong?

These mailman3 packages are installed:
mailman3-full/stable,stable,now 3.3.3-1
mailman3-web/stable,stable,now 0+20200530-2
mailman3/stable,stable,now 3.3.3-1
python3-django-mailman3/stable,stable,now 1.3.5-2
python3-mailman-hyperkitty/stable,stable,now 1.1.0-10
python3-mailmanclient/stable,stable,now 3.3.2-1

Since it's entirely possible that something with the nginx config is wrong, this is it:

Code: Select all

# This nginx config file is part of the mailman3-web package.
#
# This nginx configuration file is a vhost configuration. Hence, it comes with
# a server name which is set to mailman.example.com. You will have to change it
# properly.
#
# Please also note that Mailman3 is configured to expect the web interface
# at URL subdirectory '/mailman3' per default, but this Nginx configuration
# provides Mailman3 under the root directory of the vhost.
#
# For the Nginx vhost configuration (without '/mailman3' subdomain) to
# work, you will have to edit the URL in 'base-url' at
# '/etc/mailman3/mailman-hyperkitty.cfg' and in 'MAILMAN_ARCHIVER_FROM'
# at '/etc/mailman3/mailman-web.py' accordingly.

upstream mailman3 {
	server unix:///run/mailman3-web/uwsgi.sock fail_timeout=0;
}

server {
	server_name lists.domain.tld ;
	server_tokens off;
	
    location / {
		include /etc/nginx/uwsgi_params;
		client_max_body_size 5M;
    		proxy_set_header        X-Real-IP       $realip_remote_addr;
    		proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
    		uwsgi_read_timeout 30s;
    		uwsgi_send_timeout 30s;
    		uwsgi_param  REMOTE_ADDR        $realip_remote_addr;
		uwsgi_pass mailman3;
		uwsgi_intercept_errors  on;
    }
	
    location /mailman3/static {
		alias /var/lib/mailman3/web/static;
    }

    location /mailman3/static/favicon.ico {
             	alias /var/lib/mailman3/web/static/postorius/img/favicon.ico;
    }
    
    location ~ /3.(0|1)/ {
                allow 134.130.104.122;
                deny all;
                proxy_pass http://localhost:8001;
                proxy_http_version  1.1;
                proxy_cache_bypass  $http_upgrade;
                proxy_set_header Upgrade           $http_upgrade;
                proxy_set_header Connection        "upgrade";
                proxy_set_header Host              $host;
                proxy_set_header X-Real-IP         $remote_addr;
                proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;
                proxy_set_header X-Forwarded-Host  $host;
                proxy_set_header X-Forwarded-Port  $server_port;
                proxy_redirect off;
   }    

    #Favicon
    location = /favicon.ico {
         alias  /etc/nginx/favicon.ico;
    }

    #robots.txt
    location = /robots.txt {
    	 add_header  Content-Type  text/plain;
	 return 200 "User-agent: *\nDisallow: /\n";
    }

        #Disable execution of scripts other than PHP from your document root
        location ~* .(pl|cgi|py|sh|lua|asp)$ {
           return 444;
        }

        location ~* ^.+\.(py~)$ {
           deny all;
           access_log off;
           log_not_found off;
        }

	add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload" always;
        add_header X-Frame-Options "SAMEORIGIN" always;
        add_header X-Xss-Protection "1; mode=block" always;
        add_header X-Content-Type-Options "nosniff" always;
        add_header Content-Security-Policy "default-src 'self' *.domain.tld; script-src 'self' 'unsafe-inline' *.domain.tld; connect-src 'self' *.domain.tld; img-src 'self' *.domain.tld; style-src 'self' *.domain.tld; object-src 'self' *.domain.tld; font-src 'self' *.domain.tld fonts.gstatic.com;";
        add_header Referrer-Policy "no-referrer-when-downgrade" always;

	
	listen 443 ssl http2;
	listen [::]:443 ssl http2;
	ssl_certificate /etc/ssl/certs/lists.domain.tld.fullchain.pem;
	ssl_certificate_key /etc/ssl/private/lists.domain.tld.private.pem;
	
}

server {
	server_name lists.domain.tld;
	return 301 https://$http_host$request_uri;
	listen 80;
}
server { 
 
        root /usr/share/nginx/html; 
        index index.html index.htm; 
 
        server_name lists.domain.tld; 
 
        location / { 
                proxy_pass http://lists.domain.tld:8001/; 
                proxy_http_version  1.1; 
                proxy_cache_bypass  $http_upgrade; 
 
                proxy_set_header Upgrade           $http_upgrade; 
                proxy_set_header Connection        "upgrade"; 
                proxy_set_header Host              $host; 
                proxy_set_header X-Real-IP         $remote_addr; 
                proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for; 
                proxy_set_header X-Forwarded-Proto $scheme; 
                proxy_set_header X-Forwarded-Host  $host; 
                proxy_set_header X-Forwarded-Port  $server_port; 
 
                proxy_redirect off; 
        } 
 
 
    listen [::]:8002 ssl http2; 
    listen 8002 http2; 
    ssl_certificate /etc/ssl/certs/lists.domain.tld.fullchain.pem;
    ssl_certificate_key /etc/ssl/private/lists.domain.tld.private.pem;
}
As the config states, here is what I set in the two files menationed in the comments at the top:
/etc/mailman3/mailman-hyperkitty.cfg:

Code: Select all

base_url: https://lists.domain.tld/hyperkitty/
/etc/mailman3/mailman-web.py:

Code: Select all

MAILMAN_ARCHIVER_FROM = ('127.0.0.1', '::1')

Post Reply