Hello, On Mon, Sep 02, 2024 at 09:08:09AM -0000, mailman3--- via Mailman-users wrote:
Debian bookworm
Archival works here. Here is my simplified auto-deployement script (some might not be useful to you, I am using a local Postfix): PS: replace services_install by apt-get install djangoauth=@@@REPLACE # this is a bash array: server, user, pw psqlauth=@@@REPLACE services_install postfix (while read line do case $line in *=*) postconf -e "$line";; *) echo "TOSSING: $line" >&2;; esac done) <<EOF myhostname = $lists mydestination = $lists mynetworks = 127.0.0.0/8 inet_protocols = ipv4 inet_interfaces = all transport_maps = hash:/var/lib/mailman3/data/postfix_lmtp local_recipient_maps = hash:/var/lib/mailman3/data/postfix_lmtp relay_domains = hash:/var/lib/mailman3/data/postfix_domains relayhost = @@@REPLACE EOF cat >> /etc/aliases <<EOF postorius: root www-data: root root: ${djangoauth[1]} EOF newaliases services_install dbconfig-pgsql cat > /etc/dbconfig-common/mailman3.conf <<EOF dbc_install='true' dbc_upgrade='true' dbc_remove='false' dbc_dbtype='pgsql' dbc_dbuser='${psqlauth[1]}' dbc_dbpass='${psqlauth[2]}' dbc_dbserver='${psqlauth[0]}' dbc_dbname='mailman' dbc_dbadmin='postgres' EOF sed < /etc/dbconfig-common/mailman3.conf \ > /etc/dbconfig-common/mailman3-web.conf \ "s/^dbc_dbname=.*/dbc_dbname='mailmanweb'/" chmod 600 /etc/dbconfig-common/mailman3.conf \ /etc/dbconfig-common/mailman3-web.conf services_install mailman3-full mailman3-web sed --in-place "s/^site_owner: .*/site_owner: ${djangoauth[1]}/" \ /etc/mailman3/mailman.cfg # archiving mails from mailing-lists automatically cat >> /etc/mailman3/mailman.cfg <<'EOF' [archiver.hyperkitty] class: mailman_hyperkitty.Archiver enable: yes configuration: /etc/mailman3/mailman-hyperkitty.cfg [styles] default: private-default EOF # enable archiver key sed -i "s%^api_key:.*%api_key: $(egrep MAILMAN_ARCHIVER_KEY /etc/mailman3/mailman-web.py | awk '{print $NF;}' | sed "s/'//g")%" /etc/mailman3/mailman-hyperkitty.cfg # work-around: SQLAlchemy no longer supports "postgres" sed --in-place "s%^url: postgres://%url: postgresql://%" \ /etc/mailman3/mailman.cfg sed --in-place "s/.*'Mailman Suite Admin', 'root@localhost').*/('Mailman Suite Admin', '${djangoauth[1]}'),/;s/^EMAILNAME\s*=.*/EMAILNAME = '$lists'/;/django_mailman3.lib.auth.fedora/d" /etc/mailman3/mailman-web.py # aliases mailman <-> postfix mkdir -p /var/lib/mailman3/data chown list:list /var/lib/mailman3/data for i in postfix_lmtp postfix_lmtp postfix_domains do touch /var/lib/mailman3/data/$i postmap /var/lib/mailman3/data/$i done chown list:list /var/lib/mailman3/data/postfix_* # work-around for django_q # (does not seem to work, and DEFAULT_AUTO_FIELD should be also # configured to django.db.models.BigAutoField) dpkg-divert --rename /usr/lib/python3/dist-packages/django_q/conf.py sed < /usr/lib/python3/dist-packages/django_q/conf.py.distrib \ > /usr/lib/python3/dist-packages/django_q/conf.py \ 's%TIMEOUT = conf.get("timeout", None)%TIMEOUT = conf.get("timeout", 59)%' pkill -e -2 --full 'python3 manage.py qcluster' || true # fix example.com PGPASSWORD=${psqlauth[2]} psql -h ds-services-psql -U ${psqlauth[1]} mailmanweb -c "UPDATE django_site SET domain = '$lists', name = '$lists' WHERE id = 1" # workaround required? #chgrp list /var/lib/mailman3/locks/ #chmod g+rwx /var/lib/mailman3/locks/ chgrp list /var/log/mailman3/*.log # https://docs.djangoproject.com/en/3.0/ref/django-admin/#django-admin-creates... env DJANGO_SUPERUSER_PASSWORD=${djangoauth[3]} \ DJANGO_SUPERUSER_USERNAME=${djangoauth[2]} \ DJANGO_SUPERUSER_EMAIL=${djangoauth[1]} \ mailman-web createsuperuser --noinput \ || echo "django super user already exists in DB, ignored" # then I migrate the lists