<<< Date Index >>>     <<< Thread Index >>>

Re: Using a maildir or mh folder for the message cache?



Hi,

* Kyle Wheeler [06-08-08 14:56:03 -0400] wrote:
On Tuesday, August  8 at 06:21 PM, quoth Rocco Rutte:

Yepp, modification outside of mutt is the main problem. Note that mutt does manage the flags internaly regardless of the cache filename. The modification of the cache filename is only bad because you can't find it and will download it again.

Assuming that you don't do the equivalent of this:

  filename="$IMAP_UID:2,S"
  if [ -f $filename ] ; then
      readit
  else
      filename=`ls $IMAP_UID:2,*`
      readit
  fi

Which would slow down if and only if people are mucking with your cache underneath you. And since we can make it clear that mucking with the cache while using it as a cache is BAD, slowing it down only in that case isn't too bad.

Well, you can't really know that. In case you have a cache miss the filename either got changed or the message hasn't been seen. You always need to check for both and thus still check quite many files.

IMHO this leads to nothing being rock-stable against modifications so that 
"ordinary" users can start viewing it.

Why can't we simply twiddle the read/write bit on the directory so that 
"ordinary" users *can't* modify it?

So we need to modify the write permissions for every single add and remove operation all the time regardless of whether the user wants to read it offline.

I doubt TLR will allow this.

And which is why I suggested doing a chmod() on the messages in the cache so that other viewers CANNOT add their own X-Status header to the local cache, thus solving the problem.

That means that everytime you view a message, mutt will have to do three chmod() calls:

  1) make dir writeable
  2) make file non-writeable
  3) make dir non-writeable

Brendan even refused to accept my patch because it contained a pointless stat() call for IMAP messages which was needed as a workaround for bug in the POP code I didn't see earlier.

So from that point of view, I doubt such a patch will ever make it in.

It's better than nothing.

Of course. With large messages this is great. But using it as a readable folder isn't what it's supposed to do and it's pretty dangerous so I consider it abuse. And the manual even mentions the symlink possibility, so for now IMHO this is all we should do.

The key word in what I said was "semi-conveniently" not "perfect for all uses, cache of everything". We HAVE these messages stored on disk already, it seems a shame to be unable to use them (with anything other than "cat" or "less" or "more").

Well, I consider creating an empty dir and creating a symlink along with a folder-hook very a conventient way of abuse.

  bye, Rocco
--
:wq!