Univention Bugzilla – Bug 38840
dovecot.py listener ignores special case
Last modified: 2015-07-09 18:15:54 CEST
I think, the following code snippet fails to move the mailbox if the mailHomeServer is changed from "" to the FQDN of the local system AND the mailPrimaryAddres is changed: is_old_home_server = oldHomeServer == "" or oldHomeServer == fqdn is_new_home_server = newHomeServer == "" or newHomeServer == fqdn # mailPrimaryAddress changed, but same home server if is_old_home_server and is_new_home_server \ and oldHomeServer == newHomeServer \ and oldMailPrimaryAddress and newMailPrimaryAddress \ and oldMailPrimaryAddress != newMailPrimaryAddress: dl.move_email_account2(dn, oldMailPrimaryAddress, newMailPrimaryAddress) return is_old_home_server nad is_new_home_server already defines, that this server is responsible for the old and the new user object. So the comparison "oldHomeServer == newHomeServer" seems to be the culprit.
Good catch! Fixed in r61853 / 0.0.0-52.
Found another corner case: oldMailPrimaryAddress=foo@univention.de newMailPrimaryAddress=foo@univention.de is_old_home_server=True is_new_home_server=False → in this case, the server is no longer responsible for the mailbox and dl.delete_email_account2() should have been called → current code: if oldMailPrimaryAddress and not newMailPrimaryAddress and is_old_home_server: → suggestion for corrected code: if oldMailPrimaryAddress and is_old_home_server and \ (not newMailPrimaryAddress or not is_new_home_server):
Fix has been committed as: r61857 | Bug #34839: delete mail account in case of change of home server from us to another
Tested both cases: 1) mailPrimaryAddress changed from foo@univention.de to foo2@univention.de mailHomeServer changed from "" to "slave22b.univention.de" 2) mailPrimaryAddress was set and left untouched mailHomeServer switched to a different server slave22c.univention.de → OK → VERIFIED
<http://errata.univention.de/ucs/4.0/237.html>