From 844fb2e9cb23b3b33f1b4c23fcc2c819248366ff Mon Sep 17 00:00:00 2001
From: Thomas Picouet <thomas.picouet@riseup.net>
Date: Mon, 22 Oct 2018 23:12:20 +0200
Subject: [PATCH] [A JOUR] fichiers de config pour authentification LDAP

---
 pica-mail-mda/auth_LDAP/10-mail.conf  |  4 ++--
 pica-mail-mda/auth_LDAP/Dockerfile    |  7 +++----
 pica-mail-mda/auth_LDAP/entrypoint.sh | 28 ++++-----------------------
 3 files changed, 9 insertions(+), 30 deletions(-)

diff --git a/pica-mail-mda/auth_LDAP/10-mail.conf b/pica-mail-mda/auth_LDAP/10-mail.conf
index 56df2dd0..bdfdd4ed 100644
--- a/pica-mail-mda/auth_LDAP/10-mail.conf
+++ b/pica-mail-mda/auth_LDAP/10-mail.conf
@@ -1,5 +1,5 @@
 #dovecot 10-mail.conf default file modified in order set mail storage format and mail storage location
-#all Pica alterations are commented with a #pica label
+#all Pica alterations are commented with a #/!\pica label
 
 ##
 ## Mailbox locations and namespaces
@@ -30,7 +30,7 @@
 #
 # <doc/wiki/MailLocation.txt>
 #
-#pica: set mail storage format and location in line with virtual users
+#/!\pica: set mail storage format and location in line with virtual users
 mail_home = /var/vmail/%u
 mail_location = maildir:~/mail
 
diff --git a/pica-mail-mda/auth_LDAP/Dockerfile b/pica-mail-mda/auth_LDAP/Dockerfile
index 32246ac4..ceaaa756 100644
--- a/pica-mail-mda/auth_LDAP/Dockerfile
+++ b/pica-mail-mda/auth_LDAP/Dockerfile
@@ -8,15 +8,14 @@ ENV DEBIAN_FRONTEND noninteractive
 #installation des paquets debian
 RUN apt-get update -y \
   && apt-get install -y \
-      dovecot-common dovecot-imapd dovecot-lmtpd \
+      dovecot-common dovecot-imapd dovecot-lmtpd nano \
   && rm -rf /var/lib/apt/lists/*
 
 
 #configuration de dovecot
 #adresse ip locale du lda (serveur qui réceptionne les courriers de fin de chaîne de postfix)
 
-COPY ./dovecot-conf/10-master.conf /etc/dovecot/conf.d/10-master.conf
 COPY ./dovecot-conf/10-mail.conf /etc/dovecot/conf.d/10-mail.conf
-COPY entrypoint_test.sh /
+COPY entrypoint.sh /
 
-ENTRYPOINT ["/entrypoint_test.sh"]
+ENTRYPOINT ["/entrypoint.sh"]
diff --git a/pica-mail-mda/auth_LDAP/entrypoint.sh b/pica-mail-mda/auth_LDAP/entrypoint.sh
index 398528ce..360eca39 100755
--- a/pica-mail-mda/auth_LDAP/entrypoint.sh
+++ b/pica-mail-mda/auth_LDAP/entrypoint.sh
@@ -6,27 +6,6 @@ cat <<EOF >> /etc/dovecot/dovecot.conf
 protocols = imap lmtp
 EOF
 
-#définition de l'emplacement des mails
-cat <<EOF >> /etc/dovecot/conf.d/10-master.conf
-mail_home = /var/vmail/%d/%n
-mail_location = maildir:~/mail
-EOF
-
-# enable plaintest authentication for now.
-cat <<EOF >> /etc/dovecot/conf.d/10-auth.conf
-disable_plaintext_auth = no
-auth_verbose = yes
-auth_mechanisms = plain
-passdb {
-  driver = passwd-file
-  args = /etc/dovecot/passwd
-}
-userdb {
-  driver = static
-  args = uid=vmail gid=vmail home=/home/vmail/%u
-}
-EOF
-
 #définition de l'emplacement des logs
 cat <<EOF >> /etc/dovecot/dovecot.conf
 log_path = /var/log/dovecot.log
@@ -46,9 +25,10 @@ service lmtp {
 }
 EOF
 
-#ajouter utilisateur et groupe vmail
-#ajouter les fichiers de logs
-adduser --disabled-password vmail
+#ajouter utilisateur et groupe vmail avec password demandé à la première connexion
+adduser --disabled-login vmail
+
+#log écrites par vmail
 touch /var/log/dovecot.log /var/log/dovecot-info.log
 chown vmail:vmail var/log/dovecot.log /var/log/dovecot-info/log
 
-- 
GitLab