feat: ajout Dovecot avec authentification PostgreSQL (base esymail)
Architecture :
- Base de données esymail sur PostgreSQL existant, table mailbox
(email, password BLF-CRYPT, domain, quota_mb, is_active, timestamps)
- Dovecot auth via dovecot-sql.conf : passdb + userdb en SQL
- Stockage mails en Maildir /var/mail/vhosts/%d/%n
- UID/GID 1000 (vmail) pour les fichiers mail
- Socket auth Postfix pour SASL (/var/spool/postfix/private/auth)
Fichiers :
- docker/dovecot/Dockerfile : dovecot/dovecot + dovecot-pgsql, user vmail
- docker/dovecot/dovecot.conf : protocols imap/pop3, auth SQL, logging
- docker/dovecot/dovecot-sql.conf : connexion PostgreSQL, queries
password_query/user_query/iterate_query sur table mailbox
- docker/dovecot/init-esymail.sql : CREATE DATABASE esymail, CREATE TABLE
mailbox avec index, compte test test@siteconseil.fr/test1234
Docker :
- Service dovecot sans port exposé (interne uniquement)
- Volumes dovecot-mail (Maildir) et dovecot-logs (partagé avec fail2ban)
- Dépend de database (healthcheck)
- init-esymail.sql monté dans /docker-entrypoint-initdb.d/ de PostgreSQL
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 16:44:45 +02:00
|
|
|
## Dovecot - Auth SQL via PostgreSQL
|
|
|
|
|
## Base: esymail | Table: mailbox
|
|
|
|
|
|
|
|
|
|
protocols = imap pop3
|
|
|
|
|
|
|
|
|
|
listen = *
|
|
|
|
|
|
|
|
|
|
# Logging
|
|
|
|
|
log_path = /var/log/dovecot/dovecot.log
|
|
|
|
|
info_log_path = /var/log/dovecot/dovecot-info.log
|
|
|
|
|
auth_verbose = yes
|
|
|
|
|
auth_debug = no
|
|
|
|
|
|
|
|
|
|
# Mail location (un dossier par utilisateur)
|
|
|
|
|
mail_location = maildir:/var/mail/vhosts/%d/%n
|
|
|
|
|
|
|
|
|
|
# Namespace INBOX
|
|
|
|
|
namespace inbox {
|
|
|
|
|
inbox = yes
|
|
|
|
|
separator = /
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Auth via SQL
|
|
|
|
|
passdb {
|
|
|
|
|
driver = sql
|
|
|
|
|
args = /etc/dovecot/dovecot-sql.conf
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
userdb {
|
|
|
|
|
driver = sql
|
|
|
|
|
args = /etc/dovecot/dovecot-sql.conf
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# UID/GID pour vmail
|
|
|
|
|
mail_uid = 1000
|
|
|
|
|
mail_gid = 1000
|
|
|
|
|
first_valid_uid = 1000
|
|
|
|
|
last_valid_uid = 1000
|
|
|
|
|
|
|
|
|
|
# SSL (desactive en dev, TLS via reverse proxy en prod)
|
|
|
|
|
ssl = no
|
|
|
|
|
|
|
|
|
|
# Service IMAP
|
|
|
|
|
service imap-login {
|
|
|
|
|
inet_listener imap {
|
|
|
|
|
port = 143
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Service POP3
|
|
|
|
|
service pop3-login {
|
|
|
|
|
inet_listener pop3 {
|
|
|
|
|
port = 110
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-03 23:14:11 +02:00
|
|
|
# Auth TCP pour Postfix SASL (entre containers Docker)
|
feat: ajout Dovecot avec authentification PostgreSQL (base esymail)
Architecture :
- Base de données esymail sur PostgreSQL existant, table mailbox
(email, password BLF-CRYPT, domain, quota_mb, is_active, timestamps)
- Dovecot auth via dovecot-sql.conf : passdb + userdb en SQL
- Stockage mails en Maildir /var/mail/vhosts/%d/%n
- UID/GID 1000 (vmail) pour les fichiers mail
- Socket auth Postfix pour SASL (/var/spool/postfix/private/auth)
Fichiers :
- docker/dovecot/Dockerfile : dovecot/dovecot + dovecot-pgsql, user vmail
- docker/dovecot/dovecot.conf : protocols imap/pop3, auth SQL, logging
- docker/dovecot/dovecot-sql.conf : connexion PostgreSQL, queries
password_query/user_query/iterate_query sur table mailbox
- docker/dovecot/init-esymail.sql : CREATE DATABASE esymail, CREATE TABLE
mailbox avec index, compte test test@siteconseil.fr/test1234
Docker :
- Service dovecot sans port exposé (interne uniquement)
- Volumes dovecot-mail (Maildir) et dovecot-logs (partagé avec fail2ban)
- Dépend de database (healthcheck)
- init-esymail.sql monté dans /docker-entrypoint-initdb.d/ de PostgreSQL
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 16:44:45 +02:00
|
|
|
service auth {
|
2026-04-03 23:14:11 +02:00
|
|
|
inet_listener {
|
|
|
|
|
port = 12345
|
feat: ajout Dovecot avec authentification PostgreSQL (base esymail)
Architecture :
- Base de données esymail sur PostgreSQL existant, table mailbox
(email, password BLF-CRYPT, domain, quota_mb, is_active, timestamps)
- Dovecot auth via dovecot-sql.conf : passdb + userdb en SQL
- Stockage mails en Maildir /var/mail/vhosts/%d/%n
- UID/GID 1000 (vmail) pour les fichiers mail
- Socket auth Postfix pour SASL (/var/spool/postfix/private/auth)
Fichiers :
- docker/dovecot/Dockerfile : dovecot/dovecot + dovecot-pgsql, user vmail
- docker/dovecot/dovecot.conf : protocols imap/pop3, auth SQL, logging
- docker/dovecot/dovecot-sql.conf : connexion PostgreSQL, queries
password_query/user_query/iterate_query sur table mailbox
- docker/dovecot/init-esymail.sql : CREATE DATABASE esymail, CREATE TABLE
mailbox avec index, compte test test@siteconseil.fr/test1234
Docker :
- Service dovecot sans port exposé (interne uniquement)
- Volumes dovecot-mail (Maildir) et dovecot-logs (partagé avec fail2ban)
- Dépend de database (healthcheck)
- init-esymail.sql monté dans /docker-entrypoint-initdb.d/ de PostgreSQL
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 16:44:45 +02:00
|
|
|
}
|
|
|
|
|
}
|