Univention Bugzilla – Bug 44421
fetchmail settings remain in '/etc/fetchmailrc' after emptying the corresponding UMC fields
Last modified: 2019-01-03 07:19:20 CET
in our testing environment (10.200.42.10) and at a customer the 'fetchmailrc' entries for the fetchmail config of a user remain even after emptying all fields in the UMC → advanced settings: 'Remote mail retrieval'. Also the LDAP attributes remain at the user object. The reason is probably that you can not delete the configuration via the UMC but only emptying the existing fields, and these fields remain behind once set.
Created attachment 8795 [details] univention-fetchmal-remove.sh The attached bash script might be a useful workaround but is not yet tested. I only tried it in a testing environment on a slave where Fetchmail is installed. It checks some environmental things and if they are true it creates a backup of the udm object as well as of the 'fetchmailrc' and removes the fetchmail config of the given user via udm and also the corresponding lines from '/etc/fetchmailrc'.
According to the Script '/usr/lib/univention-directory-listener/system/fetchmailrc.py' in method 'details_complete' (line 130) it is checked if an attribute is not existing (line 139) but it always will, it's value is just set to NONE. Due to this both deleting checks (line 180, 185) are wrong and the fetchmail config is not removed from /etc/fetchmailrc
Created attachment 8798 [details] univention-fetchmal-remove.sh use UID instead of primaryMailAddress to find entry in fetchmailrc
(In reply to Nico Stöckigt from comment #2) > According to the Script > '/usr/lib/univention-directory-listener/system/fetchmailrc.py' in method > 'details_complete' (line 130) it is checked if an attribute is not existing > (line 139) but it always will, it's value is just set to NONE. I can only think of the case, that obj.get(attr) returns [''] or [None]. Since bool(['']) is True, "complete" is not set to False. If the "attr" is not set in "obj", obj.get(attr) returns just None.
(In reply to Sönke Schwardt-Krummrich from comment #4) > (In reply to Nico Stöckigt from comment #2) > > According to the Script > > '/usr/lib/univention-directory-listener/system/fetchmailrc.py' in method > > 'details_complete' (line 130) it is checked if an attribute is not existing > > (line 139) but it always will, it's value is just set to NONE. > > I can only think of the case, that obj.get(attr) returns [''] or [None]. > Since bool(['']) is True, "complete" is not set to False. > If the "attr" is not set in "obj", obj.get(attr) returns just None. whatever the reason is, that a users fetchmail configuration is not removed / removable, should be fixed. Probably the best way is a button [remove;clear;...] in the UMC to do that job?
I can't reproduce this. I removed the values for "Username" and "Remote mail server" in UMC. After this the fetchmail configuration is emtpy again.
Happend again: https://help.univention.com/t/mailabruf-eines-nutzers-wieder-stoppen/5959
This issue has been filled against UCS 4.1. The maintenance with bug and security fixes for UCS 4.1 has ended on 5st of April 2018. Customers still on UCS 4.1 are encouraged to update to UCS 4.3. Please contact your partner or Univention for any questions. If this issue still occurs in newer UCS versions, please use "Clone this bug" or simply reopen the issue. In this case please provide detailed information on how this issue is affecting you.