Palier 3: Postfix + Dovecot working! Mail test successful with swaks
This commit is contained in:
parent
a6d7c44c4a
commit
4a989bad17
7 changed files with 82 additions and 55 deletions
|
|
@ -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"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue