Bug 38458

Summary: Dovecot account rename support
Product: UCS Reporter: Daniel Tröder <troeder>
Component: Mail - DovecotAssignee: Daniel Tröder <troeder>
Status: CLOSED FIXED QA Contact: Sönke Schwardt-Krummrich <schwardt>
Severity: normal    
Priority: P5 CC: birkefeld, schwardt, walkenhorst
Version: UCS 4.0   
Target Milestone: ---   
Hardware: Other   
OS: Linux   
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: 38469    
Bug Blocks: 34839, 46749    

Description Daniel Tröder univentionstaff 2015-05-06 15:44:09 CEST
Listener module should move the home directory, when a mailPrimaryAddress changes. Sieve scripts should live inside the home directory.
Comment 1 Daniel Tröder univentionstaff 2015-05-13 17:38:28 CEST
The mail home is moved by a listener module (dovecot.py). SIEVE scripts are saved in the mail home, on the same level as the Maildir. If the source dir is missing or the target dir exists already, nothing is done.

Commits: 60611, 60645, 60648, 60726
Comment 2 Daniel Tröder univentionstaff 2015-05-15 13:17:13 CEST
Commit 60742 adds the option to not rename the mailbox if the email address changes.

New UCRV "mail/dovecot/mailbox/rename" mirrors the behaviour of mail/cyrus/mailbox/rename.
Comment 3 Sönke Schwardt-Krummrich univentionstaff 2015-06-30 00:19:43 CEST
Tested manually (especially sieve scripts) and automatically
→ 42_dovecot_rename_mail_primary_address
  → modification of the primary mail address with all combinations of …/rename 
    and …/delete
→ 42_dovecot_rename_user
  → modification of the username
Comment 4 Sönke Schwardt-Krummrich univentionstaff 2015-07-03 11:07:53 CEST
42_dovecot_rename_user currently fails → REOPEN. The pam cache does not get invalidated when a user is renamed (modrdn). Possible fix:


--- a/component/dovecot/univention-mail-dovecot/dovecot.py
+++ b/component/dovecot/univention-mail-dovecot/dovecot.py
@@ -106,6 +106,12 @@ def handler(dn, new, old, command):
 		return
 	elif command == 'a':
 		old = load_old(old)
+		try:
+			listener.setuid(0)
+			listener.run('/usr/bin/doveadm', ["/usr/bin/doveadm", "auth", "cache", "flush"], uid=0)
+		finally:
+			listener.unsetuid()
+
 
 	listener.configRegistry.load()
 	dl = DovecotUserListener(listener, name)
Comment 5 Daniel Tröder univentionstaff 2015-07-03 12:05:56 CEST
Commit 61723 applies proposed patch.
Comment 6 Sönke Schwardt-Krummrich univentionstaff 2015-07-03 14:48:19 CEST
(In reply to Daniel Tröder from comment #5)
> Commit 61723 applies proposed patch.

→ OK → VERIFIED
Comment 7 Janek Walkenhorst univentionstaff 2015-07-09 18:12:23 CEST
<http://errata.univention.de/ucs/4.0/237.html>