1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
Create discussion lists with Public Cloud
This guide explains how to set up a discussion list system with your Mail Service, thanks to Mailman and to Public Cloud Infomaniak!
⚠This guide is intended exclusively for a public with a high level of technical competence. No liability is assumed for damages or losses - save your data before any manipulation. For additional assistance contact a partner or launch a call for tenders free of charge — discover also the role of the host.
Preamble
- Mailman is a free application to manage mailing lists, chat lists and newsletters.
- These files are prepared so you can easily set up Mailman.
- The deployment of the server and its firewall is done with TerraForm, Infrastructure as a Code (IaaC) tool and the configuration of the server with Ansible.
- The software allows you to create discussion lists for your different contacts (direction@, ecommerce@...).
Preparation...
... of your environment
- To be in possession of a Mail Service Infomaniak to make this tutorial.
- Mailman deployment files on Public Cloud can be downloaded on this github Infomaniak.
... from the Environment Mail
- Create an address
mailman@domain.xyz
(aid) and carefully store the created password (it will be used in the server configuration). - Add the following aliases (aid):
- postorius
- mylist
- mylist-bounces
- mylist-confirm
- mylist-join
- mylist-leave
- mylist-owner
- mylist-request
- mylist-subscribe
- mylist-unsubscribe
Your Mail environment is ready for deployment!
...of the Public Cloud
- First, create a Public Cloud project and 1 user (aid)
- Beware of the Public Cloud password, a 2FA authentication on your Infomaniak account is highly recommended.
- Click here to access the Openstack dashboard and inform the
PCU-XXXXXX
with the password defined previously. - Download your file
openrc
, it allows you to identify yourself as an administrator of your environment from the command line; it contains information such as the data center where your machines, your login, password, etc. are located.
You now have the file you can use to connect to the Openstack administration.
...of the instance
To make your future instance accessible on its different communication ports (SSH & HTTP & HTTPS), create a security group to assign a rule group to a machine with the following command:
openstack security group create —description "Port 22 - 80 - 443 pour Mailman" mailman-sec
Add Rules to the safety group: mailman-sec
openstack security group rule create --dst-port 80 --protocol TCP mailman-secopenstack security group rule create --dst-port 443 --protocol TCP mailman-secopenstack security group rule create --dst-port 22 --protocol TCP mailman-sec
You can perform all of these commands in graphical ways from the Horizon dashboard https://api.pub1.infomaniak.cloud/horizon/auth/login/ in the tab Network -> Security Group (be aware of the cloud documentation on this subject).
Deploy the instance that will contain MailMan. For command line use you can use the following command:
openstack server create --flavor a1-ram2-disk20-perf1 --security-group mailman-sec --network ext-net1 --key-name <votre-clé> --image "Debian 11.5 bullseye" mailman3
Once you are connected to the machine, update it:
sudo apt update && sudo apt upgrade -y
Install the openstack client:
sudo apt install python3-openstackclient -y
Installation of Ansible (allowing automatic e-mailman deployment):
sudo apt install ansible -y
Mailman deployment
In order to deploy Mailman to the machine, import the SSH key and your OpenRC file via SFTP into the machine running the Ansible configuration.
Use software/clients such as putty, termius, mobaxterm... (any tool that manages the SSH / SFTP) to make the import easily, you only need to provide the following information to connect to the machine:
- IP of the previously created machine
- port:
22
- SSH key created previously: import file
.pem
- user:
debian
In this guide, the software Termius was used to move SFTP files on the machine.
Download the folder containing the installation files:
wget https://github.com/reneluria/mailman-cloud
Now you have to move the SSH key and the PCP file to the downloaded folder:
mv cle.pem mailman/mv PCP-XXXX.sh mailman/
Move to file:
cd mailman/
Definition of right 600 on the key to protect and enforce it:
sudo chmod 600 tf-keypair.pem
Create an inventory file to set parameters: SMTP, Domain...
nano inventory
The following template should be provided in this file by changing the lines commented on by your environment variables:
mailman ansible_host
= Public IP of the VM Target
mailman ansible_host=xxx.xxx.xxx.xxx
[all:vars]
ansible_python_interpreter=/usr/bin/python3
ansible_user=debian
ansible_ssh_private_key_file=id_tf_keypair
fqdn=mailman.<yourdomain>
mail_host=mail.infomaniak.com
mail_account=mailman@<yourdomain>
mail_password=<email_password>
mailman_user=mailman
mailman_password==<interface_password>
mailman_domain=parano.ch
mailman_email=<your_email>
Run the command ctrl + s
then ctrl + c
To leave Nano.
Always placed in the mailman directory, run the script with ansible:
ansible-playbook playbook.yml -D
Mailman is now deployed to your IP address: X.X.X.X/mailman3
Log in
Log in on mailman with the identifiers provided in the file inventory
higher to then:
- > Create a domain -> create my "malistic" list
In the parameter list, modify:
- DMARC mitigations: it is recommended to use "Replace from the list address"
- Edit Messages: it is recommended to use "Reply to the list" and "Reply to the first band"