From: Jean-Marc Pigeon Date: Thu, 13 Nov 2025 21:03:20 +0000 (-0500) Subject: Adding dovecot configuration file X-Git-Tag: tag-0.17~38 X-Git-Url: https://jmp-git.ovh.safe.ca/?a=commitdiff_plain;h=e0123acb8ccf915c6dba3123e6e3c6dff05596f8;p=jmp%2Fmailleur Adding dovecot configuration file --- diff --git a/.gitignore b/.gitignore index a0a5224..18e6359 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,8 @@ data-sender/ data-sorter/ data-sorter2/ *.swp -*.d +lib/*.d +app/*.d bin shared/ lib/numver.h diff --git a/dovecot/conf.d/70-mailleur-mysql.conf b/dovecot/conf.d/70-mailleur-mysql.conf new file mode 100644 index 0000000..e25da10 --- /dev/null +++ b/dovecot/conf.d/70-mailleur-mysql.conf @@ -0,0 +1,11 @@ +# ------------------------------- +# 71-mysql-conf +# Configuration Dovecot to use Mariadb server +# ------------------------------- +sql_driver = mysql + +mysql remote { + host = localhost.localdomain + user = clement + dbname = clement + } diff --git a/dovecot/conf.d/70-mailleur-pgsql.conf b/dovecot/conf.d/70-mailleur-pgsql.conf new file mode 100644 index 0000000..5cbcf3f --- /dev/null +++ b/dovecot/conf.d/70-mailleur-pgsql.conf @@ -0,0 +1,14 @@ +# ------------------------------- +# 70-pgsql.conf +# Configuration Dovecot to use PostgreSQL server +# ------------------------------- +sql_driver = pgsql + + +pgsql remote { + parameters { + host = localhost.localdomain + user = clement + dbname = clement + } + } diff --git a/dovecot/conf.d/80-mailleur-usesql.conf b/dovecot/conf.d/80-mailleur-usesql.conf new file mode 100644 index 0000000..472be09 --- /dev/null +++ b/dovecot/conf.d/80-mailleur-usesql.conf @@ -0,0 +1,24 @@ +# ------------------------------- +# 80-usesql.conf +# Configuration Dovecot to use SQL database +# ------------------------------- +# --- Passdb : authentication via SQL --- +passdb sql { + default_password_scheme = SHA512-CRYPT + query = SELECT password FROM users WHERE username='%{user}'; + } + +# --- Userdb : user data(home, uid, gid) via SQL --- +# +# +# + +userdb sql { + query = SELECT 'clement' AS uid,'mail' AS gid, \ + '/var/spool/clement/mails/%{user | domain}/%{user | username}' \ + AS home, \ + 'maildir:~/dovecot' AS mail, \ + '*:storage='||mxmgbytes||'M' AS quota_rule FROM userprofile WHERE prfid=(SELECT prfid FROM users WHERE username='%{user}') + } + +