View | Details | Raw Unified | Return to bug 39346 | Differences between
and this patch

Collapse All | Expand All

(-)conffiles/etc/dovecot/conf.d/90-quota.conf (-1 / +1 lines)
 Lines 41-47    Link Here 
41
@!@
41
@!@
42
warnings = [ucrv.split("/")[-1] for ucrv, text in configRegistry.items() if ucrv.startswith("mail/dovecot/quota/warning/text/") and text.strip()]
42
warnings = [ucrv.split("/")[-1] for ucrv, text in configRegistry.items() if ucrv.startswith("mail/dovecot/quota/warning/text/") and text.strip()]
43
for num, warning in enumerate(sorted(warnings, reverse=True), start=1):
43
for num, warning in enumerate(sorted(warnings, reverse=True), start=1):
44
	print "  quota_warning%s = storage=%s%%%% quota-warning %s %%u" % ("" if num == 1 else str(num), warning, warning)
44
	print "  quota_warning%s = storage=%s%%%% quota-warning %s %%Lu" % ("" if num == 1 else str(num), warning, warning)
45
@!@
45
@!@
46
}
46
}
47
47
(-)conffiles/etc/dovecot/conf.d/10-mail.conf (-5 / +5 lines)
 Lines 31-42    Link Here 
31
#
31
#
32
@!@
32
@!@
33
if configRegistry.is_true("mail/dovecot/location/separate_index", False):
33
if configRegistry.is_true("mail/dovecot/location/separate_index", False):
34
	index = ":INDEX=/var/lib/dovecot/index/%d/%n"
34
	index = ":INDEX=/var/lib/dovecot/index/%Ld/%Ln"
35
else:
35
else:
36
	index = ""
36
	index = ""
37
print "mail_location = maildir:/var/spool/dovecot/private/%%d/%%n/Maildir%s" % index
37
print "mail_location = maildir:/var/spool/dovecot/private/%%Ld/%%Ln/Maildir%s" % index
38
@!@
38
@!@
39
mail_home = /var/spool/dovecot/private/%d/%n
39
mail_home = /var/spool/dovecot/private/%Ld/%Ln
40
40
41
# If you need to set multiple mailbox locations or want to change default
41
# If you need to set multiple mailbox locations or want to change default
42
# namespace settings, you can do it by defining namespace sections.
42
# namespace settings, you can do it by defining namespace sections.
 Lines 104-110    Link Here 
104
else:
104
else:
105
	control = ":CONTROL=~/Maildir/shared/%%u"
105
	control = ":CONTROL=~/Maildir/shared/%%u"
106
if configRegistry.is_true("mail/dovecot/location/separate_index", False):
106
if configRegistry.is_true("mail/dovecot/location/separate_index", False):
107
	index = "/var/lib/dovecot/index/%d/%n"
107
	index = "/var/lib/dovecot/index/%Ld/%Ln"
108
else:
108
else:
109
	index = "~/Maildir"
109
	index = "~/Maildir"
110
print "  location = maildir:%%%%h/Maildir:INDEXPVT=%s/shared/%%%%u%s" % (index, control)
110
print "  location = maildir:%%%%h/Maildir:INDEXPVT=%s/shared/%%%%u%s" % (index, control)
 Lines 127-133    Link Here 
127
	else:
127
	else:
128
		control = ":CONTROL=~/Maildir/public/%(dom)s/%(loc)s" % {"loc": loc, "dom": dom}
128
		control = ":CONTROL=~/Maildir/public/%(dom)s/%(loc)s" % {"loc": loc, "dom": dom}
129
	if configRegistry.is_true("mail/dovecot/location/separate_index", False):
129
	if configRegistry.is_true("mail/dovecot/location/separate_index", False):
130
		index = "/var/lib/dovecot/index/%d/%n"
130
		index = "/var/lib/dovecot/index/%Ld/%Ln"
131
	else:
131
	else:
132
		index = "~/Maildir"
132
		index = "~/Maildir"
133
	print """
133
	print """
(-)modules/univention/mail/dovecot.py (-4 / +4 lines)
 Lines 72-78    Link Here 
72
			try:
72
			try:
73
				old_localpart, old_domainpart = email.split("@")
73
				old_localpart, old_domainpart = email.split("@")
74
				global_mail_home = self.get_maillocation()
74
				global_mail_home = self.get_maillocation()
75
				old_home_calc = str(global_mail_home).replace("%d", old_domainpart).replace("%n", old_localpart)
75
				old_home_calc = str(global_mail_home).replace("%Ld", old_domainpart).replace("%Ln", old_localpart)
76
			except:
76
			except:
77
				self.log_e("dovecot: Delete mailbox: Configuration error. Could not remove mailbox (dn:'%s' old mail: '%s')." % (dn, email))
77
				self.log_e("dovecot: Delete mailbox: Configuration error. Could not remove mailbox (dn:'%s' old mail: '%s')." % (dn, email))
78
				raise
78
				raise
 Lines 117-127    Link Here 
117
			self.log_p("Renaming of mailboxes disabled, not moving ('%s' -> '%s')." % (oldMailPrimaryAddress, newMailPrimaryAddress))
117
			self.log_p("Renaming of mailboxes disabled, not moving ('%s' -> '%s')." % (oldMailPrimaryAddress, newMailPrimaryAddress))
118
			return
118
			return
119
119
120
		old_localpart, old_domainpart = oldMailPrimaryAddress.split("@")
120
		old_localpart, old_domainpart = oldMailPrimaryAddress.lower().split("@")
121
121
122
		try:
122
		try:
123
			global_mail_home = self.get_maillocation()
123
			global_mail_home = self.get_maillocation()
124
			old_home_calc = str(global_mail_home).replace("%d", old_domainpart).replace("%n", old_localpart)
