[Kde-pim] KIMAP library

Kevin Ottens ervin at kde.org
Tue Jul 27 08:45:23 BST 2010


On Monday 26 July 2010 01:08:09 Alex Merry wrote:
>   As you may have
noticed, I've been documenting the KIMAP library.

Welcomed by me, never got
around documenting it. :-)

> The reason for this is that I've run into some
problems with the Akonadi
> IMAP resource, and I would like to fix
them.

You might want to test using my refactoring branch as well. I'm
trying to get it to the point where it can replace what's in trunk, and some
of the trunk issues should be gone by now (I suspect it could have different
ones, but at least now we can add unit tests to it, so definitely more
future proof).

> 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).

Most of the XXX you pointed out are from jobs written
by Andras, so I'll let him provide more context about those and fixes
eventually.
 
> 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.

Indeed would
be a good thing to provide more type safety there. I'll welcome any patch in
that direction.

> 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.

Well, everything is
QByteArray in there *except*: mailbox, user name and password. That's mainly
for convenience reasons because we can safely assume they're handled as such
higher up in the stack (which is not guaranteed for the other
properties).

> 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.

Agreed.
That's definitely a missing bit we want to have covered later on. Right now
we're heavily assuming handling of UIDs as that's what the IMAP resource
does by default. But we also want to relax that constraint (as the "make it
work without UIDPLUS" bug report implies).

> I'm happy to work on these
issues (once I've figured out the testing
> framework)

If you need any help
with the unit tests feel free to ask me.

Regards.
-- 
Kévin Ottens,
http://ervin.ipsquad.net

KDAB - proud patron of KDE, http://www.kdab.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20100727/22797f84/attachment.sig>
-------------- next part --------------
_______________________________________________
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