fix: config Dovecot 2.4 (dovecot_config_version + nouvelle syntaxe passdb/userdb)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Jules
2026-05-05 11:33:08 +02:00
parent d36780a725
commit 35977ac7f9
2 changed files with 39 additions and 32 deletions

View File

@@ -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