|
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) |