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

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



On Tuesday, August  8 at 07:48 PM, quoth Rocco Rutte:
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.

Fair enough.

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

Well, I don't think you need to fiddle with the directory flags if you're using mh-style storage. The directory can stay read/writeable, because (correct me if I'm wrong), you're not supposed to modify file names in an mh folder. Viewing a message you've never seen, then, merely requires that you chmod() it to be unwriteable after you finish delivering it to the mh folder (small race condition, but I think we can ignore that). Viewing a message you've seen before requires no chmod()'ing.

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.

If that's your final word on it, then okay, but let's at least document it. The whole subject came up because a user posed the question: "so I have these things stored on disk somewhere, I know I do, can I see them?"

~Kyle
--
Morality, like art, means drawing a line someplace.
                                                       -- Oscar Wilde

Attachment: pgpPxxlgAu9kX.pgp
Description: PGP signature