I run into several problems installing mailman3 / mailman-web on noble
with MySQL, exim4 and Apache2

FWIW, I post below how I finally made this (somewhat) working.
I am still facing issues with the web-interface of mailman3-web,
but the basic stuff appears to work.

I also hope that package managers find this useful in order to fix this.

(Note: These instructions are provided as a courtesy and may contain
bugs. No warranty!)

```
#   Sources that may be useful:
#   - https://docs.mailman3.org/en/latest/migration.html
#   - 
https://docs.mailman3.org/projects/mailman/en/latest/src/mailman/docs/mta.html#exim
#   - ( https://docs.mailman3.org/en/latest/upgrade-guide.html )
#   - 
https://docs.mailman3.org/en/latest/config-web.html#configure-postorius-hyperkitty
#   - (https://gitlab.com/mailman/hyperkitty/-/issues/437)
#   - 
https://docs.mailman3.org/projects/mailman/en/latest/src/mailman/commands/docs/create.html
#   - /usr/share/doc/mailman3
#   - /usr/share/doc/mailman3-web
 
# install

sudo apt-get install python3-pymysql
sudo apt-get install python3-mysqldb
sudo apt-get install python3-sqlalchemy-ext
sudo apt-get install libapache2-mod-proxy-uwsgi

# Fetch the following packages from Debian Sid first
sudo dpkg -i /opt/deb/mailman3/mailman3-web_0+20240312-1_all.deb 
/opt/deb/mailman3/python3-django-hyperkitty_1.3.9-1_all.deb   
/opt/deb/mailman3/python3-django-mailman3_1.3.15-1_all.deb 
sudo apt install --fix-broken

sudo apt-get install mailman3-full


# edit /etc/mailman3/mailman.cfg
# (disable unneeded Database and Mail Servers; in my case all except MySQL and 
Exim4)
sudo sudo dpkg-reconfigure mailman3

sudo dpkg-reconfigure mailman3-web


# Manually verify / adjust mailman config:
# mainly the following files:
# - /etc/mailman3/mailman-web.py
# - /etc/mailman3/mailman.cfg

#  Rg. /etc/mailman3/mailman-web.py 
#  Before using mailman-web, the following 2 Lines should be added for MySQL
#  Background: 
https://www.monolune.com/articles/mysql-utf8-charsets-and-collations-explained/
#  
#  --- BEGIN ---
#              # https://docs.djangoproject.com/en/1.11/ref/
#              #     databases/#setting-sql-mode
#              'init_command': "SET sql_mode='STRICT_TRANS_TABLES'",
# +            # OPTIONS: for mysql engine only, do not use with other engines.
# +            'charset': 'utf8mb4',  # Enable utf8 4-byte encodings.
#          },
#      }
#  }
#  
# --- END ---

sudo service mailman3 restart
sudo service mailman3-web restart

# Add your Exim4 config (adjust to your needs):
# 
https://docs.mailman3.org/projects/mailman/en/latest/src/mailman/docs/mta.html#exim
#  
# /etc/exim4/conf.d/main/25_mailman3_macros main/25_mailman3_macros
# /etc/exim4/conf.d/local/router/455_mailman3_router router/455_mailman3_router
# /etc/exim4/conf.d/transport/55_mailman3_transport 
transport/55_mailman3_transport


# Now there is a problem with permissions. Mailman3 recommends that all mailman
# command line operations should be done with the 'list' user, however the
# default installation (deb) does not allow to login as this user,
# e.g. by `sudo su - list` fails. Either change the list user's config to 
enable login
#  or play around with the permissions, e.g.

# If you decide to do this with your personal user: 
# 
# add your personal user to group list
# (replace <your_personal_username> with your unix username)
sudo adduser <your_personal_username> list
#  logout and login, so that your shell knows about this change

# Update Permissions:
sudo find /var/lib/mailman3 -exec sudo chmod g+w {} \;
sudo find /var/lib/mailman3 -type d -exec sudo chmod g+s {} \;
# Maybe more permissions need to be changed

# For new lists and import from mailman2.1:
# 
# Note: Replace `mylist` with your listname and `domain.tld` with your domain 
in the following examples
# 
# create new mailman3 mailing lists
mailman create <mylist>@<domain.tld>

# import from mailman2.1 (if you are upgrading from mailman2.1 to mailman3)
mailman import21 <mylist>@<domain.tld> 
/var/lib/mailman/lists/<mylist>/config.pck

# import archives from mailman2 to mailman3-web
python3 /usr/share/mailman3-web/manage.py hyperkitty_import -l 
<mylist>@<domain.tld> /var/lib/mailman/archives/private/<mylist>/<mylist>

# Indexing archives
for listname in `mailman lists | grep "@"` ; do echo $listname ; python3 
/usr/share/mailman3-web/manage.py update_index_one_list $listname; done


# You may need to set addional permissions, e.g.

sudo find /var/lib/mailman3 -exec sudo chmod g+w {} \;
sudo find /var/lib/mailman3 -type d -exec sudo chmod g+s {} \;

sudo find /var/lib/mailman3/templates -exec sudo chown list:list {} \;
sudo find /var/lib/mailman3/lists -type d -exec sudo chown list:list {} \;

```

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2062960

Title:
  ubuntu 24.04 mailman3-web fails install on clean system

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/mailman-suite/+bug/2062960/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to