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>
14 lines
560 B
Plaintext
14 lines
560 B
Plaintext
driver = pgsql
|
|
connect = host=database dbname=esymail user=app password=secret
|
|
|
|
default_pass_scheme = BLF-CRYPT
|
|
|
|
# Auth: cherche email + password dans la table mailbox
|
|
password_query = SELECT email AS user, password FROM mailbox WHERE email = '%u' AND is_active = true
|
|
|
|
# Userdb: retourne les infos de stockage mail
|
|
user_query = SELECT '/var/mail/vhosts/%d/%n' AS home, 1000 AS uid, 1000 AS gid FROM mailbox WHERE email = '%u' AND is_active = true
|
|
|
|
# Iteration pour les operations batch
|
|
iterate_query = SELECT email AS user FROM mailbox WHERE is_active = true
|