Bug 138445

Summary: Can't read read-only MBOX files
Product: [Applications] kmail Reporter: Martin Scharrer <bugreport>
Component: mboxAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: bjoern, peter.parzer
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In: 4.14.5

Description Martin Scharrer 2006-12-06 14:01:51 UTC
Version:            (using KDE KDE 3.5.5)
Installed from:    Gentoo Packages
Compiler:          gcc (GCC) 4.1.1 (Gentoo 4.1.1-r3) 
OS:                Linux

When I make a mbox file in ~/Mail read-only KMail brings
a KNotify warning window:

Cannot open file "/home/<user>/Mail/<mbox name>":
Permission denied

It seems that KMail is only trying to open the mbox read-write and has no read-only fallback.

I see this as a bug because it doesn't allow for 'archive' mbox files which should be still read- and searchable by KMail but should not be changed any more.
Also a selectable property 'read-only' for the mbox in KMail would be a wishable feature.

NOTE: This worked in a older version of KMail (ca. 3 Years ago), also e.g. symlinking a mbox to a CD or other ro memory: 
mbox -> /media/cd/mbox 
worked very well.
Comment 1 Björn Ruberg 2010-01-01 22:39:30 UTC
Confirmed in KDE 4.3. But I think kmail relies on the writing ability for changing the status of message i.e.
Comment 2 Björn Ruberg 2010-01-03 00:31:54 UTC
*** Bug 161457 has been marked as a duplicate of this bug. ***
Comment 3 Martin Koller 2015-01-30 19:12:05 UTC
Git commit 4a4a56b3d64d518a881a08c32dc51138909613b7 by Martin Koller.
Committed on 30/01/2015 at 19:00.
Pushed by mkoller into branch 'KDE/4.14'.

Fix handling of read-only mbox files

Up till now a read-only mbox file could not be loaded, since load()
always tried to open in read-write mode.
Now it first tries to open the file readWrite and if that fails,
it retries readOnly.
Also one can now explicitely tell the class to open the file readOnly
even if it could be written.
Related: bug 323872
FIXED-IN: 4.14.5
REVIEW: 122255

M  +19   -2    kmbox/mbox.cpp
M  +30   -4    kmbox/mbox.h
M  +11   -4    kmbox/mbox_p.cpp
M  +46   -0    kmbox/tests/mboxtest.cpp
M  +1    -0    kmbox/tests/mboxtest.h

http://commits.kde.org/kdepimlibs/4a4a56b3d64d518a881a08c32dc51138909613b7