Univention Bugzilla – Bug 56426
Deleting single drop configuration via UMC does not remove corresponding entry in /etc/fetchmailrc
Last modified: 2023-11-29 14:56:11 CET
In UMC the deletion of a single drop configuration works without any errors, but the corresponding configuration entry in the /etc/fetchmailrc file remains. There is no error or debug message (level 4) in listener.log. When the user object is deleted completely the entry in fetchmailrc will be also removed successfully. In that case the listener.log contains: 14.08.23 12:51:35.627 LISTENER ( INFO ) : postrun handler: fetchmailrc (prepared=0) When the user has more than one single drop configurations only the last one deleted remains in fetchmailrc.
If, after editing a user, no fetchmail-drop configuration remains, the listener-script /usr/lib/univention-directory-listener/system/fetchmailrc.py does not get called due to its filter "filter = '(objectClass=univentionFetchmail)'" not matching the user object anymore. In this case there is _no_ entry "handler: fetchmailrc" found in the listener.log (debug level 3). In contrast to UCS4 in UCS5 there remains no objectClass=univentionFetchmail with the user object after removing all fetchmail-drop configurations from the user, resulting in the mentioned listener-script not to be called. To make the listener-script to be called also in this situation, one may change its filter and add attributes like in this diff: === code === root@ucs-1100:~# diff -u fetchmailrc.py /usr/lib/univention-directory-listener/system/fetchmailrc.py --- fetchmailrc.py 2023-08-11 14:33:20.755976279 +0200 +++ /usr/lib/univention-directory-listener/system/fetchmailrc.py 2023-08-11 16:59:23.124945681 +0200 @@ -47,7 +47,8 @@ description = 'write user-configuration to fetchmailrc' -filter = '(objectClass=univentionFetchmail)' +filter = '(univentionObjectType: users/user)' +attributes = ['univentionFetchmailSingle', 'univentionFetchmailMulti'] modrdn = "1" === code ===
Sorry for the typo. The correct diff would be as follows. === code === root@ucs-1100:~# diff -u fetchmailrc.py /usr/lib/univention-directory-listener/system/fetchmailrc.py --- fetchmailrc.py 2023-08-11 14:33:20.755976279 +0200 +++ /usr/lib/univention-directory-listener/system/fetchmailrc.py 2023-08-11 16:59:23.124945681 +0200 @@ -47,7 +47,8 @@ description = 'write user-configuration to fetchmailrc' -filter = '(objectClass=univentionFetchmail)' +filter = '(univentionObjectType=users/user)' +attributes = ['univentionFetchmailSingle', 'univentionFetchmailMulti'] modrdn = "1" === code ===
So the error happens when the object class univentionFetchmail is removed from the object e.g. because all fetchmail related attributes are removed. An alternative fix would be to set --set deleteObjectClass='0' to those 2 extended attributes. But the provided patch is probably better. We need a signed CLA to be allowed to use the patch: https://cla-assistant.io/univention/univention-corporate-server
Just have signed the CLA. Thanks. Christian Kowarzik <ckowarzik@posteo.de>
Changes: - Delete fetchmail configurations of a user from the fetchmailrc file when the last attribute is removed. Commits: univention-fetchmail.yaml c45a0bd79d31 | Bug #56482 Check that user has mailPrimaryAddress in Fetchmail listener univention-fetchmail (13.0.7-3) c45a0bd79d31 | Bug #56482 Check that user has mailPrimaryAddress in Fetchmail listener New version: Package: univention-fetchmail Version: 13.0.7-3 Branch: ucs_5.0-0 Scope: ucs5.0-5
QA: - Deleting single/multi drop fetchmail configurations via UMC removes corresponding entries in /etc/fetchmailrc even if they are the last remaining entries: OK - Advisories: OK
<https://errata.software-univention.de/#/?erratum=5.0x888>