Bug 38473

Summary: Mail quota policy should be installed by univention-mail-cyrus
Product: UCS Reporter: Daniel Tröder <troeder>
Component: Mail - DovecotAssignee: Sönke Schwardt-Krummrich <schwardt>
Status: CLOSED FIXED QA Contact: Daniel Tröder <troeder>
Severity: normal    
Priority: P5 CC: schwardt, walkenhorst
Version: UCS 4.0   
Target Milestone: ---   
Hardware: Other   
OS: Linux   
See Also: https://forge.univention.org/bugzilla/show_bug.cgi?id=38980
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:
Bug Depends on:    
Bug Blocks: 34839    

Description Daniel Tröder univentionstaff 2015-05-06 19:24:48 CEST
Dovecot will use extended attributes of user accounts and not a policy, so the policy must be installed only by univention-mail-cyrus.
Comment 1 Daniel Tröder univentionstaff 2015-06-09 13:30:22 CEST
Commit 61136

The policy installation has been moved from the univention-directory-manager-modules package to the univention-mail-cyrus package.
Comment 2 Sönke Schwardt-Krummrich univentionstaff 2015-07-03 15:37:51 CEST
From 81univention-mail-cyrus.inst:
> ucs_registerLDAPExtension "$@" --udm_module /usr/share/pyshared/univention/admin/handlers/policies/mailquota.py || die

The mailquota.py file should not be installed directly under /usr/share/pyshared/.
ucs_registerLDAPExtension takes the file, stores it in LDAP, and the listener modules install the module in the same path as mentioned above. It would be better if the file is installed in /usr/share/univention-mail-cyrus/....
→ REOPEN

QA missing:
- master + slave environment; univention-mail-cyrus installed on master; update to latest dovecot scope → problems on dc slave due to double UDM module?
- functional test for cyrus
- update of existing OX environment
Comment 3 Daniel Tröder univentionstaff 2015-07-04 11:16:48 CEST
Commit 61766 installs the mail quota policy module outside /usr/share/pyshared/, and lets ucs_registerLDAPExtension copy it there.
Comment 4 Sönke Schwardt-Krummrich univentionstaff 2015-07-08 13:11:04 CEST
> Commit 61766 installs the mail quota policy module outside
> /usr/share/pyshared/, and lets ucs_registerLDAPExtension copy it there.

→ OK

> QA missing:
> - master + slave environment; univention-mail-cyrus installed on master;
> update to latest dovecot scope → problems on dc slave due to double UDM
> module?

There is no double UDM module since mailquota.py from the package is overwritten by the LDAP version. 
BUT...
If the package python-univention-directory-manager is updated, mailquota.py is removed because it is no longer part of that package. Though the LDAP version is not rerewritten to disk, so the UDM module is missing on all non-mailserver systems in Domain.

Workaround:
- in preinst: make a backup copy if md5sum of mailquota.py does not match md5sum of package list
- in postinst: if exists, restore backup copy
Comment 5 Sönke Schwardt-Krummrich univentionstaff 2015-07-08 15:09:28 CEST
(In reply to Sönke Schwardt-Krummrich from comment #4)
> Workaround:
> - in preinst: make a backup copy if md5sum of mailquota.py does not match
> md5sum of package list
> - in postinst: if exists, restore backup copy

This has now been implemented.
→ switching assignee and QA person

r61892 | Bug #38473: fixed logic for mailquota.py backup
r61879 | Bug #38473: comment update
r61877 | Bug #38473: handle corner case during update

> - functional test for cyrus

→ OK

> - update of existing OX environment

→ basic test was successful, complete test via Bug #38463
Comment 6 Daniel Tröder univentionstaff 2015-07-08 21:54:37 CEST
(In reply to Sönke Schwardt-Krummrich from comment #5)
> (In reply to Sönke Schwardt-Krummrich from comment #4)
> > Workaround:
> > - in preinst: make a backup copy if md5sum of mailquota.py does not match
> > md5sum of package list
> > - in postinst: if exists, restore backup copy
> 
> This has now been implemented.
> → switching assignee and QA person
In a test scenario a master with a cyrus installation was updated. Then a slave without Cyrus was updated. The quota policy file (replicated from the master) remained, but the policy was deactivated. → OK.

Then on the slave univention-mail-cyrus was installed, but the quota policy was not activated. All files seem to be in place, except for the symlink to the python policy file. → reopend.
Comment 7 Sönke Schwardt-Krummrich univentionstaff 2015-07-08 23:43:23 CEST
a) second part of workaround was placed in 
   univention-directory-manager-tools.postinst which is obviously wrong → moved 
   code to python-univention-directory-manager.postinst
b) added following call in postinst, to restore missing symlinks:
   update-python-modules -v \
        /usr/share/python-support/univentionUDMModule_policies_mailquota.public

r61963 | Bug #38473: moved workaround between postinst files / call update-python-modules after restoring mailquota.py

univention-directory-manager-modules has been rebuilt in errata4.0-2
Comment 8 Daniel Tröder univentionstaff 2015-07-09 00:24:43 CEST
(In reply to Sönke Schwardt-Krummrich from comment #7)
> a) second part of workaround was placed in 
>    univention-directory-manager-tools.postinst which is obviously wrong →
> moved 
>    code to python-univention-directory-manager.postinst
> b) added following call in postinst, to restore missing symlinks:
>    update-python-modules -v \
>        
> /usr/share/python-support/univentionUDMModule_policies_mailquota.public
> 
> r61963 | Bug #38473: moved workaround between postinst files / call
> update-python-modules after restoring mailquota.py
> 
> univention-directory-manager-modules has been rebuilt in errata4.0-2
Quota policy module is installed and activated on slave. → OK.
Comment 9 Janek Walkenhorst univentionstaff 2015-07-09 18:08:51 CEST
<http://errata.univention.de/ucs/4.0/235.html>
Comment 10 Janek Walkenhorst univentionstaff 2015-07-09 18:09:17 CEST
<http://errata.univention.de/ucs/4.0/236.html>