Introducing QMF an advanced mobile messaging framework

The Qt Messaging Framework, QMF, consists of a C++ library and daemon server process that can be used to build email clients, and more generally software that interacts with email and mail servers. QMF is designed to be extensible to allow other types of internet and telephony messages to be handled. Currently QMF is ported to Linux and Microsoft Windows, other platforms will be ported to in the future. Check out the QMF source on Gitorious

There are currently no plans for QMF to become part of the Qt library, but it may subsequently be offered as a Qt solution. QMF does not provide the ability to create a cross platform application that uses the native messaging system on the underlying platform, such as the Symbian Messaging Framework on S60 or Microsoft MAPI on Windows Mobile. For more information on this topic please see the upcoming Qt Mobility Messaging labs blog entry.

QMF is a fully functional solution and comes with a demonstration mail client, called qtmail.

qtmail

The QMF library is used by both the QMF message server process and also by QMF client processes. The message server is a long lived process, responsible for performing synchronization with external mail servers, which are normally located on the internet. Clients use the QMF library to interact with the messaging server, internally IPC is used by the library implementation to communicate between the server and clients.

Messaging data is stored locally in a database (currently SQLite). Clients and the message server access the database using the QMF library, specifically through an interface consisting of a singleton class called QMailStore. QMailStore provides shared access to the database by using semaphores, and notifies clients of changes to the database using standard Qt signals.

The message server loads plugins, known as protocol plugins, at startup to communicate with external mail servers. Protocol plugins currently exist for IMAP, POP, and SMTP. New plugins may be implemented to allow communication using other protocols. Like the message server and clients, plugins use QMailStore to access the local messaging database. Additionally plugins use standard Qt network classes such as QSslSocket to communicate with external mail servers over TCP/IP connections.

QMF Architecture

QMF provides a number of features which are important for mobile computers.

The message server working with well implemented clients should operate within a fixed upper bound of memory. This is made possible by providing interfaces to partially retrieve message data, including both message attachments and message bodies, lists of messages in a folder, and lists of folders in an account. Large messages are efficiently handled with respect to memory by using the mmap function.

Push email functionality is provided as demonstrated by the IMAP Protocol Plugin which allows monitoring multiple mailboxes using IDLE. Additionally a complete implementation of the Lemonade standard is provided including forward without download, and quick resynchronization. Furthermore email metadata can be retrieved independently of messages, this metadata is analyzed to determine which parts of messages to download, and if necessary used to refresh the status of messages as they become visible. All of these techniques help to conserve bandwidth.

Round trips to external mail servers can be very expensive taking several seconds to complete. QMF eliminates unnecessary round trips by fetching data for multiple messages with a single IMAP instruction. QMF is also capable of pipelining commands to reduce round trips but this functionality has yet to be fully utilized.

Additionally QMF provides automatic detection of conversation threads by using messages headers, including the subject header. Conversations spanning multiple folders such as the inbox and sent folder are detected. A full featured searching and sorting interface is present, including multiple levels of sorting, as is a complete Boolean algebra filtering interface, that even allows filtering on custom fields. The disconnected access paradigm is supported by QMF. For a more complete description of QMF functionality see the documentation included in the source repository.

In summary QMF is an advanced mobile messaging framework.


Comments