]> SAFE projects GIT repository - jmp/mailleur/commitdiff
Adding dovecot configuration file
authorJean-Marc Pigeon <jmp@safe.c>
Thu, 13 Nov 2025 21:03:20 +0000 (16:03 -0500)
committerJean-Marc Pigeon <jmp@safe.c>
Thu, 13 Nov 2025 21:03:20 +0000 (16:03 -0500)
.gitignore
dovecot/conf.d/70-mailleur-mysql.conf [new file with mode: 0644]
dovecot/conf.d/70-mailleur-pgsql.conf [new file with mode: 0644]
dovecot/conf.d/80-mailleur-usesql.conf [new file with mode: 0644]

index a0a52243be77796869708d16e7bb3c01a2e6d3fc..18e63591728fa3aec3e7dba62e28142da878cb94 100644 (file)
@@ -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 (file)
index 0000000..e25da10
--- /dev/null
@@ -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 (file)
index 0000000..5cbcf3f
--- /dev/null
@@ -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 (file)
index 0000000..472be09
--- /dev/null
@@ -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}')
+       }
+
+