[Kde-pim] [PATCH] fix IMAP filtering (Bug 95064)

Thomas Neumann tneumann at users.sourceforge.net
Sun Oct 26 19:19:39 GMT 2008


Hi,

the attached patch fixes filtering for online IMAP accounts (Bug 95064).
What it basically does is avoiding duplicate filtering (see below for a
discussion). There might be a simpler way to achieve the same goal, but
I could not come up with an alternative strategy that is as robust
regarding IMAP server behavior.

The basic problem is as follows: A new message arrives, KMail filters
it, and updates the filtered result back on the IMAP server. Due to the
asynchronous execution if IMAP accesses, it can happen that KMail sees
its own update (which is a delete+insert) as new mail, triggering a new
filter run (and creating a duplicate in some cases, otherwise just
filtering and re-filtering all over).

The way I avoided this problem was to add a "filtered" flag in
MessageStatus, explicitly keeping track of already filtered messages
and refusing to filter them again. I don't think this can be avoided,
as all operations are asynchronous (e.g., new messages might arrive
in-between) and there does not seem to be a foolproof way to detect
that the "new" mail is really caused by an update.

Comments/suggestions welcome, if you think this is the right approach
please commit it, as I do not have SVN write access.

Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: imapfiltering.patch
Type: text/x-patch
Size: 5155 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20081026/3a8c5d41/attachment.bin>
-------------- 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