On Wed, 2008-06-04 at 12:09 +0200, Anders wrote:
Also, the W=nnnn size thing is not added to filenames when using -p.
And cache isn't updated either. These are because hard linking can be done without actually reading the mail contents. I won't fix this for v1.1, but I updated the documentation.
I'm not sure what the best final solution to this is though. There could of course be a special deliver-check when the reading is done, but COPY command has the same problem. Should it read the files or not? If the file contents are already in memory it would be a good idea to read them and update cache, but otherwise not. I guess mincore() is the only potential way to check that, but mmaping the file only to check that is probably more trouble than worth.
For the delivery case, the mail will obviously be in memory, as we have just written it to a temporary file. Is it more than a few lines of code to add an index update to deliver.c after the hardlink? I might want to have that as a local patch.
I'm not sure. Maybe it wouldn't be too difficult.
As an alternative, can I call something from my wrapper script to have the index updated after delivery? I guess this will be impossible in the general case, as there is no way to know where Sieve decided to put the mail.
You could do e.g.:
1 fetch * bodystructure
But this assumes that client is interested of bodystructure, otherwise it pollutes the cache with an unnecessary field. You could also check if:
1 search * body asdf
updates cache. I vaguely remember that it does, but I'm not sure. idxview anyway shows what exists in cache.
I am not sure how important the update is in our case, anyway. Most people have the MUA open all day, and I guess a client in IDLE will fetch the headers and have the index updated immediately, right?
With most clients, yes.