Bug 56504 - Change of users primary email address does not update existing fetchmail single drop configurations in /etc/fetchmailrc
Change of users primary email address does not update existing fetchmail sing...
Status: NEW
Product: UCS
Classification: Unclassified
Component: Listener (univention-directory-listener)
UCS 5.0
Other Linux
: P5 normal (vote)
: ---
Assigned To: UCS maintainers
UCS maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2023-08-30 12:08 CEST by Christian Kowarzik
Modified: 2023-09-30 07:26 CEST (History)
1 user (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 4: Minor Usability: Impairs usability in secondary scenarios
Who will be affected by this bug?: 3: Will affect average number of installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.137
Enterprise Customer affected?: Yes
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 Christian Kowarzik 2023-08-30 12:08:25 CEST
Lister-Script /usr/lib/univention-directory-listener/system/fetchmailrc.py does not check for change of users attribute 'mailPrimaryAddress' to update existing fetchmail single drop configurations.

Suggested diff agains univention-fetchmail-13.0.6-5 to solve this issue:

=== code ===
root@ucs-2201:~# diff -u fetchmailrc.py /usr/lib/univention-directory-listener/system/fetchmailrc.py
--- fetchmailrc.py      2023-08-30 11:16:46.394450174 +0200
+++ /usr/lib/univention-directory-listener/system/fetchmailrc.py        2023-08-30 11:18:24.801091867 +0200
@@ -47,7 +47,8 @@
 
 
 description = 'write user-configuration to fetchmailrc'
-filter = '(objectClass=univentionFetchmail)'
+filter = '(univentionObjectType=users/user)'
+attributes = ['univentionFetchmailSingle', 'univentionFetchmailMulti', 'mailPrimaryAddress']
 
 modrdn = "1"
 
@@ -212,6 +213,8 @@
 
     flist = load_rc(fn_fetchmailrc)
     if new:
+        old_mail = old.get('mailPrimaryAddress', [b''])[0]
+        new_mail = new.get('mailPrimaryAddress', [b''])[0]
         old_single = old.get('univentionFetchmailSingle', [])
         new_single = new.get('univentionFetchmailSingle', [])
         old_multi = old.get('univentionFetchmailMulti', [])
@@ -221,7 +224,7 @@
         # Bug 55882: Compatibility with old attributes.
         oldatt_passwd = new.get('univentionFetchmailPasswd', [get_pw_from_rc(flist, old_uid)])[0]
 
-        if old_single != new_single or old_multi != new_multi or old_uid != new_uid:
+        if old_single != new_single or old_multi != new_multi or old_uid != new_uid or old_mail != new_mail:
             flist = objdelete(flist, old)
             objappend_single(flist, new, oldatt_passwd)
             objappend_multi(flist, new)
=== code ===

Note: Above diff includes also possible solution for Bug https://forge.univention.org/bugzilla/show_bug.cgi?id=56426 (Deleting single drop configuration via UMC does not remove corresponding entry in /etc/fetchmailrc)