Installer MailCow sur le serveur de mails
VERIFIER UN CERTAIN NOMBRE DE CHOSES
1) il ne faut pas que POSTFIX soit déjà installé.
apt remove postfix
2) il faut installer un certain nombre de composants logiciels
apt install curl git apt-transport-https
ca-certificates gnupg2
software-properties-common -y
INSTALLER MAILCOW PROPREMENT DIT
3) Télécharger DOCKER
curl -fsSL https://download.docker.com/linux/ubuntu/gpg |
gpg --dearmor -o
/usr/share/keyrings/docker-archive-keyring.gpg
4) Y ajouter le repository qui contiendra MailCow
echo "deb [arch=$(dpkg --print-architecture)
signed-by=/usr/share/keyrings/docker-archive-keyring.gpg]
https://download.docker.com/linux/ubuntu
$(lsb_release -cs) stable" |
tee /etc/apt/sources.list.d/docker.list
5) Mettre à jour le système
apt update
6) Installer Docker
apt install docker-ce docker-ce-cli -y
7) Installer Docker Compose
curl -L
https://github.com/docker/compose/releases/download/$(curl -Ls https://www.servercow.de/docker-compose/latest.php)/docker-compose-$(uname -s)-$(uname -m) > /usr/local/bin/docker-compose
8) Préparer l’installation
chmod +x /usr/local/bin/docker-compose
cd /opt
git clone https://github.com/mailcow/mailcow-dockerized
cd mailcow-dockerized
9) Créer le fichier de configuration
- ./generate_config.sh
entrer successivement :
- le domaine : « mail.mafamille.fr »
- UTC
- 1
10) Le customiser
docker-compose pull
docker-compose up -d
11) Pour finir, ouvrir le fichier des redirections et y ajouter le code ci-contre
nano data/conf/nginx/redirect.conf
server {
root /web;
listen 80 default_server;
listen [::]:80 default_server;
include /etc/nginx/conf.d/server_name.active;
if ( $request_uri ~* « %0A|%0D » ) {
return 403;
}
location ^~ /.well-known/acme-challenge/ {
allow all;
default_type « text/plain »;
}
location / {
return 301 https://$host$uri$is_args$args;
}
}
12) redémarre mginx-mailcow
docker-compose restart nginx-mailcow
PETIT TEST :
A ce stade, deux petits tests ne peuvent pas nuire :
- lancer votre navigateur internet favori et entrez « 192.168.0.4 » dans la barre d’adresse.
- Si la réponse est correcte, c’est que MailCow a bien été initialisé
- Recommencez avec « mail.mafamille.fr » (ou votre adresse :))
- Si la réponse est correcte, ceci signifie que le renvoi depuis votre serveur Web fonctionne.
- Toute ceci est de bon augure pour passer à la suite