[Kde-pim] A good way of using KIMAP to fetch only the new messages ?
Aditya Sharma
aditya.sharma15696 at gmail.com
Sun May 29 07:50:54 BST 2016
Hello,
I am working on KDE Now, for this year's GSoC. I am using the KIMAP[1]
library for implementing a client that will interact with mailboxes. On the
first run, my application will fetch messages. (LoginJob[2] -->
SelectJob[3] --> SearchJob[4] --> Add everything to ImapSet[5] -->
FetchJob[6] on the current ImapSet). After this, I'll save the maximum UID,
of an email in some text file.
For updates, I plan to use the IDLE feature of IMAP RFC. After the above
things, the connection goes into IDLE[7]. The KIMAP will signal me, when
mailBoxStats have changed. This time I will, (SelectJob --> SearchJob
(uidBased) --> Add things to ImapSet(based on UID's that are larger than
the last stored UID in text file) --> fetchJob)
Is there any other, better way of doing this ? That is, once I know that
new messages have arrived, I can fetch only the new ones. There seem to be
a few other things from the api, but the documentation is not helping me
much.
[1]: http://api.kde.org/4.x-api/pim-apidocs/kimap/html/namespaceKIMAP.html
[2]:
http://api.kde.org/4.x-api/pim-apidocs/kimap/html/classKIMAP_1_1LoginJob.html
[3]:
http://api.kde.org/4.x-api/pim-apidocs/kimap/html/classKIMAP_1_1SelectJob.html
[4]:
http://api.kde.org/4.x-api/pim-apidocs/kimap/html/classKIMAP_1_1SearchJob.html
[5]:
http://api.kde.org/4.x-api/pim-apidocs/kimap/html/classKIMAP_1_1ImapSet.html
[6]:
http://api.kde.org/4.x-api/pim-apidocs/kimap/html/classKIMAP_1_1FetchJob.html
[7]:
http://api.kde.org/4.x-api/pim-apidocs/kimap/html/classKIMAP_1_1IdleJob.html
Regards
Aditya
_______________________________________________
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