Re: Using a maildir or mh folder for the message cache?
Hi,
* Kyle Wheeler [06-08-08 13:33:36 -0400] wrote:
If you can fetch the UID and the flags from the IMAP server, I think you should be able to reconstruct the filename
("UID:2,FLAGS"), provided you can prevent people from modifying the filename on their own time.
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.
When you read your IMAP folder from another instance and change the
flags of a message there, another mutt again won't be abled to find it
even you add maildir flag semantics to filenames because the remote ones
differ from the local ones the local mutt last saw.
IMHO this leads to nothing being rock-stable against modifications so
that "ordinary" users can start viewing it.
Now, on the other hand, there's the mh format.
So, the problem with something like an mh folder is storage of flags (I think), because they store flags in an X-Status: header
much like an mbox (if memory serves). This should be easily solved by simply setting messages stored there to be read-only,
shouldn't they?
Yeah, but then the locally cached message is different from the local
one. Think of somebody adding the X-Status header in the local cache and
viewing the message from another client with all headers. They will
differ... which is confusing.
Well, but what about something like you suggested: symlinks. Like so:
#!/bin/bash
mkdir -p ./OfflineMaildir/cur
mkdir -p ./OfflineMaildir/new
mkdir -p ./OfflineMaildir/tmp
for F in $message_cache/* ; do
bname=`basename "$F"`
ln -s "$F" "./OfflineMaildir/cur/$bname:2,S"
done
chmod -R a-r ./OfflineMaildir
This is much to complicated:
#!/bin/sh
mkdir -p /tmp/foo/new
ln -s $message_cache/pops:.../ /tmp/b/cur
and add a folder-hook setting it read-only. With your one you don't win
much, IMHO.
Any flag-based mucking just twiddles the symlink, and the cache is left alone. (Obviously that would have to be edited before
being released as a general-purpose "cache-viewer.sh" sort of tool.)
Yeah, but you don't win anything at all.
The goal is to make it possible to view things semi-conveniently offline, not to
perfectly replace actually having a network connection.
Yeah, of course. But you can't view everything; just what you saw
already so this isn't even a "read-only offline cache".
bye, Rocco
--
:wq!