]> SAFE projects GIT repository - jmp/mailleur/commitdiff
Working to add dovecot database capability
authorJean-Marc Pigeon (Delson) <jmp@safe.ca>
Thu, 26 Jun 2025 11:07:10 +0000 (07:07 -0400)
committerJean-Marc Pigeon (Delson) <jmp@safe.ca>
Thu, 26 Jun 2025 11:07:10 +0000 (07:07 -0400)
conf/dovecot/dovecot-2.0-auth-ldap.conf [new file with mode: 0644]
conf/dovecot/dovecot-2.0-auth-sql.conf [new file with mode: 0644]
conf/dovecot/dovecot-2.0.conf [new file with mode: 0644]
conf/dovecot/dovecot-2.0.conf.res [new file with mode: 0644]
support/starting.sh

diff --git a/conf/dovecot/dovecot-2.0-auth-ldap.conf b/conf/dovecot/dovecot-2.0-auth-ldap.conf
new file mode 100644 (file)
index 0000000..ba70a42
--- /dev/null
@@ -0,0 +1,11 @@
+#LDAP Authentication
+
+passdb {
+  driver = ldap
+  args = /etc/clement/dovecot-ldap.conf
+}
+
+userdb {
+  driver = ldap
+  args = /etc/clement/dovecot-ldap.conf
+}
diff --git a/conf/dovecot/dovecot-2.0-auth-sql.conf b/conf/dovecot/dovecot-2.0-auth-sql.conf
new file mode 100644 (file)
index 0000000..5d7a762
--- /dev/null
@@ -0,0 +1,11 @@
+#SQL Authentication
+
+passdb {
+  driver = sql
+  args = /etc/mailleur/dovecot/dovecot-sql.conf
+}
+
+userdb {
+  driver = sql
+  args = /etc/mailleur/dovecot/dovecot-sql.conf
+  }
diff --git a/conf/dovecot/dovecot-2.0.conf b/conf/dovecot/dovecot-2.0.conf
new file mode 100644 (file)
index 0000000..83b387e
--- /dev/null
@@ -0,0 +1,143 @@
+#      JMP Jul 25 2011 for dovecot 2.0
+#####################################################################  
+#User lower limit (at least user email)
+first_valid_uid=5
+first_valid_gid=12
+
+#--------------------------------------------------------------------  
+#Working user id
+mail_uid=mailleur
+mail_gid=mail
+
+#--------------------------------------------------------------------  
+#debug level
+mail_debug = no
+auth_debug = no
+auth_verbose = no
+auth_debug_passwords = no
+log_path = /var/log/dovecot.log
+
+#--------------------------------------------------------------------  
+#Certificate localisation
+ssl_cert=</etc/ssl/private/local_cert
+ssl_key=</etc/ssl/private/local_cert
+ssl_dh = </etc/ssl/private/local_dh
+
+protocols = imap pop3 sieve
+
+#to delay scanner site
+auth_failure_delay = 4 s
+
+#locking mode
+mbox_write_locks = fcntl
+
+#quota
+mail_plugins = quota
+
+#to allow email address with quote within dovecot
+auth_username_chars = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890.-_@'
+
+#####################################################################  
+##
+## IMAP specific settings
+##
+#####################################################################  
+service imap-login {
+  process_min_avail = 3
+  service_count = 1
+}
+
+service dict {
+  unix_listener dict {
+    mode = 0600
+    user = mailleur
+    group = mail
+  }
+}
+
+service imap {
+  executable = /usr/libexec/dovecot/imap
+  #mail_executable = /usr/bin/pibsmtp /usr/libexec/dovecot/imap
+}
+
+protocol imap {
+       mail_plugins = $mail_plugins quota imap_quota
+        imap_client_workarounds = 
+       }
+
+#####################################################################  
+##
+## POP3 specific settings
+##
+#####################################################################  
+service pop3-login {
+  process_min_avail = 3
+  service_count = 1
+}
+
+service pop3 {
+  executable = /usr/libexec/dovecot/pop3
+  #executable = /usr/bin/pibsmtp /usr/libexec/dovecot/pop3
+}
+
+protocol pop3 {
+       pop3_uidl_format = %08Xu%08Xv
+       pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
+       }
+
+service auth {
+  unix_listener auth-master {
+    mode = 0600
+    user = mailleur
+  }
+  unix_listener auth-userdb {
+    mode = 0600
+    user = mailleur
+  }
+}
+
+#####################################################################  
+##
+## Sieve
+##
+#####################################################################  
+protocol lda {
+       postmaster_address =  postmaster
+       mail_plugins = sieve quota
+       # remember to give proper permissions for those files as well
+       log_path = /var/log/dovecot.log
+       info_log_path = /var/log/dovecot.log
+       }
+
+protocol sieve {
+       mail_debug=yes
+       }
+
+plugin {
+       #Sieve Part
+       sieve = ~/.dovecot.sieve
+       sieve_dir=~/sieve
+        #folder part
+        autocreate = Trash
+        autosubscribe = Trash
+        autocreate2 = Spam
+        autosubscribe2 = Spam
+       #Quota Part under mailleur SQL
+       quota = dict:User quota::proxy::sqlquota
+       #Default value.
+        quota_rule = *:storage=5G:messages=0
+        #10% of Storage
+        quota_rule2 = Trash:storage=+100%%
+        # 20% of storage
+        quota_rule3 = Spam:storage=+20%%
+       }
+
+dict    {
+        sqlquota=dbsql:/etc/mailleur/dovecot/dovecot-dict-sql.conf.ext
+        }
+
+#####################################################################  
+##
+## User authentication
+##
+#####################################################################  
diff --git a/conf/dovecot/dovecot-2.0.conf.res b/conf/dovecot/dovecot-2.0.conf.res
new file mode 100644 (file)
index 0000000..7fff29b
--- /dev/null
@@ -0,0 +1,93 @@
+#done by JMP Jul 25 2011 for dovecot 2.0
+#----------------------------------
+ssl_cert = /etc/pki/clement-2.5/clement.pem
+ssl_keye = /etc/pki/clement-2.5/clement.pem
+
+protocols = imap pop3
+
+#to delay scanner site
+auth_failure_delay = 4
+
+service imap-login {
+  process_min_avail = 3
+  service_count = 1
+}
+
+service imap {
+   executable = /usr/libexec/dovecot/imap
+  #mail_executable = /usr/bin/pibsmtp /usr/libexec/dovecot/imap
+}
+
+service pop3-login {
+  process_min_avail = 3
+  service_count = 1
+}
+
+service pop3 {
+   executable = /usr/libexec/dovecot/pop3
+  #executable = /usr/bin/pibsmtp /usr/libexec/dovecot/pop3
+}
+mbox_write_locks = fcntl
+
+##
+## IMAP specific settings
+##
+
+protocol imap {
+       imap_client_workarounds =
+       }
+  
+##
+## POP3 specific settings
+##
+
+protocol pop3 {
+       pop3_uidl_format = %08Xu%08Xv
+       pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
+       #mail_executable = /usr/bin/pibsmtp /usr/libexec/dovecot/pop3
+       mail_executable = /usr/libexec/dovecot/pop3
+       }
+
+auth default {
+       mechanisms = plain
+       user = clement
+
+       passdb sql {
+               args=/etc/clement-2.5/dovecot-sql.conf
+               }
+
+       userdb static {
+               args = uid=clement gid=mail home=/var/spool/clement-2.5/mails/%d/%n mail=maildir:~/dovecot
+               }
+
+       socket listen {
+               master {
+                       path = /var/run/dovecot/auth-master
+                       mode = 0600
+                       user = clement
+                       }
+               }
+       }
+
+protocol lda {
+       postmaster_address =  postmaster
+       mail_plugins = sieve
+       }
+
+protocol sieve {
+       mail_debug=yes
+       }
+
+plugin {
+       sieve = ~/.dovecot.sieve
+       sieve_dir=~/sieve
+       }
+
+mail_debug = no
+auth_debug = no
+auth_verbose = no
+auth_debug_passwords = no
+
+mbox_write_locks = fcntl
+
+log_path = /var/log/clem-dovecot.log
index 3babce65f8ede0c7bcc9bff143792aeca2ad6e1d..02affdb3a0b568b6ad61b7f561c7276a46e50cdc 100755 (executable)
@@ -93,6 +93,29 @@ case "$OS" in
     ;;
   esac
 }
