Palier 3: Postfix + Dovecot working! Mail test successful with swaks

This commit is contained in:
ayo 2026-06-17 09:54:03 +02:00
commit 4a989bad17
7 changed files with 82 additions and 55 deletions

View file

@ -1,22 +1,17 @@
# Image de base Alpine
FROM alpine:3.21
FROM debian:bookworm-slim
# Installer Dovecot (IMAP/POP3) + le module d'authentification
RUN apk add --no-cache dovecot
RUN apt-get update && apt-get install -y dovecot-core dovecot-imapd
# --- Utilisateur vmail identique à celui de Postfix (uid/gid 5000) ---
RUN (deluser vmail 2>/dev/null || true) \
&& (delgroup vmail 2>/dev/null || true) \
&& addgroup -g 5000 vmail \
&& adduser -D -u 5000 -G vmail -h /var/mail/vhosts vmail \
&& mkdir -p /var/mail/vhosts
RUN mkdir -p /var/mail/vhosts && \
useradd -m -u 5000 -d /var/mail/vhosts vmail || true
# --- Copier nos fichiers de config dans l'image ---
COPY dovecot.conf /etc/dovecot/dovecot.conf
COPY users /etc/dovecot/users
COPY ../share/users.txt /tmp/users.txt
COPY ../share/dovecot.sh /tmp/dovecot.sh
RUN chmod +x /tmp/dovecot.sh && \
/tmp/dovecot.sh > /etc/dovecot/users && \
rm /tmp/users.txt /tmp/dovecot.sh
# Exposer les ports IMAP
EXPOSE 143 993
# Lancer Dovecot au premier plan
CMD ["dovecot", "-F"]