124
			old_home_calc = str(global_mail_home).replace("%Ld", old_domainpart).replace("%Ln", old_localpart)
125
			new_home_dove = self.get_user_home(newMailPrimaryAddress)
125
			new_home_dove = self.get_user_home(newMailPrimaryAddress)
126
		except:
126
		except:
127
			self.log_e("Move mailbox: Configuration error. Could not move mailbox ('%s' -> '%s')." % (oldMailPrimaryAddress, newMailPrimaryAddress))
127
			self.log_e("Move mailbox: Configuration error. Could not move mailbox ('%s' -> '%s')." % (oldMailPrimaryAddress, newMailPrimaryAddress))
 Lines 204-210    Link Here 
204
204
205
	def get_user_home(self, username):
205
	def get_user_home(self, username):
206
		try:
206
		try:
207
			return self.read_from_ext_proc_as_root(["/usr/bin/doveadm", 'user', "-f", "home", username])
207
			return self.read_from_ext_proc_as_root(["/usr/bin/doveadm", 'user', "-f", "home", username]).lower()
208
		except:
208
		except:
209
			self.log_e("Failed to get mail home for user '%s'.\n%s" % (username, traceback.format_exc()))
209
			self.log_e("Failed to get mail home for user '%s'.\n%s" % (username, traceback.format_exc()))
210
			raise
210
			raise
(-)modules/univention/mail/dovecot_shared_folder.py (-3 / +5 lines)
 Lines 99-105    Link Here 
99
			old_mailbox = old["mailPrimaryAddress"][0]
99
			old_mailbox = old["mailPrimaryAddress"][0]
100
			old_loc, old_domain = old_mailbox.split("@")
100
			old_loc, old_domain = old_mailbox.split("@")
101
			global_mail_home = self.get_maillocation()
101
			global_mail_home = self.get_maillocation()
102
			path = str(global_mail_home).replace("%d", old_domain).replace("%n", old_loc)
102
			path = str(global_mail_home).replace("%Ld", old_domain).replace("%Ln", old_loc)
103
			# cannot unsubscribe to non-existing shared folder (a.k.a. private mailbox)
103
			# cannot unsubscribe to non-existing shared folder (a.k.a. private mailbox)
104
		else:
104
		else:
105
			# public folder
105
			# public folder
 Lines 136-142    Link Here 
136
			if "mailPrimaryAddress" in old:
136
			if "mailPrimaryAddress" in old:
137
				# it remains a shared folder
137
				# it remains a shared folder
138
				old_mailbox = old["mailPrimaryAddress"][0]
138
				old_mailbox = old["mailPrimaryAddress"][0]
139
				if new_mailbox.lower() != old_mailbox.lower():
139
				if new_mailbox != old_mailbox:
140
					# rename/move mailbox inside private namespace
140
					# rename/move mailbox inside private namespace
141
					#
141
					#
142
					# cannot unsubscribe to non-existing shared folder (a.k.a. private mailbox)
142
					# cannot unsubscribe to non-existing shared folder (a.k.a. private mailbox)
 Lines 147-152    Link Here 
147
					pass
147
					pass
148
			else:
148
			else:
149
				# move mailbox from public to private namespace
149
				# move mailbox from public to private namespace
150
				self.log_p("Moving mailbox from public to private namespace...")
150
				old_mailbox = old["cn"][0]
151
				old_mailbox = old["cn"][0]
151
				try:
152
				try:
152
					pub_loc = self.get_public_location(old_mailbox)
153
					pub_loc = self.get_public_location(old_mailbox)
 Lines 196-207    Link Here 
196
			new_mailbox = new["cn"][0]
197
			new_mailbox = new["cn"][0]
197
			if "mailPrimaryAddress" in old:
198
			if "mailPrimaryAddress" in old:
198
				# move mailbox from private to public namespace
199
				# move mailbox from private to public namespace
200
				self.log_p("Moving mailbox from private to public namespace...")
199
				old_mailbox = old["mailPrimaryAddress"][0]
201
				old_mailbox = old["mailPrimaryAddress"][0]
200
				old_loc, old_domain = old_mailbox.split("@")
202
				old_loc, old_domain = old_mailbox.split("@")
201
				# cannot unsubscribe to non-existing shared folder (a.k.a. private mailbox)
203
				# cannot unsubscribe to non-existing shared folder (a.k.a. private mailbox)
202
				try:
204
				try:
203
					global_mail_home = self.get_maillocation()
205
					global_mail_home = self.get_maillocation()
204
					old_path = str(global_mail_home).replace("%d", old_domain).replace("%n", old_loc)
206
					old_path = str(global_mail_home).replace("%Ld", old_domain).replace("%Ln", old_loc).lower()
205
					# update dovecot config
207
					# update dovecot config
206
					self.update_public_mailbox_configuration()
208
					self.update_public_mailbox_configuration()
207
					pub_loc = self.get_public_location(new_mailbox)
209
					pub_loc = self.get_public_location(new_mailbox)
(-)debian/changelog (+6 lines)
 Lines 1-3    Link Here 
1
univention-mail-dovecot (1.0.0-10) unstable; urgency=low
2
3
  * lowercase all paths (except shared folder w/o email address) (Bug #39346)
4
5
 -- Daniel Troeder <troeder@univention.de>  Wed, 16 Sep 2015 10:56:42 +0200
6
1
univention-mail-dovecot (1.0.0-9) unstable; urgency=low
7
univention-mail-dovecot (1.0.0-9) unstable; urgency=low
2
8
3
  * lowercase email addresses for authdb cache and userdb queries (Bug #39346)
9
  * lowercase email addresses for authdb cache and userdb queries (Bug #39346)

Return to bug 39346