From 5a52901f2d9fe1aceabbc909063d78cf4fe20c01 Mon Sep 17 00:00:00 2001
From: Zhang Huangbin
Date: Sun, 23 Dec 2018 21:25:05 +0800
Subject: [PATCH] Sync iRedMail Upgrade tutorial: Fixed: Improper new dovecot
ldap/sql queries which doesn't convert upper cases of maildir to lower cases.
---
.../upgrade/0-upgrade.iredmail.0.9.8-0.9.9.md | 21 ++++++++++---------
html/upgrade.iredmail.0.9.8-0.9.9.html | 21 ++++++++++---------
2 files changed, 22 insertions(+), 20 deletions(-)
diff --git a/en_US/upgrade/0-upgrade.iredmail.0.9.8-0.9.9.md b/en_US/upgrade/0-upgrade.iredmail.0.9.8-0.9.9.md
index 3dc64bde..cb65c2f8 100644
--- a/en_US/upgrade/0-upgrade.iredmail.0.9.8-0.9.9.md
+++ b/en_US/upgrade/0-upgrade.iredmail.0.9.8-0.9.9.md
@@ -10,6 +10,7 @@
## ChangeLog
+* Dec 23, 2018, Fixed: Improper new dovecot ldap/sql queries which doesn't convert upper cases of maildir to lower cases.
* Dec 21, 2018, Fixed: SOGo backup script doesn't set correct permission on backup files.
* Dec 21, 2018, mention how to upgrade netdata.
* Dec 20, 2018, fix hard-coded mailbox folder name in `dovecot-mysql.conf`.
@@ -322,7 +323,7 @@ user_attrs = mail=master_user,mail=user,homeDirectory=home,=mail=maildir:~/
Please replace it by below one:
```
-user_attrs = mail=master_user,mail=user,homeDirectory=home,=mail=%{ldap:mailboxFormat:maildir}:~/%{ldap:mailboxFolder:Maildir}/,mailQuota=quota_rule=*:bytes=%$
+user_attrs = mail=master_user,mail=user,=home=%L{ldap:homeDirectory},=mail=%{ldap:mailboxFormat:maildir}:~/%{ldap:mailboxFolder:Maildir}/,mailQuota=quota_rule=*:bytes=%$
```
If attribute `mailboxFormat` doesn't present in user object, Dovecot will use
@@ -390,13 +391,13 @@ user_query = SELECT \
...
```
-Add a new `CONCAT` line after above `CONCAT()` line:
+Update above line and also add a new `CONCAT` line after after it:
```
user_query = SELECT \
...
- CONCAT(mailbox.storagebasedirectory, '/', mailbox.storagenode, '/', mailbox.maildir) AS home, \
- CONCAT(mailbox.mailboxformat, ':', mailbox.storagebasedirectory, '/', mailbox.storagenode, '/', mailbox.maildir, '/', mailbox.mailboxfolder) AS mail, \
+ LOWER(CONCAT(mailbox.storagebasedirectory, '/', mailbox.storagenode, '/', mailbox.maildir)) AS home, \
+ CONCAT(mailbox.mailboxformat, ':~/', mailbox.mailboxfolder, '/') AS mail, \
...
```
@@ -458,12 +459,12 @@ user_query = SELECT \
...
```
-Please Add a line after above line:
+Update above line and also add a new `CONCAT` line after after it:
```
user_query = SELECT \
- mailbox.storagebasedirectory || '/' || mailbox.storagenode || '/' || mailbox.maildir AS home, \
- mailbox.mailboxformat || ':' || mailbox.storagebasedirectory || '/' || mailbox.storagenode || '/' || mailbox.maildir || '/' || mailbox.mailboxfolder || '/' AS mail, \
+ LOWER(mailbox.storagebasedirectory || '/' || mailbox.storagenode || '/' || mailbox.maildir) AS home, \
+ LOWER(mailbox.mailboxformat || ':~/' || mailbox.mailboxfolder || '/') AS mail, \
...
```
@@ -484,13 +485,13 @@ user_query = SELECT \
...
```
-Add a new `CONCAT` line after above `CONCAT()` line:
+Update above line and also add a new `CONCAT` line after after it:
```
user_query = SELECT \
...
- CONCAT(mailbox.storagebasedirectory, '/', mailbox.storagenode, '/', mailbox.maildir) AS home, \
- CONCAT(mailbox.mailboxformat, ':', mailbox.storagebasedirectory, '/', mailbox.storagenode, '/', mailbox.maildir, '/', mailbox.mailboxfolder, '/') AS mail, \
+ LOWER(CONCAT(mailbox.storagebasedirectory, '/', mailbox.storagenode, '/', mailbox.maildir)) AS home, \
+ CONCAT(mailbox.mailboxformat, ':~/', mailbox.mailboxfolder, '/') AS mail, \
...
```
diff --git a/html/upgrade.iredmail.0.9.8-0.9.9.html b/html/upgrade.iredmail.0.9.8-0.9.9.html
index 6a722015..2ed33910 100644
--- a/html/upgrade.iredmail.0.9.8-0.9.9.html
+++ b/html/upgrade.iredmail.0.9.8-0.9.9.html
@@ -65,6 +65,7 @@ check the details and
ChangeLog
+- Dec 23, 2018, Fixed: Improper new dovecot ldap/sql queries which doesn't convert upper cases of maildir to lower cases.
- Dec 21, 2018, Fixed: SOGo backup script doesn't set correct permission on backup files.
- Dec 21, 2018, mention how to upgrade netdata.
- Dec 20, 2018, fix hard-coded mailbox folder name in
dovecot-mysql.conf
.
@@ -337,7 +338,7 @@ line like below:
Please replace it by below one:
-user_attrs = mail=master_user,mail=user,homeDirectory=home,=mail=%{ldap:mailboxFormat:maildir}:~/%{ldap:mailboxFolder:Maildir}/,mailQuota=quota_rule=*:bytes=%$
+user_attrs = mail=master_user,mail=user,=home=%L{ldap:homeDirectory},=mail=%{ldap:mailboxFormat:maildir}:~/%{ldap:mailboxFolder:Maildir}/,mailQuota=quota_rule=*:bytes=%$
If attribute mailboxFormat
doesn't present in user object, Dovecot will use
@@ -396,11 +397,11 @@ line like below:
...
-Add a new CONCAT
line after above CONCAT()
line:
+Update above line and also add a new CONCAT
line after after it:
user_query = SELECT \
...
- CONCAT(mailbox.storagebasedirectory, '/', mailbox.storagenode, '/', mailbox.maildir) AS home, \
- CONCAT(mailbox.mailboxformat, ':', mailbox.storagebasedirectory, '/', mailbox.storagenode, '/', mailbox.maildir, '/', mailbox.mailboxfolder) AS mail, \
+ LOWER(CONCAT(mailbox.storagebasedirectory, '/', mailbox.storagenode, '/', mailbox.maildir)) AS home, \
+ CONCAT(mailbox.mailboxformat, ':~/', mailbox.mailboxfolder, '/') AS mail, \
...
@@ -450,10 +451,10 @@ below:
...
-Please Add a line after above line:
+Update above line and also add a new CONCAT
line after after it:
user_query = SELECT \
- mailbox.storagebasedirectory || '/' || mailbox.storagenode || '/' || mailbox.maildir AS home, \
- mailbox.mailboxformat || ':' || mailbox.storagebasedirectory || '/' || mailbox.storagenode || '/' || mailbox.maildir || '/' || mailbox.mailboxfolder || '/' AS mail, \
+ LOWER(mailbox.storagebasedirectory || '/' || mailbox.storagenode || '/' || mailbox.maildir) AS home, \
+ LOWER(mailbox.mailboxformat || ':~/' || mailbox.mailboxfolder || '/') AS mail, \
...
@@ -469,11 +470,11 @@ below:
...
-Add a new CONCAT
line after above CONCAT()
line:
+Update above line and also add a new CONCAT
line after after it:
user_query = SELECT \
...
- CONCAT(mailbox.storagebasedirectory, '/', mailbox.storagenode, '/', mailbox.maildir) AS home, \
- CONCAT(mailbox.mailboxformat, ':', mailbox.storagebasedirectory, '/', mailbox.storagenode, '/', mailbox.maildir, '/', mailbox.mailboxfolder, '/') AS mail, \
+ LOWER(CONCAT(mailbox.storagebasedirectory, '/', mailbox.storagenode, '/', mailbox.maildir)) AS home, \
+ CONCAT(mailbox.mailboxformat, ':~/', mailbox.mailboxfolder, '/') AS mail, \
...