It seems to me that the easiest way would be to use a gdbm file which
uses the maildir name as the key and the data is all the fields in the
header that would be userful.  (throw out the Recieved lines and other
misc junk that imap doesn't normally ask for) Then when the imap server
asks for header data that isn't in the dbm file it gets it out of the
message file and then stores it into the dbm file also.  When a message is
expunged right before it is deleted off the disk you delete it out of the
dbm file.  

If the dbm file isn't there no big deal it gets created... corruption
would be harder to detect assuming it was simply missing data... but 
since reading a message has to load the same fields that the dbm file has
you could do a store of the data when you read a message if there were
differences.

The problem I have with doing this, is what happens if the dbm file is
held on NFS.  The great thing aboug Maildir is that it is NFS "robust".
To add something like this will change that.  How does gdbm act if it goes
to read a record and because of NFS cacheing from another client only
half the record is there... that sort of thing... Otherwise I would have
written the code into the maildir.c file for UW's Imap long ago :)

-d.



+-----------------------------------------------------------------------+
|      David Galbraith    dgalb@              University Of New Mexico  |
|        Systems Analyst       unm.edu                (505)-277-8499    |
+-----------------------------------------------------------------------+

Reply via email to