]> SAFE projects GIT repository - jmp/mailleur/commitdiff
dovecot, authentication with digest-md5 working with postgresql
authorJean-Marc Pigeon (Delson) <jmp@safe.ca>
Wed, 9 Jul 2025 21:51:25 +0000 (17:51 -0400)
committerJean-Marc Pigeon (Delson) <jmp@safe.ca>
Wed, 9 Jul 2025 21:51:25 +0000 (17:51 -0400)
conf/dovecot/dovecot.conf
data-feed/feed01.tst
support/addconfig.sh

index 9906acb8ef588b8403678c53f908147522d15ca8..949c018ad367e520274dd0441d7bea2d859e5788 100644 (file)
@@ -10,10 +10,14 @@ first_valid_gid=12
 
 #--------------------------------------------------------------------------
 #debug level
-mail_debug=no
-auth_debug=no
-auth_verbose=yes
-auth_debug_passwords=yes
+auth_debug = yes
+auth_debug_passwords = yes
+#auth_mechanisms = plain login digest-md5
+auth_mechanisms = digest-md5
+auth_verbose = yes
+auth_verbose_passwords = plain
+mail_uid = mailleur
+mail_debug = yes
 log_path=/var/log/dovecot.log
 
 #--------------------------------------------------------------------------
@@ -43,14 +47,9 @@ service pop3-login   {
 #--------------------------------------------------------------------------
 #email repository
 mail_location=maildir:/var/spool/mailleur/mails/%d/%n
+#Cautions THIS realm value is HARDCODED within code AND database
+auth_realms = mailleur-email
 
-auth_debug = yes
-auth_debug_passwords = yes
-auth_mechanisms = plain login
-auth_verbose = yes
-auth_verbose_passwords = plain
-mail_uid = mailleur
-mail_debug = yes
 #--------------------------------------------------------------------------
 #email authentication
 #
index cc4badb9d0360ea953d75462bb5001f62a3e0b12..5ff901a3182245aba003a90a1130de982abf3374 100644 (file)
@@ -5,18 +5,18 @@ R:220 mailleur.example.com, ESMTP (cleartext) mailleur...
 S:EHLO example.com
 #R:250-mailleur.example.com, link (cleartext) ready, your IP/FQDN=[127.127.0.2/feed2.example.com]
 R:250-mailleur.example.com, link (cleartext) ready,...
-R:250-SIZE 52428800
 R:250-STARTTLS
+R:250-AUTH DIGEST-MD5
+R:250-SIZE 52428800
 R:250-8BITMIME
-R:250-ENHANCEDSTATUSCODES
-R:250 AUTH PLAIN LOGIN
+R:250 ENHANCEDSTATUSCODES
 C:GOTLS
 S:EHLO example.com
 R:250-mailleur.example.com, link (crypted) ready,...
+R:250-AUTH PLAIN LOGIN DIGEST-MD5
 R:250-SIZE 52428800
 R:250-8BITMIME
-R:250-ENHANCEDSTATUSCODES
-R:250 AUTH PLAIN LOGIN
+R:250 ENHANCEDSTATUSCODES
 S:MAIL FROM: <postmaster@example.com>
 R:250 2.1.3 postmaster@example.com.. sender ok
 S:RCPT TO: <user1@mailref1.example.com>
index 44f4fcbab96361362d32a5290a2ae552e29ba830..a798215401afa1dbe105ec2f27407b8fdd117a59 100755 (executable)
@@ -25,17 +25,19 @@ echo "#"`date`
 case "$DB_TYPE" in
    "POSTGRESQL"                )
       echo "driver = pgsql"
+      echo "default_pass_scheme = digest-md5"
       echo "connect=  dbname=$APPNAME"
-      echo "password_query=SELECT password FROM emails WHERE email='%u'"
+      echo "password_query=SELECT hash as password FROM emails WHERE email='%u'"
       echo "user_query=SELECT 'mailleur' AS uid,'mail' AS gid,'$SPOOLDIR/%d/%n' AS home,'maildir:~' AS mail,'*:storage='||mxspace||'M' AS quota_rule FROM emails WHERE email='%u'"
 
       ;;
    "MYSQL"             )
       echo "driver = mysql"
+      echo "default_pass_scheme = digest-md5"
       echo "connect= host=localhost dbname=$APPNAME"
-      echo "password_query=SELECT password FROM emails WHERE email='%u'"
+      echo "password_query=SELECT hash as password FROM emails WHERE email='%u'"
       echo "user_query=SELECT 'mailleur' AS uid,'mail' AS gid,'$SPOOLDIR/%d/%n' AS home,'maildir:~' AS mail,concat('*:storage=',mxspace,'M') AS quota_rule from emails WHERE email='%u'"
       ;;
     esac
-) >> /etc/$APPNAME/dovecot/dovecot-sql.conf
+) >> /etc/$APPNAME/dovecot/dovecot-sql.conf 2>&1