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

Re: [RFC] header+body caching for POP



Hi,

* TAKAHASHI Tamotsu [06-05-12 12:20:52 +0900] wrote:
* Wed May 10 2006 Rocco Rutte <pdmef@xxxxxxx>

With version 16 of the patch I also removed some other changes so the diff gets smaller. With it I can view messages with $message_cachedir unset just fine (and can't remember to have seen the DELE -1 issue, btw.)

Version 16 works fine, thanks.
The patch looks clean, and has proper comments.

Cool, thanks!

I think it is ready to be included.

I still need to do an update after the type-safety patch gets committed but except that I found it stable.

One big issue still open in this patch is support for flags for POP folders. Right now with my patch, only 'read' and 'new' are faked through the body cache (if we have cached the body already, the message is marked as read and new otherwise).

But, with header caching we can have full flag support easily. But this requires more work for doing it right.

IMHO this patch (or similar) should go in. Afterwards I'd like to do this (as I did more or less for muttng): add mx_check_acl() which checks for ACL bits which are roughly taken from the IMAP part. With this, I would like to move the ACL checks out to mbox.c, mh.c, imap/imap.c and pop.c for real abstraction so that mx_check_acl() is just a wrapper with a switch statement.

In pop.c I then could implement mutt_pop_check_acl() to decide depending on $header_cache whether an operation is allowed or not. This would render the IMAP_ACL_CHECK() macro for "just" IMAP superflous, we could have less #ifdef... and the code would be better in general.

Like in curs_main.c for OP_FLAG_MESSAGE. Now there is:

    CHECK_IMAP_ACL(IMAP_ACL_WRITE);
  #ifdef USE_POP
    if (Context->magic == M_POP)
    {
      /* error */
    }
  #endif

as well as lots of similar examples not only for index but also for the pager. Note that CHECK_IMAP_ACL() contains the very same error handling code as in the {}-block for POP. With my idea of refactoring we'd just have:

    CHECK_ACL(ACL_MSG_FLAG);

with the same error handling as CHECK_IMAP_ACL() now has. And that's it.

Any comments, thoughts and suggestions?

  bye, Rocco
--
:wq!