[Kde-pim] Q about CachedImap code

Till Adam adam at kde.org
Tue Apr 6 08:09:21 BST 2010


On Wednesday 31 March 2010 20:30:25 Thomas McGuire wrote:
> Hi,
> 
> I'm afraid I can't be of much help here, that goes deeper than I normally
>  look in the dIMAP code.
> 
> On Tuesday 30 March 2010 18:20:53 Adrian von Bidder wrote:
> > Working on my "fix Ignore Thread" challenge, I'm struggling with
> > kmail/kmfoldercachedimap.cpp (slotGetMessagesData):
> >
> >  * around line 1846 (KDE 4.4.2) there are some assumptions about the
> > ordering of the headers, in particular "X-Length" should be after
> > "X-UID". Where does this assumption come from?  Looking at some mail (as
> > displayed by kmail's "View Source" command) this assumption doesn't hold.
> >  Bug?  Or is the "entry" QByteArray not the raw message but does hold the
> > headers sorted?
> 
> No idea about the assumption.
> 
> >  * The code also tries to parse an X-Flags header.  I never see this
> > header, but I see a Status: and an X-Status header.  (Again, from within
> > kmail. I'll look at the on-disk files on the imap server when I'm onlie.)
> 
> No idea either, maybe it is just code to deal with legacy mails.

These are not normal email headers, but IMAP envelopes. They are guaranteed to 
be in that order. The syntax just happens to look like email headers, for 
easier parsing.

> >  * Finally, looking at messagestatus.cpp, it seems X-Status should
> > include "I" for ignored messages, but this is not always present.  Or
> > should it only be set on the top-level message of an ignored thread? 
> > (and if so: what about cases where mail arrives out of order and an
> > ignored thread getting a new top-level thread?  I'm not exactly certain,
> > but on a first glance it seems that ModelPrivate::attachMessageToParent
> > only goes in parent -> child direction, so it might be missing this
> > case.)
> 
> Again, no idea :(
> Could well be that the code does not deal with a parent that comes in
>  later.

It should. As far as I remember (I wrote the ignore stuff a long time ago), the 
flag is set on all mails in the thread, including propagating it to new, 
incoming mail that is sorted into the thread. All the code for that was in 
kmheaders.cpp, I guess it has moved into the message list now. IMAP does not 
know this flag, so if you want to store it there, it needs to be sent as a 
custom (kmail-specific) flag, which I think we do for "to do".

Till


_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/



More information about the kde-pim mailing list