+#----------------------------------------------------------------------
+#adding dovecot configuration
+#----------------------------------------------------------------------
+do_doveconf()
+
+{
+DOVCONF=/etc/dovecot/dovecot.conf
+BEFMAIL=/etc/dovecot.conf.before.$APPNAME
+DOVMAIL=/etc/$APPNAME/dovecot/dovecot.conf
+
+if [ ! -f $BEFMAIL ] ; then
+  mv $DOVCONF $BEFMAIL
+  ln -nsf $DOVMAIL $DOVCONF
+  ln -nsf                                              \
+       /etc/$APPNAME/dovecot/dovecot-2.0-auth-sql.conf \
+       /etc/$APPNAME/dovecot/dovecot-auth-sql.conf
+  ln -nsf                                              \
+       /etc/$APPNAME/dovecot-2.0-auth-ldap.conf        \
+       /etc/$APPNAME/dovecot-auth-ldap.conf
+  cat  /etc/$APPNAME/dovcot/dovecot-auth.conf >> $DOVCONF
+  fi
+}
+
 #----------------------------------------------------------------------
 #procedure to check if the config is properly done
 #----------------------------------------------------------------------
@@ -122,7 +145,7 @@ case "$DB_TYPE" in
        fi
     ;;
   "TO_BE_DEFINED"      )
-    echo "You must install $APPNAME with a DB flavor (ex: $APPNAME-pgsql, $APPNAME-mysql)"
+    echo "You must install $APPNAME with a DB flavor (ex: $APPNAME-postgresql"
     echo "Exiting now"
     exit -2;
     ;;
@@ -158,6 +181,7 @@ do_mkconf()
 if [ ! -f /etc/$APPNAME/config.done ] ; then
   /usr/lib/$APPNAME/support/addconfig.sh
   do_mkdb ;
+  do_doveconf ;
   case "$OS" in 
     osukiss    )
       ;;