From 80a4ac21565887b86cf919f71ad52ce750aaa4a4 Mon Sep 17 00:00:00 2001 From: Quentin Legot Date: Thu, 5 Oct 2023 16:26:51 +0200 Subject: [PATCH] Add postfix and dovecot dockerfiles, added dovecot deployment (in dev) --- dockerfiles/dovecot/Dockerfile | 18 +++++++++++ dockerfiles/dovecot/dovecot.conf | 48 ++++++++++++++++++++++++++++ dockerfiles/dovecot/password_file | 2 ++ dockerfiles/postfix/Dockerfile | 14 +++++++++ dockerfiles/postfix/main.cf | 14 +++++++++ dockerfiles/postfix/startup.sh | 8 +++++ dockerfiles/postfix/virtual | 1 + kustomize/dovecat-deployment.yaml | 20 ------------ kustomize/dovecat-svc.yaml | 0 kustomize/dovecat-volume.yaml | 0 kustomize/dovecot-deployment.yaml | 52 +++++++++++++++++++++++++++++++ kustomize/dovecot-svc.yaml | 24 ++++++++++++++ kustomize/dovecot-volume.yaml | 12 +++++++ kustomize/kustomization.yaml | 6 ++-- 14 files changed, 196 insertions(+), 23 deletions(-) create mode 100644 dockerfiles/dovecot/Dockerfile create mode 100644 dockerfiles/dovecot/dovecot.conf create mode 100644 dockerfiles/dovecot/password_file create mode 100644 dockerfiles/postfix/Dockerfile create mode 100644 dockerfiles/postfix/main.cf create mode 100644 dockerfiles/postfix/startup.sh create mode 100644 dockerfiles/postfix/virtual delete mode 100644 kustomize/dovecat-deployment.yaml delete mode 100644 kustomize/dovecat-svc.yaml delete mode 100644 kustomize/dovecat-volume.yaml create mode 100644 kustomize/dovecot-deployment.yaml create mode 100644 kustomize/dovecot-svc.yaml create mode 100644 kustomize/dovecot-volume.yaml diff --git a/dockerfiles/dovecot/Dockerfile b/dockerfiles/dovecot/Dockerfile new file mode 100644 index 0000000..2141e52 --- /dev/null +++ b/dockerfiles/dovecot/Dockerfile @@ -0,0 +1,18 @@ +FROM alpine:latest + +RUN apk --no-cache add dovecot dovecot-lmtpd dovecot-submissiond bash + +# RUN wget https://github.com/dovecot/docker/blob/main/2.3.21/dovecot.gpg +# RUN cp dovecot.gpg /etc/apt/keyrings/dovecot.gpg + +# RUN wget https://github.com/dovecot/docker/blob/main/2.3.21/dovecot.list +# RUN cp dovecot.list /etc/apt/sources.list.d + +COPY password_file /etc/dovecot/secrets/dovecot_password.file +COPY dovecot.conf /etc/dovecot/dovecot.conf + +EXPOSE 24 +EXPOSE 143 +EXPOSE 993 + +CMD [ "dovecot", "-F" ] \ No newline at end of file diff --git a/dockerfiles/dovecot/dovecot.conf b/dockerfiles/dovecot/dovecot.conf new file mode 100644 index 0000000..ef59f46 --- /dev/null +++ b/dockerfiles/dovecot/dovecot.conf @@ -0,0 +1,48 @@ +## You should mount /etc/dovecot if you want to +## manage this file + +mail_home=/srv/mail/%Lu +mail_location=sdbox:~/Mail +mail_uid=1000 +mail_gid=10000 + +protocols = imap submission lmtp + +first_valid_uid = 1000 +last_valid_uid = 10000 + +# authentication via passwd-file, see https://doc.dovecot.org/configuration_manual/authentication/passwd_file/#authentication-passwd-file +passdb { + driver = passwd-file + args = /etc/dovecot/secrets/dovecot_password_file +} + +# post-login user lookup database, see https://doc.dovecot.org/configuration_manual/authentication/user_databases_userdb/#authentication-user-database +userdb { + driver = passwd-file + args = /etc/dovecot/secrets/dovecot_password_file + default_fields = home=/home/%u +} + +ssl=no +# ssl_cert=