Bug 29605 - mailHomeServer muss nicht gesetzt werden, jedoch erwarten die cyrus Listener Modul teilweise einen mailHomeServer
mailHomeServer muss nicht gesetzt werden, jedoch erwarten die cyrus Listener ...
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Mail
UCS 3.0
Other Linux
: P5 normal (vote)
: UCS 3.2
Assigned To: Erik Damrose
Sönke Schwardt-Krummrich
: interim-1
: 25722 29637 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-12-06 14:51 CET by Felix Botner
Modified: 2013-11-19 06:42 CET (History)
1 user (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Felix Botner univentionstaff 2012-12-06 14:51:48 CET
Weder über die CMD noch über die UMC ist es nötig einen mailHomeServer zu setzten. Da dieses Attribut auch noch unter "Erweiterte Einstellungen" sieht man es als unbedarfter User wahrscheinlich gar nicht.

In cyrus-mailboxrename.py wird jedoch beim Löschen explizit auf univentionMailHomeServer geschaut, wenn es nicht vorhanden ist, wird die Mailbox nicht gelöscht.

Wir müssten mal schauen, ob es noch irgendwo Stellen gibt, wo mailHomeServer gebraucht wird und dort die Unterstützung für "keinen maliHomeServer" einbauen.
Comment 1 Stefan Gohmann univentionstaff 2013-06-04 07:44:38 CEST
*** Bug 29637 has been marked as a duplicate of this bug. ***
Comment 2 Felix Botner univentionstaff 2013-06-20 10:33:34 CEST
Die Module cyrus.py und cyrus-mailboxrename.py wurden zu cyrus.py zusammengefasst und etwas aufgeräumt, es sollte sich jetzt so verhalten:

Mailbox wird nur noch angelegt, wenn homeServer gesetzt ist!

a) Neuer Benutzer mit homeServer und prim. Mailadresse:
b) homeServer wird erstmalig gesetzt (prim. Mailadresse vorhanden):
c) prim. Mailadresse wird erstmalig gesetzt (homeServer vorhanden):
 * Mailbox wird nur angelegt

prim. Mailadresse wird geändert (homeServer bleibt gleich):
 * Mailbox wird umbenannt
    falls mail/cyrus/mailbox/rename=yes
 * alte Mailbox wird gelöscht, neue angelegt
    falls mail/cyrus/mailbox/rename=no

homeServer wird geändert:
 "Normaler" Cyrus
  * Mailbox wird auf dem alten homeServer gelöscht
     falls mail/cyrus/mailbox/delete='yes'
  * Mailbox wird auf dem neuen homeServer angelegt
 Cyrus Murder 
  * Mailbox wird auf neuen homeServer verschoben

a) homeServer wird entfernt:
b) prim Mailadresse wird entfernt:
c) Benutzer entfernt:
 * Mailbox wird gelöscht
    falls mail/cyrus/mailbox/delete='yes'

Das muss nochmal intensiv getestet werden, da ich das Listener Modul ziemlich umgekrempelt habe. Bitte auch ein Update testen.
Comment 3 Sönke Schwardt-Krummrich univentionstaff 2013-08-21 11:34:42 CEST
*** Bug 25722 has been marked as a duplicate of this bug. ***
Comment 4 Sönke Schwardt-Krummrich univentionstaff 2013-08-21 11:43:48 CEST
(In reply to Felix Botner from comment #2)
> Die Module cyrus.py und cyrus-mailboxrename.py wurden zu cyrus.py
> zusammengefasst und etwas aufgeräumt, es sollte sich jetzt so verhalten:

sschwardt@dave:.../ucs-3.2-0/mail/univention-mail-cyrus$ pyflakes cyrus.py 
cyrus.py:95: local variable 'returncode' is assigned to but never used
cyrus.py:155: undefined name 'oldemail'

The latter one causes the following traceback:

Traceback (most recent call last):
  File "/usr/lib/univention-directory-listener/system/cyrus.py", line 260, in handler
    move_cyrus_murder_mailbox(oldMailPrimaryAddress.lower(), newMailPrimaryAddress.lower())
  File "/usr/lib/univention-directory-listener/system/cyrus.py", line 155, in move_cyrus_murder_mailbox
    '%s: Cyrus Murder mailbox rename failed for %s' % (name, oldemail))
NameError: global name 'oldemail' is not defined
21.08.13 02:20:23.563  LISTENER    ( WARN    ) : handler: cyrus (failed)

> Mailbox wird nur noch angelegt, wenn homeServer gesetzt ist!

→ OK
 
> a) Neuer Benutzer mit homeServer und prim. Mailadresse:
> b) homeServer wird erstmalig gesetzt (prim. Mailadresse vorhanden):
> c) prim. Mailadresse wird erstmalig gesetzt (homeServer vorhanden):
>  * Mailbox wird nur angelegt

→ OK
 
> prim. Mailadresse wird geändert (homeServer bleibt gleich):
>  * Mailbox wird umbenannt
>     falls mail/cyrus/mailbox/rename=yes
>  * alte Mailbox wird gelöscht, neue angelegt
>     falls mail/cyrus/mailbox/rename=no

→ OK

