[Kde-pim] KIMAP library

Alex Merry kde at randomguy3.me.uk
Mon Jul 26 00:08:09 BST 2010


  As you may have noticed, I've been documenting the KIMAP library.  The 
reason for this is that I've run into some problems with the Akonadi 
IMAP resource, and I would like to fix them.  Documenting the KIMAP 
library seemed like a good way of learning about the IMAP protocol and 
Akonadi's implementation of it.

While I've been doing this, I've noticed some issues - you can see them 
by grepping KIMAP's source code for the string "XXX".  Some of them are 
small potential bugs (I haven't just fixed them because I haven't 
figured out the testing infrastructure yet to make sure they really are 
bugs).

There are also some more general issues, though.  One is quoting command 
arguments - mailbox names appear to be properly quoted and escaped.  
However, various other strings are just shoved into a command with 
quotes around them, with no attempt to escape special characters (and 
the IMAP protocol places no particular constraints on those strings) - 
quote roots are an example of this.  Perhaps a generic way of building 
commands would be useful.  Being able to do something like
Command command = m_session->createCommand("FOO");
command << Command::Argument::atom("ARG1") << 
Command::Argument::list(some QStringList);
and have that deal with quotations and multi-line continuations might be 
a good way to make things consistent.

There also appears to be no consistency when it comes to types of 
arguments - some things are QStrings and some QByteArrays when the type 
in the IMAP formal syntax is the same.  But I guess there's nothing to 
be done about that during KDE 4.

A more structural issue is that, unless I'm missing something, clients 
created using KIMAP won't interact well with other clients, particularly 
if they make use of sequence numbers rather than UIDs.  The reason for 
this is that nothing appears to listen for EXPUNGE responses, except for 
the ExpungeJob, or RECENT or EXISTS responses, except for SelectJob and 
IdleJob (and the latter only accepts them in pairs - ie: it assumes all 
mailbox size changes are new emails being delivered).  Note that this 
means that clients created with KIMAP can't conform to RFC 3501, which 
says that clients must record these responses, which may be sent while 
(almost) any command is in progress.

I'm happy to work on these issues (once I've figured out the testing 
framework) - please let me know whether I've misunderstood something and 
what you think about potential solutions to the general/structural issues.

Alex


_______________________________________________
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