Bug 44421 - fetchmail settings remain in '/etc/fetchmailrc' after emptying the corresponding UMC fields
fetchmail settings remain in '/etc/fetchmailrc' after emptying the correspond...
Status: RESOLVED WONTFIX
Product: UCS
Classification: Unclassified
Component: Mail
UCS 4.1
Other Linux
: P5 normal (vote)
: ---
Assigned To: Mail maintainers
Mail maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-04-20 17:25 CEST by Nico Stöckigt
Modified: 2019-01-03 07:19 CET (History)
3 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 5: Major Usability: Impairs usability in key 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.171
Enterprise Customer affected?: Yes
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2017041921000324
Bug group (optional):
Max CVSS v3 score:


Attachments
univention-fetchmal-remove.sh (2.52 KB, application/x-shellscript)
2017-04-21 13:19 CEST, Nico Stöckigt
Details
univention-fetchmal-remove.sh (2.44 KB, application/x-shellscript)
2017-04-21 16:32 CEST, Nico Stöckigt
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nico Stöckigt univentionstaff 2017-04-20 17:25:38 CEST
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.
Comment 1 Nico Stöckigt univentionstaff 2017-04-21 13:19:14 CEST
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'.
Comment 2 Nico Stöckigt univentionstaff 2017-04-21 15:39:14 CEST
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
Comment 3 Nico Stöckigt univentionstaff 2017-04-21 16:32:17 CEST
Created attachment 8798 [details]
univention-fetchmal-remove.sh

use UID instead of primaryMailAddress to find entry in fetchmailrc
Comment 4 Sönke Schwardt-Krummrich univentionstaff 2017-04-25 10:43:34 CEST
(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.
Comment 5 Nico Stöckigt univentionstaff 2017-04-25 11:37:17 CEST
(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?
Comment 6 Florian Best univentionstaff 2017-04-26 17:34:08 CEST
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.
Comment 7 Daniel Tröder univentionstaff 2017-06-19 08:55:23 CEST
Happend again: https://help.univention.com/t/mailabruf-eines-nutzers-wieder-stoppen/5959
Comment 8 Stefan Gohmann univentionstaff 2019-01-03 07:19:20 CET
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.