Univention Bugzilla – Bug 56504
Change of users primary email address does not update existing fetchmail single drop configurations in /etc/fetchmailrc
Last modified: 2023-09-30 07:26:42 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)