Bug 56426 - Deleting single drop configuration via UMC does not remove corresponding entry in /etc/fetchmailrc
Deleting single drop configuration via UMC does not remove corresponding entr...
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Listener (univention-directory-listener)
UCS 5.0
Other Linux
: P5 normal (vote)
: UCS 5.0-5-errata
Assigned To: Juan Carlos
Christian Castens
https://git.knut.univention.de/univen...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2023-08-14 14:32 CEST by Wolfgang Bayrhof
Modified: 2023-11-29 14:56 CET (History)
4 users (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: 2023080321000237, 2023081121000196
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 Wolfgang Bayrhof univentionstaff 2023-08-14 14:32:48 CEST
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.
Comment 1 Christian Kowarzik 2023-08-17 12:10:06 CEST
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 ===
Comment 2 Christian Kowarzik 2023-08-17 12:17:20 CEST
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 ===
Comment 3 Florian Best univentionstaff 2023-08-28 09:44:32 CEST
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
Comment 4 Christian Kowarzik 2023-08-28 11:32:21 CEST
Just have signed the CLA.
Thanks.
Christian Kowarzik <ckowarzik@posteo.de>
Comment 6 Juan Carlos univentionstaff 2023-11-10 13:03:11 CET
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
Comment 7 Christian Castens univentionstaff 2023-11-28 10:32:54 CET
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