As you might now, we are currently porting KMail to Akonadi. The Akonadi-based KMail will be called KMail 2 and released together with KDE SC 4.5 if everything goes well.

Just a quick summary of what Akonadi is, for those who don’t know: Akonadi is an abstraction layer/proxy and a cache for PIM data.

PIM data can by anything like mails, contacts or calendar entries, and they can come from different sources, like an IMAP server, a

local vCard file or an Exchange server. Akonadi provides an easy API for the client application developer to access that PIM data

in a transparent way.

This post is about Nepomuk, not Akonadi. Akonadi uses Nepomuk to index the mails. Basically this means every mail that was seen by the Akonadi cache is also indexed by Nepomuk. This makes some great features possible, which I’ll describe below. With screenshots!

Powerful searches

The main benefit of Nepomuk is that we can do very powerful searches. KMail 1 had a search function as well, and even virtual folders. Those however were so slow that they were basically unusable.

With Nepomuk-powered searches, this is different: The searches are quite fast, and because they run in another process, the KMail GUI is not slowed down by searches anymore. Now it is for example possible to have a virtual folder with all messages marked as to-do or important.

Speed is not the only thing that is improved: The search results are now much, much better. We can now search in attachments and also optionally in encrypted mails. We can even do powerful semantic searches, for example linking mails with contacts. One example is “search all mails sent by persons who are tagged with ‘boss'”, since you can now tag contacts in KAddressbook.

Because Nepomuk indexes the mails, they will now show up in KRunner when you type something there. The amount of mails it finds for a given search term is so powerful that it is downright scary: when typing your name, it finds mails sent by you, sent to you, mentioning you or even mails in which you are mentioned in some attachment.

To conclude, searches in KMail 2 will rock!

Tagging

In KMail 2, we now use Nepomuk for all our tagging needs, instead of relying on some home-brewn system. The big advantage of course is integration with the rest of KDE, for example an application showing you every thing that is tagged with a certain tag can now also show the tagged mails. And KRunner will also display mails when you search for a tag.

We also have a Nepomuk tag resource, which shows one folder for each tag, with the tagged mails inside. When you drag a mail into such a folder, it will even get tagged automatically. Again this is powered by Nepomuk searches behind the scenes.

Below two screenshots showing how to tag a mail, and how the tag folders look. Please ignore the horrible colors, I was just testing the function that tags can change the text and background color.

Annotations

Having annotations for mails is a much requested feature. Often, people want to attach a little note to a mail where they can put some text in. Now, which technology could we use for annotations? Right, Nepomuk! I implemented annotation support today, and I have to say it was pleasantly easy to do so.

In KMail 2, you can now add a note to a mail. The mail list shows a little icon when a mail has a note attached, and you can edit the note by clicking it, or by using the appropriate action from the main menu.

Below are some screenshots which shows how to use annotations.

Did you notice the tooltip in the last screenshot? The note you have added to the mail also shows up in the tooltip. Even better: The tooltip shows a short preview of the mail text now, for mails that are indexed by Nepomuk. It was again really simply to get that information out of Nepomuk.

Closing

I hope I could give you a glimpse at the nice improvements related to Nepomuk which will be available in KMail 2.

So when can you use that cool stuff?

KMail 2 is currently under heavy development, right now it should not be used at all 🙂 In the past, we have been working in a separate branch, the akonadi-ports branch. That branch will now be merged back to trunk during the next days. If you are a user who follows trunk, you should switch to the 4.4 branch. Otherwise you’ll see a big fat warning when starting KMail 2.

Right now there are quite many bugs and regressions in KMail, the Akonadi port is probably comparable with the KDE3 to KDE4 port, if not worse. We hope to stabilize KMail 2 so that it becomes usable soon, and if everything goes well, it can be released together with KDE SC 4.5.

Helping hands for the work on KMail 2 are very welcome, there is a huge amount of stuff to fix where you could help us. Find us in #kontact or #akonadi on IRC, or on the kde-pim mailing list.