diff --git a/install.sh b/install.sh index 42f962d..7eaa076 100644 --- a/install.sh +++ b/install.sh @@ -156,22 +156,29 @@ chown root:dovecot /etc/dovecot/users chmod 640 /etc/dovecot/users cat > /etc/dovecot/dovecot.conf << DOVECOT +dovecot_config_version = 2.4.0 +dovecot_storage_version = 2.4.0 + protocols = imap listen = * -mail_location = maildir:/var/mail/vhosts/%d/%n/Maildir +mail_location = maildir:/var/mail/vhosts/%{domain}/%{username}/Maildir mail_privileged_group = vmail auth_mechanisms = plain login +auth_allow_cleartext = yes -passdb { - driver = passwd-file - args = scheme=SHA512-CRYPT /etc/dovecot/users +passdb passwd-file { + default_password_scheme = SHA512-CRYPT + passwd_file_path = /etc/dovecot/users } -userdb { - driver = static - args = uid=vmail gid=vmail home=/var/mail/vhosts/%d/%n +userdb static { + fields { + uid = vmail + gid = vmail + home = /var/mail/vhosts/%{domain}/%{username} + } } service imap-login { diff --git a/scripts/apply_config.sh b/scripts/apply_config.sh index 5145b3e..d013926 100644 --- a/scripts/apply_config.sh +++ b/scripts/apply_config.sh @@ -75,45 +75,45 @@ anvil unix - - y - 1 anvil scache unix - - y - 1 scache MASTER -# --- Dovecot --- -cat > /etc/dovecot/conf.d/10-mail.conf << DOVECOT -mail_location = maildir:/var/mail/vhosts/%d/%n/Maildir +# --- Dovecot 2.4 (format unifié) --- +cat > /etc/dovecot/dovecot.conf << DOVECOT +dovecot_config_version = 2.4.0 +dovecot_storage_version = 2.4.0 + +protocols = imap +listen = * + +mail_location = maildir:/var/mail/vhosts/%{domain}/%{username}/Maildir mail_privileged_group = vmail -DOVECOT -cat > /etc/dovecot/conf.d/10-auth.conf << DOVECOTAUTH auth_mechanisms = plain login -!include auth-passwdfile.conf.ext -DOVECOTAUTH +auth_allow_cleartext = yes -cat > /etc/dovecot/conf.d/auth-passwdfile.conf.ext << PASSFILE -passdb { - driver = passwd-file - args = scheme=SHA512-CRYPT /etc/dovecot/users +passdb passwd-file { + default_password_scheme = SHA512-CRYPT + passwd_file_path = /etc/dovecot/users +} + +userdb static { + fields { + uid = vmail + gid = vmail + home = /var/mail/vhosts/%{domain}/%{username} + } } -userdb { - driver = static - args = uid=vmail gid=vmail home=/var/mail/vhosts/%d/%n -} -PASSFILE -cat > /etc/dovecot/conf.d/10-master.conf << DOVMASTER service imap-login { inet_listener imap { port = ${IMAP_PORT} } inet_listener imaps { port = ${IMAPS_PORT} - ssl = yes } } -service auth { - unix_listener auth-userdb { - mode = 0600 - user = vmail - } -} -DOVMASTER + +log_path = /var/log/dovecot.log +info_log_path = /var/log/dovecot-info.log +DOVECOT # --- Samba workgroup --- sed -i "s/^\s*workgroup\s*=.*/ workgroup = ${WORKGROUP}/" /etc/samba/smb.conf