From 4f7b9322ad23f0cfe0d1aa830e317db109430ee6 Mon Sep 17 00:00:00 2001 From: ayo Date: Fri, 19 Jun 2026 09:50:22 +0200 Subject: [PATCH] Ajouter README avec instructions d'installation --- .gitignore | 1 + README.md | 63 ++++++++++++++++++++++++++++++++++++++++++++++ docker-compose.yml | 14 +++++++---- dovecot/users | 2 -- hosts | 3 +++ 5 files changed, 76 insertions(+), 7 deletions(-) create mode 100644 README.md delete mode 100644 dovecot/users create mode 100644 hosts diff --git a/.gitignore b/.gitignore index 7d21963..4932d30 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ vmail/ *.log +dovecot/users diff --git a/README.md b/README.md new file mode 100644 index 0000000..ed54ff6 --- /dev/null +++ b/README.md @@ -0,0 +1,63 @@ +# Mailstack - Serveur Mail Postfix + Dovecot + +## Installation sur Debian + +### 1. Installer les dépendances + +```bash +sudo apt update +sudo apt upgrade -y +sudo apt install -y podman podman-compose swaks git +``` + +### 2. Se connecter en tant qu'utilisateur non-root + +```bash +su - ayo +``` + +### 3. Cloner le projet + +```bash +git clone https://git.ayo.tokyo/jalwan/mail-files.git +cd mail-files +``` + +### 4. Créer le fichier hosts local + +```bash +cat > hosts << 'EOF' +127.0.0.1 localhost +127.0.0.1 mail.ayoinc.test ayoinc.test +::1 localhost +EOF +``` + +### 5. Lancer les conteneurs + +```bash +podman-compose up -d +``` + +### 6. Vérifier que tout tourne + +```bash +podman-compose ps +``` + +Devrait afficher : +mailstack-dovecot Up + +mailstack-postfix Up + +## 📧 Tester l'envoi de mail + +```bash +swaks --server localhost --port 1025 \ + --from alice@ayoinc.test \ + --to bob@ayoinc.test \ + --header "Subject: Test Mailstack" \ + --body "Bonjour, ceci est un test" +``` + +--- diff --git a/docker-compose.yml b/docker-compose.yml index 31a063a..d2290a5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,12 +5,14 @@ services: build: context: . dockerfile: dovecot/Dockerfile + image: mailstack_dovecot:latest container_name: mailstack-dovecot ports: - - "1143:143" # IMAP - - "1993:993" # IMAPS + - "1143:143" + - "1993:993" volumes: - vmail:/var/mail/vhosts + - ./hosts:/etc/hosts:ro networks: - mailstack @@ -18,13 +20,15 @@ services: build: context: . dockerfile: postfix/Dockerfile + image: mailstack_postfix:latest container_name: mailstack-postfix ports: - - "1025:25" # SMTP - - "1587:587" # SMTP + AUTH - - "1465:465" # SMTPS + - "1025:25" + - "1587:587" + - "1465:465" volumes: - vmail:/var/mail/vhosts + - ./hosts:/etc/hosts:ro networks: - mailstack depends_on: diff --git a/dovecot/users b/dovecot/users deleted file mode 100644 index 15f6820..0000000 --- a/dovecot/users +++ /dev/null @@ -1,2 +0,0 @@ -alice@ayoinc.test:{PLAIN}alice -bob@ayoinc.test:{PLAIN}bob diff --git a/hosts b/hosts new file mode 100644 index 0000000..e876320 --- /dev/null +++ b/hosts @@ -0,0 +1,3 @@ +127.0.0.1 localhost +127.0.0.1 mail.ayoinc.test ayoinc.test +::1 localhost