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