Skip to content

Instantly share code, notes, and snippets.

@thomasstxyz
Last active May 17, 2022 10:27
Show Gist options
  • Save thomasstxyz/4efe225abb7f2b5285a098a792745a2a to your computer and use it in GitHub Desktop.
Save thomasstxyz/4efe225abb7f2b5285a098a792745a2a to your computer and use it in GitHub Desktop.
# Following commands are supposed to be run interactively.
# This script is not ready for running automated.
apt install -y mariadb-server
vi /etc/mysql/mariadb.conf.d/50-server.cnf
[mysqld]
innodb_file_format = Barracuda
innodb_default_row_format = dynamic
innodb_file_per_table = 1
innodb_large_prefix = 1
systemctl restart mariadb
mysql -uroot --execute="grant all privileges on mailman3.* to mailman3@localhost identified by 'securepassword';"
mysql -uroot --execute="grant all privileges on mailman3web.* to mailman3@localhost identified by 'securepassword';"
mysql -uroot --execute="grant all privileges on mailman3web.* to mailman3web@localhost identified by 'securepassword';"
apt install -y python3-pip dbconfig-mysql python3-pymysql
apt install -y python3-dev libmysqlclient-dev
pip3 install mysqlclient
apt install mailman3-full
# Configure database for mailman3 with dbconfig-common? --> YES
# Configure database for mailman3-web with dbconfig-common? --> YES
# General type of mail configuration: --> Satellite System
# System mail name: --> domain.org
# Relay host: --> ip_of_smtp_server
cat << EOF >> /etc/postfix/main.cf
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
EOF
vi /etc/postfix/main.cf
# remove domain from mydestination =
# add relay host to mynetworks =
systemctl restart postfix
touch /var/lib/mailman3/data/postfix_domains
postmap /var/lib/mailman3/data/postfix_domains
touch /var/lib/mailman3/data/postfix_lmtp
postmap /var/lib/mailman3/data/postfix_lmtp
chown list:list /var/lib/mailman3/data/postfix_*
systemctl restart postfix
apt install -y apache2
ln -s /etc/mailman3/apache.conf /etc/apache2/conf-enabled/mailman3.conf
# remove the trailing / on localhost on the uwsgi ProxyPass line in /etc/mailman3/apache.conf
# add the following line within the VirtualHost block:
# ProxyPass "/api/" "http://localhost:8001/"
a2enmod proxy_uwsgi proxy_http ssl rewrite
systemctl restart apache2
# If you want to disable the Fedora login button, comment the line 'django_mailman3.lib.auth.fedora' of the INSTALLED_APPS parameter in /etc/mailman3/mailman-web.py
# If you want to disable sign-up, add the following lines to /etc/mailman3/mailman-web.py (TODO: this still shows a 'Sign up' link and will produce a 500 Internal Server Error on click; didn't find a disable yet).
ACCOUNT_FORMS = {
'signup': False
}
vi /etc/mailman3/mailman-web.py
# change the following:
# EMAILNAME =
systemctl restart mailman3-web mailman3
vi /etc/postfix/main.cf
# relayhost = 10.10.x.x
systemctl restart postfix
https://gist.github.com/plepe/dab22fdbfec63d8632709065890124a3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment