VM

Visiting read-only folders

Bug #1077862 reported by Uday Reddy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
VM
Fix Committed
Medium
Uday Reddy

Bug Description

Julian Bradfield reports (viewmail-info, 2012-02-14):

VM is behaving badly with read-only folders.

If I visit a folder read-only, I don't expect it to be changed and
written back to disk. However, this happens:

(a) If I visit a folder created by my MTA, VM says "upgrading
    attributes", and then the folder is modified, and VM writes it
    back to disk when I quit. This of course causes corruption if the
    MTA is writing new mail at the same time, since they use different
    locking mechanisms.
(b) If I visit a virtual read-only folder, and then I change the
    attributes of a message (by, say, filing it), the underlying
    folder has its attributes changed and gets written when I quit the
    virtual folder. I don't think this is right either.

My understanding of a read-only folder is that nothing I do to it
should cause any modification of the disk file.

Tags: 7.19 save

Related branches

Revision history for this message
Uday Reddy (reddyuday) wrote :

(viewmail-info, 2012-02-14):

I don't think that that kind of semantics has ever been promised for
`vm-folder-read-only'. Actually, I don't find it documented in the manual
at all, which means to me that no promises were ever made.

...

If you do not want a folder changed, your best bet is to use
`vm-quit-no-change' when you are done.

We can discuss assigning a strong semantics to read-only, but I suspect that
it may be difficult to implement. "Upgrading attributes", for example,
needs to be done when an old folder is read because the new code base will
only work with the upgraded version of data. We can perhaps refrain from
writing the folder back to the disk at the end if the read-only flag is set.

Revision history for this message
Uday Reddy (reddyuday) wrote :

(viewmail-info, 2012-11-12):

Rethinking this issue, I think there has been a general misunderstanding of
what it means for a folder to be visited read-only. As the doc string of
`vm-visit-folder' says, visiting a folder read-only just means that "no
attribute changes, messages additions or deletions will be allowed in the
visited folder." It does NOT mean that the folder buffer will not be
modified or that the folder on disk will be preserved.

(There might also have been a traditional view that vm is just an Emacs mode
for viewing a mail folder on disk. That view is not valid any more. There
could be changes made to the cached data headers, messages might move in and
out of the IMAP cache folders etc. VM is evolving into a mail-reading
front-end that can transparently handle a variety of message stores at the
back end. A mail folder on disk is just one possible back end.)

If people want read-only folders to be preserved on disk, the best way to
achieve it is via `vm-quit'. As I have mentioned earlier
`vm-quit-no-change' can be used to quit folders without saving to disk. If
that is too much trouble to use, I can modify the standard `vm-quit' to
refrain from saving read-only folders. That might in fact be the best
solution for the kind of things you want to do.

Revision history for this message
Uday Reddy (reddyuday) wrote :

Modified `vm-quit' and added a variable `vm-preserve-read-only-folders-on-disk'. (Revision 1441.)

Changed in vm:
status: Triaged → Fix Committed
Uday Reddy (reddyuday)
Changed in vm:
milestone: 8.2.2a → 8.2.1a
Uday Reddy (reddyuday)
Changed in vm:
milestone: 8.2.1a → 8.2.90a
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.