Unable to get mailman3 working on Ubuntu 20.04 LTS
Hi all, after upgrading an older server to Ubuntu 20.04, I tried to first upgrade my old mailman 2 installation to mailman 3. I've been on it for three weeks now, but unable to get anything working. I have long forgone the idea of upgrading and thus purged everything from mailman2 on my machine, and installed and removed mailman3 several times to no avail.
My most recent try (it is currently an empty mailman installation) was done by calling
apt install mailman3 mailman3-full mailman3-web
and saying "yes" to every question. I'm using Mariadb as the database, and two databases called mailman3 and mailman3web (plus two users with the same names) have been created. I have configured a virtual host for apache (see below) and changed the mailman.cfg and mailman-weg.cfg to match (also see below).
I have restarted both mailman3 and mailman3-web several times now, but when I try to access the site, I just get
| Something went wrong | Mailman REST API not available. Please start Mailman core.
plus an e-mail with subject
| [Django] ERROR (EXTERNAL IP): Service Unavailable: /mailman3/postorius/lists/
I'm running
| GNU Mailman 3.3.3b1 (Tom Sawyer) | Python 3.8.10 (default, Sep 28 2021, 16:10:42)
Can anybody tell me what is going on? Also, the confirmation e-mail I got for registering a user says "example.com" in its subject line, even though I replaced every mention in the config files below with my actual URL.
Any help is appreaciated, I can provide logs or other data on request.
Cheers, michael
/etc/mailman.mailman3.cfg
site_owner: postmaster@<site> noreply_address: noreply default_language: en sender_headers: from from_ reply-to sender email_commands_max_lines: 10 pending_request_life: 3d cache_life: 7d pre_hook: post_hook: layout: debian filtered_messages_are_preservable: no html_to_plain_text_command: /usr/bin/lynx -dump $filename listname_chars: [-_.0-9a-z]
[shell] prompt: >>> banner: Welcome to the GNU Mailman shell use_ipython: no history_file:
[paths.debian] var_dir: /var/lib/mailman3 queue_dir: $var_dir/queue bin_dir: /usr/lib/mailman3/bin list_data_dir: $var_dir/lists log_dir: /var/log/mailman3 lock_dir: $var_dir/locks data_dir: $var_dir/data cache_dir: $var_dir/cache etc_dir: /etc/mailman3 ext_dir: $var_dir/ext messages_dir: $var_dir/messages archive_dir: $var_dir/archives template_dir: $var_dir/templates pid_file: /run/mailman3/master.pid lock_file: $lock_dir/master.lck
[database] class: mailman.database.mysql.MySQLDatabase url: mysql+pymysql://mailman3:<password>@localhost/mailman3?charset=utf8&use_unicode=1 debug: no
[logging.debian] format: %(asctime)s (%(process)d) %(message)s datefmt: %b %d %H:%M:%S %Y propagate: no level: info path: mailman.log
[webservice] hostname: <site> port: 8001 use_https: yes show_tracebacks: yes api_version: 3.1 admin_user: restadmin admin_pass: <pass>
[mta] incoming: mailman.mta.exim4.LMTP outgoing: mailman.mta.deliver.deliver smtp_host: localhost smtp_port: 25 smtp_user: smtp_pass: lmtp_host: 127.0.0.1 lmtp_port: 8024 configuration: python:mailman.config.exim4
virtual host in Apache
<VirtualHost <site>:443> AssignUserID www-data www-data ServerAdmin webmaster@<site> ServerName <site> SSLEngine on
DocumentRoot /webspace/mailman/www
ErrorLog /var/log/apache2/mm3_error_log
TransferLog /var/log/apache2/mm3_access_log
Alias /mailman3/favicon.ico /var/lib/mailman3/web/static/postorius/img/favicon.ico
Alias /mailman3/static /var/lib/mailman3/web/static
<Directory "/var/lib/mailman3/web/static">
Require all granted
</Directory>
<IfModule mod_proxy_uwsgi.c>
ProxyPass /mailman3/favicon.ico !
ProxyPass /mailman3/static !
ProxyPass /mailman3 unix:/run/mailman3-web/uwsgi.sock|uwsgi://localhost
</IfModule>
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/<site>/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/<site>/privkey.pem
</VirtualHost>
/etc/mailman3/mailman-web.cfg
SECRET_KEY = <secret>
ADMINS = ( ('Mailman Suite Admin', 'root@localhost'), )
ALLOWED_HOSTS = [ #"localhost", # Archiving API from Mailman, keep it. # "lists.your-domain.org", # Add here all production URLs you may have. '*' ]
MAILMAN_REST_API_URL = 'http://localhost:8001' MAILMAN_REST_API_USER = 'restadmin' MAILMAN_REST_API_PASS = '' MAILMAN_ARCHIVER_KEY = <secret> MAILMAN_ARCHIVER_FROM = ('127.0.0.1', '::1')
INSTALLED_APPS = ( 'hyperkitty', 'postorius', 'django_mailman3', 'django.contrib.admin', # 'django.contrib.admindocs', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'rest_framework', 'django_gravatar', 'compressor', 'haystack', 'django_extensions', 'django_q', 'allauth', 'allauth.account', 'allauth.socialaccount', 'django_mailman3.lib.auth.fedora', )
DATABASES = { 'default': { # Use 'sqlite3', 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 'ENGINE': 'django.db.backends.mysql', 'NAME': 'mailman3web', 'USER': 'mailman3web', 'PASSWORD': <passwd>, 'HOST': 'localhost', 'PORT': '', 'OPTIONS': { # Set sql_mode to 'STRICT_TRANS_TABLES' for MySQL. See # https://docs.djangoproject.com/en/1.11/ref/ # databases/#setting-sql-mode 'init_command': "SET sql_mode='STRICT_TRANS_TABLES'", }, } }
USE_X_FORWARDED_HOST = True
LANGUAGE_CODE = 'en-us' TIME_ZONE = 'UTC' USE_I18N = True USE_L10N = True USE_TZ = True
EMAILNAME = '<site>'
DEFAULT_FROM_EMAIL = 'postorius@{}'.format(EMAILNAME)
SERVER_EMAIL = 'root@{}'.format(EMAILNAME)
ACCOUNT_DEFAULT_HTTP_PROTOCOL = "https"
SOCIALACCOUNT_PROVIDERS = { }
COMPRESS_OFFLINE = True POSTORIUS_TEMPLATE_BASE_URL = 'http://localhost/mailman3/'
On Oct 26, 2021, at 10:43 AM, Michael Heseltine <heseltine.michael@gmail.com> wrote:
My most recent try (it is currently an empty mailman installation) was done by calling
apt install mailman3 mailman3-full mailman3-web
Don’t do that. Really, don’t. It will end in tears. Ask a bunch of us how we know.
Use this:
https://wiki.list.org/DOC/Howto_Install_Mailman3_On_Debian10
and/or this:
https://docs.google.com/document/d/1xIcSsoNFp2nHi7r4eQys00s9a0k2sHhu1V5Plant...
- Mark
mark@pdc-racing.net | 408-348-2878
On 10/26/2021 11:43 AM, Michael Heseltine wrote:
after upgrading an older server to Ubuntu 20.04, I tried to first upgrade my old mailman 2 installation to mailman 3. I've been on it for three weeks now, but unable to get anything working. I have long forgone the idea of upgrading and thus purged everything from mailman2 on my machine, and installed and removed mailman3 several times to no avail.
I just ran into a lot of trouble myself getting the Ubuntu packages working. And I got the same advice you did from this mailing list -- don't try to install it that way.
My first attempt at installing it without using packages was the virtualenv method. After beating my head against that for a few hours and not making any progress at all, I gave up.
I now have the docker install fully functional, and imported my list configurations from data I saved from an ancient mailman2 install. It was giving me grief too when I first installed it, but I managed to work through each of the problems. One of the issues was a basic networking problem -- mailman in the container wasn't able to talk to Postfix on the host. Rebooting the host cleared that up. Side note: There are no details in the docker instructions about how to upgrade the containers to newer versions. Easy upgrades was a big reason why I wanted to use the Ubuntu packages. Upgrading other packages has always been pretty straightforward.
I'm using Apache, not nginx. It was already installed, and I know more about configuring it than nginx. It wasn't too difficult to set up Apache to proxy over to uwsgi running in the web container. I had to work out the config myself ... the docker instructions only have a config example for nginx.
Email isn't very interactive, but works. You can find me on the IRC channel for the next few days if you want something faster. If you want to try the docker method, I can try to help.
Thanks, Shawn
I am interested in your docr instructions. I don't use postfix, instead I use sendmail, but I think I can figure that out, but I have been having lots of problems installing without docr, and I do have apache, so this would be great. Send off list if you think that would not be of general use.
On Wed, 27 Oct 2021 19:51:17 -0400, Shawn Heisey wrote:
On 10/26/2021 11:43 AM, Michael Heseltine wrote:
after upgrading an older server to Ubuntu 20.04, I tried to first upgrade my old mailman 2 installation to mailman 3. I've been on it for three weeks now, but unable to get anything working. I have long forgone the idea of upgrading and thus purged everything from mailman2 on my machine, and installed and removed mailman3 several times to no avail.
I just ran into a lot of trouble myself getting the Ubuntu packages working. And I got the same advice you did from this mailing list -- don't try to install it that way.
My first attempt at installing it without using packages was the virtualenv method. After beating my head against that for a few hours and not making any progress at all, I gave up.
I now have the docker install fully functional, and imported my list configurations from data I saved from an ancient mailman2 install. It was giving me grief too when I first installed it, but I managed to work through each of the problems. One of the issues was a basic networking problem -- mailman in the container wasn't able to talk to Postfix on the host. Rebooting the host cleared that up. Side note: There are no details in the docker instructions about how to upgrade the containers to newer versions. Easy upgrades was a big reason why I wanted to use the Ubuntu packages. Upgrading other packages has always been pretty straightforward.
I'm using Apache, not nginx. It was already installed, and I know more about configuring it than nginx. It wasn't too difficult to set up Apache to proxy over to uwsgi running in the web container. I had to work out the config myself ... the docker instructions only have a config example for nginx.
Email isn't very interactive, but works. You can find me on the IRC channel for the next few days if you want something faster. If you want to try the docker method, I can try to help.
Thanks, Shawn
Mailman-users mailing list -- mailman-users@mailman3.org To unsubscribe send an email to mailman-users-leave@mailman3.org https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/
-- Your life is like a penny. You're going to lose it. The question is: How do you spend it?
John Covici wb2una
covici@ccs.covici.com
On 10/27/2021 9:51 PM, John Covici wrote:
I am interested in your docr instructions. I don't use postfix, instead I use sendmail, but I think I can figure that out, but I have been having lots of problems installing without docr, and I do have apache, so this would be great. Send off list if you think that would not be of general use.
The instructions found here are most of what is needed:
https://github.com/maxking/docker-mailman/#running
Here's the issue where I provided my Apache config:
https://github.com/maxking/docker-mailman/issues/525
For each of my mailing lists, I created the list and then imported a mailman 2.1 config. I had problems with the footer being appended to list messages ... it took me a while to figure out how to fix that! You have to delete the footer config file, restart the container, and then if the resulting default footer is insufficent, use the admin web page to redefine it.
Instructions for exim and postfix are included on the project page. I haven't used sendmail in many years, so I wouldn't have any idea how to get that working. Even when I was using it, I found the config to be extremely arcane and difficult.
Thanks, Shawn
OK, thanks, I will check it out and see how far I get. One thing, when you start a container, you can give it a name, so you would not need that long id string.
On Fri, 29 Oct 2021 00:26:07 -0400, Shawn Heisey wrote:
On 10/27/2021 9:51 PM, John Covici wrote:
I am interested in your docr instructions. I don't use postfix, instead I use sendmail, but I think I can figure that out, but I have been having lots of problems installing without docr, and I do have apache, so this would be great. Send off list if you think that would not be of general use.
The instructions found here are most of what is needed:
https://github.com/maxking/docker-mailman/#running
Here's the issue where I provided my Apache config:
https://github.com/maxking/docker-mailman/issues/525
For each of my mailing lists, I created the list and then imported a mailman 2.1 config. I had problems with the footer being appended to list messages ... it took me a while to figure out how to fix that! You have to delete the footer config file, restart the container, and then if the resulting default footer is insufficent, use the admin web page to redefine it.
Instructions for exim and postfix are included on the project page. I haven't used sendmail in many years, so I wouldn't have any idea how to get that working. Even when I was using it, I found the config to be extremely arcane and difficult.
Thanks, Shawn
Mailman-users mailing list -- mailman-users@mailman3.org To unsubscribe send an email to mailman-users-leave@mailman3.org https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/
-- Your life is like a penny. You're going to lose it. The question is: How do you spend it?
John Covici wb2una
covici@ccs.covici.com
On Oct 27, 2021, at 4:51 PM, Shawn Heisey <mailman@elyograg.org> wrote:
On 10/26/2021 11:43 AM, Michael Heseltine wrote:
after upgrading an older server to Ubuntu 20.04, I tried to first upgrade my old mailman 2 installation to mailman 3. I've been on it for three weeks now, but unable to get anything working. I have long forgone the idea of upgrading and thus purged everything from mailman2 on my machine, and installed and removed mailman3 several times to no avail.
I just ran into a lot of trouble myself getting the Ubuntu packages working. And I got the same advice you did from this mailing list -- don't try to install it that way.
My first attempt at installing it without using packages was the virtualenv method. After beating my head against that for a few hours and not making any progress at all, I gave up.
I now have the docker install fully functional, and imported my list configurations from data I saved from an ancient mailman2 install. It was giving me grief too when I first installed it, but I managed to work through each of the problems. One of the issues was a basic networking problem -- mailman in the container wasn't able to talk to Postfix on the host. Rebooting the host cleared that up. Side note: There are no details in the docker instructions about how to upgrade the containers to newer versions. Easy upgrades was a big reason why I wanted to use the Ubuntu packages. Upgrading other packages has always been pretty straightforward.
The instructions are basically in the issue description, pending move to a documentation page:
https://github.com/maxking/docker-mailman/issues/293
If you are upgrading the latest 0.4.x release from 0.3.x, you also want to look at
https://asynchronous.in/docker-mailman/news/#upgrading-to-040-release
I'm using Apache, not nginx. It was already installed, and I know more about configuring it than nginx. It wasn't too difficult to set up Apache to proxy over to uwsgi running in the web container. I had to work out the config myself ... the docker instructions only have a config example for nginx.
If you can send a PR for the config you set up for Apache in Github, or just an issue, I can include it in the docs :-)
-- thanks, Abhilash Raj (maxking)
On 10/28/2021 5:28 PM, Abhilash Raj wrote:
The instructions are basically in the issue description, pending move to a documentation page:
https://github.com/maxking/docker-mailman/issues/293
If you are upgrading the latest 0.4.x release from 0.3.x, you also want to look at
https://asynchronous.in/docker-mailman/news/#upgrading-to-040-release
Awesome! Thank you for that info! I just upgraded from 0.4.1 (which was the tag I used for the initial install) to 0.4.2 and it all looks good. The lists are still there in the output of this command on the host:
docker exec -u mailman mailman-core mailman lists
After the upgrade, I sent a test message to one of the mailing lists that looks like it worked perfectly.
I assumed that it would be necessary to update the tags in the docker-compose.yaml file, and I did so. Should that be added to the instructions?
One thing that was very non-obvious is how to get the containers to start at boot time. A command like this, issued three times with the actual ID values for the containers, took care of it for me:
docker update --restart=unless-stopped 0576df221c0b
If it is possible to have the docker-compose.yaml file set that flag when it creates the containers, I think that would be a good idea. I did notice that the postorius and mysql docker-compose configs do set the database container (but not the mailman containers) to restart always ... but my limited experience with docker tells me that unless-stopped is a better option.
If you can send a PR for the config you set up for Apache in Github, or just an issue, I can include it in the docs :-)
I created an issue and included a sanitized copy of my virtualhost config.
Thanks, Shawn
participants (5)
-
Abhilash Raj
-
John Covici
-
Mark Dadgar
-
Michael Heseltine
-
Shawn Heisey