> homeServer wird geändert:
>  "Normaler" Cyrus
>   * Mailbox wird auf dem alten homeServer gelöscht
>      falls mail/cyrus/mailbox/delete='yes'
>   * Mailbox wird auf dem neuen homeServer angelegt

→ OK

>  Cyrus Murder 
>   * Mailbox wird auf neuen homeServer verschoben

→ OK: creating new IMAP folders
→ OK: rename IMAP folders
→ OK: removing IMAP folders
→ OK: moving IMAP folders between servers
→ FAIL: renaming and moving IMAP folders between servers in one step
        → folder gets moved but not renamed

> a) homeServer wird entfernt:
> b) prim Mailadresse wird entfernt:
> c) Benutzer entfernt:
>  * Mailbox wird gelöscht
>     falls mail/cyrus/mailbox/delete='yes'

→ OK

→ Reopen
Comment 5 Erik Damrose univentionstaff 2013-08-22 13:54:13 CEST
- cyrus-mailboxrename.py was removed from the package
- fixed variable names
- added mailbox renameing after changing mail homeserver

Fixed in univention-mail-cyrus univention-mail-cyrus 6.0.4-4.186.201308221351
Changelog entry already present
Comment 6 Erik Damrose univentionstaff 2013-08-23 09:37:03 CEST
A comment did falsely mention cyrus murder instead of cyrus. This has been fixed and the package has been rebuild. 
univention-mail-cyrus 6.0.4-5.187.201308230935
Comment 7 Sönke Schwardt-Krummrich univentionstaff 2013-08-23 13:26:37 CEST
(In reply to Sönke Schwardt-Krummrich from comment #4)
> Traceback (most recent call last):
>   File "/usr/lib/univention-directory-listener/system/cyrus.py", line 260,
> in handler
>     move_cyrus_murder_mailbox(oldMailPrimaryAddress.lower(),
> newMailPrimaryAddress.lower())
>   File "/usr/lib/univention-directory-listener/system/cyrus.py", line 155,
> in move_cyrus_murder_mailbox
>     '%s: Cyrus Murder mailbox rename failed for %s' % (name, oldemail))
> NameError: global name 'oldemail' is not defined
> 21.08.13 02:20:23.563  LISTENER    ( WARN    ) : handler: cyrus (failed)

→ OK
 
> → FAIL: renaming and moving IMAP folders between servers in one step
>         → folder gets moved but not renamed

→ OK
 
(In reply to Erik Damrose from comment #5)
> - cyrus-mailboxrename.py was removed from the package
→ OK

> Fixed in univention-mail-cyrus univention-mail-cyrus 6.0.4-4.186.201308221351
> Changelog entry already present

→ OK
Comment 8 Stefan Gohmann univentionstaff 2013-11-08 08:38:23 CET
As described in the release notes. It is possible that mail boxes are deleted after a user change: http://docs.univention.de/release-notes-3.2-en.html#idp207712

The preup.sh script could check for these entries and block the upgrade.
Comment 9 Erik Damrose univentionstaff 2013-11-11 11:55:59 CET
The preup script has been updated with a check if mail/cyrus/mailboxes/delete is true. In this case, users with a primary mailaddress but without a mail home server are looked up. If users a found, an error is printed and the update aborted.

r45936: univention-updater 9.0.30-1.1225.201311111146
Comment 10 Sönke Schwardt-Krummrich univentionstaff 2013-11-11 17:48:25 CET
(In reply to Erik Damrose from comment #9)
> The preup script has been updated with a check if
> mail/cyrus/mailboxes/delete is true. In this case, users with a primary
> mailaddress but without a mail home server are looked up. If users a found,
> an error is printed and the update aborted.
> 
> r45936: univention-updater 9.0.30-1.1225.201311111146

An error message is shown but the update does not abort in preup.sh.
Comment 11 Erik Damrose univentionstaff 2013-11-12 14:00:37 CET
The preup change was reverted. Tests showed that no unwanted deletion occurs.

r45967 univention-updater 9.0.31-1.1226.201311121350
Release notes have been updated.
Comment 12 Sönke Schwardt-Krummrich univentionstaff 2013-11-12 14:55:13 CET
(In reply to Erik Damrose from comment #11)
> The preup change was reverted. Tests showed that no unwanted deletion occurs.

In short: the mailbox will be deleted if univentionMailHomeServer is unset in "new" and the old univentionMailHomeServer was equal to the local FQDN of the mail server.
So even if a new mail home server will be initially set during/after the update, the will be no loss of mailboxes. After this step, the behaviour of the listener module will be the same as in UCS 3.1.

OK: source code of cyrus.py
OK: preup revert

> r45967 univention-updater 9.0.31-1.1226.201311121350
> Release notes have been updated.

The release notes state that the mailbox gets removed if the mailHomeServer attribute gets removed from the user object. I think, this is ok. A detailed description would be too confusing.

OK: release notes
Comment 13 Stefan Gohmann univentionstaff 2013-11-19 06:42:40 CET
UCS 3.2 has been released:
 http://docs.univention.de/release-notes-3.2-en.html
 http://docs.univention.de/release-notes-3.2-de.html

If this error occurs again, please use "Clone This Bug".