... | @@ -12,7 +12,7 @@ Then we install rust from source, which is needed for python Cryptography librar |
... | @@ -12,7 +12,7 @@ Then we install rust from source, which is needed for python Cryptography librar |
|
# curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
|
# curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
|
# rustc --version
|
|
# rustc --version
|
|
```
|
|
```
|
|
Install some extra dependencies for softwate compiling:
|
|
Install some extra dependencies for software compiling:
|
|
|
|
|
|
`# apt-get install build-essential libssl-dev libffi-dev python3-dev cargo`
|
|
`# apt-get install build-essential libssl-dev libffi-dev python3-dev cargo`
|
|
|
|
|
... | @@ -45,12 +45,14 @@ https://docs.mailman3.org/en/latest/install/virtualenv.html#setup-database |
... | @@ -45,12 +45,14 @@ https://docs.mailman3.org/en/latest/install/virtualenv.html#setup-database |
|
|
|
|
|
`useradd -m -d /opt/mailman -s /usr/bin/bash mailman`
|
|
`useradd -m -d /opt/mailman -s /usr/bin/bash mailman`
|
|
|
|
|
|
enter user mailman and create
|
|
|
|
|
|
|
|
Go to mailman’s dir and create a virtualenv
|
|
Go to mailman’s dir and create a virtualenv
|
|
|
|
|
|
`python3 -m venv venv`
|
|
`python3 -m venv venv`
|
|
|
|
|
|
|
|
To activate the virtualenv when we enter user mailman, we can add the following in mailman's .bashrc:
|
|
|
|
|
|
|
|
`source /opt/mailman/venv/bin/activate`
|
|
|
|
|
|
Ref: https://docs.mailman3.org/en/latest/install/virtualenv.html#virtualenv-setup
|
|
Ref: https://docs.mailman3.org/en/latest/install/virtualenv.html#virtualenv-setup
|
|
|
|
|
|
## Install Mailman and other python libraries
|
|
## Install Mailman and other python libraries
|
... | @@ -64,7 +66,7 @@ mailman-web provides hyperkitty and postorius for the web interface, as well as |
... | @@ -64,7 +66,7 @@ mailman-web provides hyperkitty and postorius for the web interface, as well as |
|
## Mailman and hyperkitty configurations
|
|
## Mailman and hyperkitty configurations
|
|
|
|
|
|
Exit mailman user and as root we create
|
|
Exit mailman user and as root we create
|
|
/etc/mailman3/ dir, we make owner of this dir the user mailman and create the files `mailman.cfg` and `settings.py`. Then as mailman user again, we also create an extra dir under `/opt/mailman` to place the `mailman-hyperkitty.cfg` settings.
|
|
`/etc/mailman3/` directory, we make owner of this directory the user mailman, and create under it the files `mailman.cfg` and `settings.py`. Then as mailman user again, we create the `mailman-hyperkitty.cfg` file under the `/opt/mailman`.
|
|
|
|
|
|
*mailman.cfg and setting.py samples:*
|
|
*mailman.cfg and setting.py samples:*
|
|
|
|
|
... | @@ -72,6 +74,26 @@ https://docs.mailman3.org/en/latest/install/virtualenv.html#installing-mailman-c |
... | @@ -72,6 +74,26 @@ https://docs.mailman3.org/en/latest/install/virtualenv.html#installing-mailman-c |
|
|
|
|
|
https://docs.mailman3.org/en/latest/install/virtualenv.html#initial-configuration
|
|
https://docs.mailman3.org/en/latest/install/virtualenv.html#initial-configuration
|
|
|
|
|
|
|
|
In the `mailman.cfg` edit the archiver directive as following:
|
|
|
|
```
|
|
|
|
[archiver.hyperkitty]
|
|
|
|
class: mailman_hyperkitty.Archiver
|
|
|
|
enable: yes
|
|
|
|
configuration: /path/to/example_project/mailman-hyperkitty.cfg
|
|
|
|
```
|
|
|
|
And in mailman-hyperkitty.cfg:
|
|
|
|
```
|
|
|
|
# The base_url should correspond with the apache2 links we configure later
|
|
|
|
base_url: http://localhost/archives
|
|
|
|
|
|
|
|
# Shared API key, must be the identical to the value the same as in the /etc/mailman3/settings.py
|
|
|
|
api_key: SecretArchiverAPIKey
|
|
|
|
```
|
|
|
|
Ref:
|
|
|
|
https://hyperkitty.readthedocs.io/en/latest/install.html#connecting-to-mailman
|
|
|
|
|
|
|
|
https://gitlab.com/mailman/mailman-hyperkitty/blob/master/mailman-hyperkitty.cfg
|
|
|
|
|
|
## Postfix configuration
|
|
## Postfix configuration
|
|
|
|
|
|
Check open ports in the system. Look for the smtpd port 25 if it’s open. Postfix is the MTP which relays incoming and outgoing mails to mailman.
|
|
Check open ports in the system. Look for the smtpd port 25 if it’s open. Postfix is the MTP which relays incoming and outgoing mails to mailman.
|
... | @@ -80,35 +102,66 @@ Check open ports in the system. Look for the smtpd port 25 if it’s open. Postf |
... | @@ -80,35 +102,66 @@ Check open ports in the system. Look for the smtpd port 25 if it’s open. Postf |
|
|
|
|
|
https://serverfault.com/questions/149903/what-ports-to-open-for-mail-server
|
|
https://serverfault.com/questions/149903/what-ports-to-open-for-mail-server
|
|
|
|
|
|
*postfix configurations here:
|
|
*postfix configurations here:*
|
|
|
|
|
|
https://docs.mailman3.org/en/latest/install/virtualenv.html#setup-mta
|
|
https://docs.mailman3.org/en/latest/install/virtualenv.html#setup-mta
|
|
|
|
|
|
if postfix is already installed skip that step and just edit the postfix/main.cf with the sample in the above step.
|
|
if postfix is already installed skip that step and just edit the postfix/main.cf with the sample in the above step.
|
|
|
|
|
|
**I. Enter mailman user again**
|
|
## Configure mailman-web UI
|
|
and run migrations, collect static files for the mailman-web, and create a django admin superuser
|
|
*Mailman web is a django site, which includes postorius and hyperkitty (that we installed before in our virtualenv).*
|
|
|
|
Enter mailman user again and run migrations, collect static files for the mailman-web, and create a django admin superuser, see [details](https://docs.mailman3.org/en/latest/install/virtualenv.html#run-database-migrations).
|
|
|
|
|
|
https://docs.mailman3.org/en/latest/install/virtualenv.html#run-database-migrations
|
|
## Run mailman-web locally
|
|
|
|
First with the local django server
|
|
|
|
```
|
|
|
|
(venv) $ pip install Werkzeug
|
|
|
|
(venv) $ mailman-web runserver_plus
|
|
|
|
```
|
|
|
|
then with gunicorn, e,g:
|
|
|
|
`(venv) $ gunicorn -c /opt/mailman/gunicorn.py mailman_web.wsgi:application`
|
|
|
|
|
|
|
|
Sample gunicorn.py file:
|
|
|
|
```
|
|
|
|
#!/opt/mailman/venv/bin/python
|
|
|
|
|
|
|
|
import sys
|
|
|
|
sys.path[0:0] = [
|
|
|
|
'/opt/mailman/',
|
|
|
|
'/etc/mailman3/'
|
|
|
|
]
|
|
|
|
|
|
**J. Run mailman-web locally**
|
|
import os
|
|
first with the local django server, then with gunicorn
|
|
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
|
|
|
|
|
|
**K. System services**
|
|
import gunicorn.app.wsgiapp
|
|
|
|
|
|
Run as daemons the above by adding them as services
|
|
if __name__ == '__main__':
|
|
|
|
sys.exit(gunicorn.app.wsgiapp.run())
|
|
|
|
```
|
|
|
|
|
|
|
|
## System services
|
|
|
|
|
|
|
|
Run as daemons the django server by adding the following services:
|
|
/lib/systemd/system/ + mailman3.service + gunicorn + qcluster
|
|
/lib/systemd/system/ + mailman3.service + gunicorn + qcluster
|
|
|
|
|
|
https://docs.mailman3.org/en/latest/install/virtualenv.html#starting-mailman-automatically
|
|
[Sample mailman3.service](https://docs.mailman3.org/en/latest/install/virtualenv.html#starting-mailman-automatically)
|
|
sample gunicorn unit service:
|
|
|
|
|
|
[Sample gunicorn unit service](https://wiki.list.org/DOC/Mailman%203%20installation%20experience?action=AttachFile&do=view&target=systemd_gunicorn.txt)
|
|
|
|
|
|
https://wiki.list.org/DOC/Mailman%203%20installation%20experience?action=AttachFile&do=view&target=systemd_gunicorn.txt
|
|
[Sample qcluster unit service](https://wiki.list.org/DOC/Mailman%203%20installation%20experience?action=AttachFile&do=view&target=systemd_qcluster.txt)
|
|
|
|
|
|
sample qcluster unit service:
|
|
After reload the services and check their status
|
|
|
|
```
|
|
|
|
# systemctl daemon-reload
|
|
|
|
# systemctl status mailman3
|
|
|
|
```
|
|
|
|
Check status for gunicorn and qcluster too!
|
|
|
|
|
|
https://wiki.list.org/DOC/Mailman%203%20installation%20experience?action=AttachFile&do=view&target=systemd_qcluster.txt
|
|
## Cron jobs
|
|
|
|
|
|
**L. Cron jobs**
|
|
From mailman user run
|
|
|
|
`crontab -e` and add the following:
|
|
|
|
|
|
```
|
|
```
|
|
@hourly /opt/mailman/mm/bin/django-admin runjobs hourly
|
|
@hourly /opt/mailman/mm/bin/django-admin runjobs hourly
|
... | @@ -138,7 +191,7 @@ See more details: |
... | @@ -138,7 +191,7 @@ See more details: |
|
https://djangodeployment.readthedocs.io/en/latest/04-web-server.html?highlight=apache2#configuring-apache-for-django
|
|
https://djangodeployment.readthedocs.io/en/latest/04-web-server.html?highlight=apache2#configuring-apache-for-django
|
|
|
|
|
|
|
|
|
|
## Copy existing list from one server to another
|
|
## Copy existing list from old mailman server to mailman3
|
|
|
|
|
|
Create ssh keys for server where old lists reside and copy public key to current mailman3 server.
|
|
Create ssh keys for server where old lists reside and copy public key to current mailman3 server.
|
|
A howto [here](https://www.simplified.guide/ssh/copy-public-key).
|
|
A howto [here](https://www.simplified.guide/ssh/copy-public-key).
|
... | @@ -159,7 +212,7 @@ Then we import the old list, the archives, and we do an index update: |
... | @@ -159,7 +212,7 @@ Then we import the old list, the archives, and we do an index update: |
|
```
|
|
```
|
|
(venv) $ mailman import21 foo-list@<new-lists-domain> ~/tmp/lists/foo-list/config.pck
|
|
(venv) $ mailman import21 foo-list@<new-lists-domain> ~/tmp/lists/foo-list/config.pck
|
|
(venv) $ python manage.py hyperkitty_import -l foo-list@<new-lists-domain> ~/tmp/archives/private/<list>.mbox/<list>.mbox
|
|
(venv) $ python manage.py hyperkitty_import -l foo-list@<new-lists-domain> ~/tmp/archives/private/<list>.mbox/<list>.mbox
|
|
<venv) $ mailman-web update_index_one_list foo-list@<new-lists-domain>
|
|
(venv) $ mailman-web update_index_one_list foo-list@<new-lists-domain>
|
|
```
|
|
```
|
|
Ref: https://docs.mailman3.org/en/latest/migration.html#upgrade-strategy
|
|
Ref: https://docs.mailman3.org/en/latest/migration.html#upgrade-strategy
|
|
|
|
|
... | @@ -169,7 +222,7 @@ Old members of the migrated list, would need to create new accounts via this web |
... | @@ -169,7 +222,7 @@ Old members of the migrated list, would need to create new accounts via this web |
|
|
|
|
|
Ref: https://docs.mailman3.org/en/latest/userguide.html#making-a-mailman-account
|
|
Ref: https://docs.mailman3.org/en/latest/userguide.html#making-a-mailman-account
|
|
|
|
|
|
The admin of mailman3 has to create a superuser as a mailman user:
|
|
The admin of mailman3 has to create a superuser as a mailman user (if you haven't done it already):
|
|
|
|
|
|
`(venv) $ mailman-web createsuperuser`
|
|
`(venv) $ mailman-web createsuperuser`
|
|
|
|
|
... | | ... | |