Univention Bugzilla – Attachment 7171 Details for
Bug 39346
lowercase email addresses for Dovecot user queries
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
63756.diff
r63756.diff (text/plain), 6.64 KB, created by
Stefan Gohmann
on 2015-09-18 07:00:04 CEST
(
hide
)
Description:
63756.diff
Filename:
MIME Type:
Creator:
Stefan Gohmann
Created:
2015-09-18 07:00:04 CEST
Size:
6.64 KB
patch
obsolete
>Index: conffiles/etc/dovecot/conf.d/90-quota.conf >=================================================================== >--- conffiles/etc/dovecot/conf.d/90-quota.conf (Revision 63755) >+++ conffiles/etc/dovecot/conf.d/90-quota.conf (Revision 63756) >@@ -41,7 +41,7 @@ > @!@ > warnings = [ucrv.split("/")[-1] for ucrv, text in configRegistry.items() if ucrv.startswith("mail/dovecot/quota/warning/text/") and text.strip()] > for num, warning in enumerate(sorted(warnings, reverse=True), start=1): >- print " quota_warning%s = storage=%s%%%% quota-warning %s %%u" % ("" if num == 1 else str(num), warning, warning) >+ print " quota_warning%s = storage=%s%%%% quota-warning %s %%Lu" % ("" if num == 1 else str(num), warning, warning) > @!@ > } > >Index: conffiles/etc/dovecot/conf.d/10-mail.conf >=================================================================== >--- conffiles/etc/dovecot/conf.d/10-mail.conf (Revision 63755) >+++ conffiles/etc/dovecot/conf.d/10-mail.conf (Revision 63756) >@@ -31,12 +31,12 @@ > # > @!@ > if configRegistry.is_true("mail/dovecot/location/separate_index", False): >- index = ":INDEX=/var/lib/dovecot/index/%d/%n" >+ index = ":INDEX=/var/lib/dovecot/index/%Ld/%Ln" > else: > index = "" >-print "mail_location = maildir:/var/spool/dovecot/private/%%d/%%n/Maildir%s" % index >+print "mail_location = maildir:/var/spool/dovecot/private/%%Ld/%%Ln/Maildir%s" % index > @!@ >-mail_home = /var/spool/dovecot/private/%d/%n >+mail_home = /var/spool/dovecot/private/%Ld/%Ln > > # If you need to set multiple mailbox locations or want to change default > # namespace settings, you can do it by defining namespace sections. >@@ -104,7 +104,7 @@ > else: > control = ":CONTROL=~/Maildir/shared/%%u" > if configRegistry.is_true("mail/dovecot/location/separate_index", False): >- index = "/var/lib/dovecot/index/%d/%n" >+ index = "/var/lib/dovecot/index/%Ld/%Ln" > else: > index = "~/Maildir" > print " location = maildir:%%%%h/Maildir:INDEXPVT=%s/shared/%%%%u%s" % (index, control) >@@ -127,7 +127,7 @@ > else: > control = ":CONTROL=~/Maildir/public/%(dom)s/%(loc)s" % {"loc": loc, "dom": dom} > if configRegistry.is_true("mail/dovecot/location/separate_index", False): >- index = "/var/lib/dovecot/index/%d/%n" >+ index = "/var/lib/dovecot/index/%Ld/%Ln" > else: > index = "~/Maildir" > print """ >Index: modules/univention/mail/dovecot.py >=================================================================== >--- modules/univention/mail/dovecot.py (Revision 63755) >+++ modules/univention/mail/dovecot.py (Revision 63756) >@@ -72,7 +72,7 @@ > try: > old_localpart, old_domainpart = email.split("@") > global_mail_home = self.get_maillocation() >- old_home_calc = str(global_mail_home).replace("%d", old_domainpart).replace("%n", old_localpart) >+ old_home_calc = str(global_mail_home).replace("%Ld", old_domainpart).replace("%Ln", old_localpart) > except: > self.log_e("dovecot: Delete mailbox: Configuration error. Could not remove mailbox (dn:'%s' old mail: '%s')." % (dn, email)) > raise >@@ -117,11 +117,11 @@ > self.log_p("Renaming of mailboxes disabled, not moving ('%s' -> '%s')." % (oldMailPrimaryAddress, newMailPrimaryAddress)) > return > >- old_localpart, old_domainpart = oldMailPrimaryAddress.split("@") >+ old_localpart, old_domainpart = oldMailPrimaryAddress.lower().split("@") > > try: > global_mail_home = self.get_maillocation() >- old_home_calc = str(global_mail_home).replace("%d", old_domainpart).replace("%n", old_localpart) >+ old_home_calc = str(global_mail_home).replace("%Ld", old_domainpart).replace("%Ln", old_localpart) > new_home_dove = self.get_user_home(newMailPrimaryAddress) > except: > self.log_e("Move mailbox: Configuration error. Could not move mailbox ('%s' -> '%s')." % (oldMailPrimaryAddress, newMailPrimaryAddress)) >@@ -204,7 +204,7 @@ > > def get_user_home(self, username): > try: >- return self.read_from_ext_proc_as_root(["/usr/bin/doveadm", 'user', "-f", "home", username]) >+ return self.read_from_ext_proc_as_root(["/usr/bin/doveadm", 'user', "-f", "home", username]).lower() > except: > self.log_e("Failed to get mail home for user '%s'.\n%s" % (username, traceback.format_exc())) > raise >Index: modules/univention/mail/dovecot_shared_folder.py >=================================================================== >--- modules/univention/mail/dovecot_shared_folder.py (Revision 63755) >+++ modules/univention/mail/dovecot_shared_folder.py (Revision 63756) >@@ -99,7 +99,7 @@ > old_mailbox = old["mailPrimaryAddress"][0] > old_loc, old_domain = old_mailbox.split("@") > global_mail_home = self.get_maillocation() >- path = str(global_mail_home).replace("%d", old_domain).replace("%n", old_loc) >+ path = str(global_mail_home).replace("%Ld", old_domain).replace("%Ln", old_loc) > # cannot unsubscribe to non-existing shared folder (a.k.a. private mailbox) > else: > # public folder >@@ -136,7 +136,7 @@ > if "mailPrimaryAddress" in old: > # it remains a shared folder > old_mailbox = old["mailPrimaryAddress"][0] >- if new_mailbox.lower() != old_mailbox.lower(): >+ if new_mailbox != old_mailbox: > # rename/move mailbox inside private namespace > # > # cannot unsubscribe to non-existing shared folder (a.k.a. private mailbox) >@@ -147,6 +147,7 @@ > pass > else: > # move mailbox from public to private namespace >+ self.log_p("Moving mailbox from public to private namespace...") > old_mailbox = old["cn"][0] > try: > pub_loc = self.get_public_location(old_mailbox) >@@ -196,12 +197,13 @@ > new_mailbox = new["cn"][0] > if "mailPrimaryAddress" in old: > # move mailbox from private to public namespace >+ self.log_p("Moving mailbox from private to public namespace...") > old_mailbox = old["mailPrimaryAddress"][0] > old_loc, old_domain = old_mailbox.split("@") > # cannot unsubscribe to non-existing shared folder (a.k.a. private mailbox) > try: > global_mail_home = self.get_maillocation() >- old_path = str(global_mail_home).replace("%d", old_domain).replace("%n", old_loc) >+ old_path = str(global_mail_home).replace("%Ld", old_domain).replace("%Ln", old_loc).lower() > # update dovecot config > self.update_public_mailbox_configuration() > pub_loc = self.get_public_location(new_mailbox) >Index: debian/changelog >=================================================================== >--- debian/changelog (Revision 63755) >+++ debian/changelog (Revision 63756) >@@ -1,3 +1,9 @@ >+univention-mail-dovecot (1.0.0-10) unstable; urgency=low >+ >+ * lowercase all paths (except shared folder w/o email address) (Bug #39346) >+ >+ -- Daniel Troeder <troeder@univention.de> Wed, 16 Sep 2015 10:56:42 +0200 >+ > univention-mail-dovecot (1.0.0-9) unstable; urgency=low > > * lowercase email addresses for authdb cache and userdb queries (Bug #39346)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 39346
:
7165
| 7171