Bug 232001

Summary: kmail does not honour umask on saving emails
Product: [Unmaintained] kmail Reporter: Jörg Steffens <joerg.steffens>
Component: mboxAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Patch for setting file permissions of saved email messages
2. veriosn of the patch, adding and using the function KMail::Util::getWritePermissions

Description Jörg Steffens 2010-03-24 14:38:39 UTC
Version:            (using KDE 4.3.5)
OS:                Linux
Installed from:    openSUSE RPMs

when saving an email to disk (right-click on email, save-as), kmail will store it with permissions 600.

I expected kmail to honour the umask instead.

This has been already considered as a bug for attachment, see https://bugs.kde.org/show_bug.cgi?id=79685

I expect the same behaviour for emails.
Comment 1 Jörg Steffens 2010-03-24 14:47:11 UTC
Created attachment 42227 [details]
Patch for setting file permissions of saved email messages

use the disregardUmask option to define, if file permission should be restrictive or the umask settings should be used.
Comment 2 Jörg Steffens 2010-03-24 14:49:21 UTC
patched version for openSUSE 11.2 can be found at http://download.opensuse.org/repositories/home:/steffens:/branches:/openSUSE:/11.2:/Update/standard/
Comment 3 Thomas McGuire 2010-03-25 22:32:18 UTC
Thank you for the patch, Jörg!
One little nitpick: The new code is duplicated, it would be much nicer to put it into a helper function, for example in kmail/util.cpp
Can you please submit an updated version of the patch to reviewboard.kde.org?
See http://techbase.kde.org/Contribute/Send_Patches for details.
Comment 4 Jörg Steffens 2010-04-13 17:58:03 UTC
Created attachment 42751 [details]
2. veriosn of the patch, adding and using the function KMail::Util::getWritePermissions

I agree. I summit a new version of this patch and will also provide it via reviewboard.
Comment 5 Jörg Steffens 2010-04-14 12:56:56 UTC
added at http://reviewboard.kde.org/r/3601/
Comment 6 Thomas McGuire 2010-04-18 23:12:11 UTC
SVN commit 1116206 by tmcguire:

Honor umask setting when saving mails.

BUG: 232001

Thanks to Jörg Steffens <joerg.steffens at dass-it dot de> for the patch!
I modified the patch slightly, to take into account duplicated code in
viewer_p.cpp and Ingo's suggestions.

 M  +3 -1      kmail/filterlog.cpp  
 M  +5 -5      kmail/kmcommands.cpp  
 M  +12 -0     messageviewer/util.cpp  
 M  +7 -0      messageviewer/util.h  
 M  +6 -6      messageviewer/viewer_p.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1116206