LWN.net Logo

Connecting to Microsoft Exchange with OpenChange

October 13, 2008

This article was contributed by Tom Chance.

Working with a Windows network from Linux has never been a smooth ride. While Samba, Wine and OpenOffice.org have made many components workable, connecting to the Microsoft Exchange email server has remained unreliable. Now the OpenChange developers hope to change that, providing the same capabilities as Microsoft Outlook in a range of Linux-native clients like Kontact and Evolution. OpenChange is not yet workable, but partial operation can demonstrate its potential.

If you want to connect to Exchange at the moment, you have a few options. Evolution can connect using a hack with Outlook Web Access, providing email, shared folders, calendars and contacts. But it's far from reliable; I tried to get by with it at the office, warts and all, and managed it for a couple of weeks before resigning myself to Windows. The other options are even worse -- just use the webmail client, or use the IMAP server for email and hacks such as this one to get at other data in a manner similar to Evolution. Working from home on Kubuntu, I find it easier to just use the webmail client.

OpenChange is taking a much more sensible approach. At the heart of the project is a MAPI-compatible API, which allows clients to talk directly to Exchange and access all of its functionality. The code is still being actively developed, but some application developers have started playing around with it; the first code for Evolution came out in January 2008. According to Brad Hards, an OpenChange and Kontact developer, "OpenChange can do most of the Exchange tasks now, though it can't currently do free/busy."

For the curious, OpenChange developer Julien Kerihuel has written a simple command-line client. It's currently available in Ubuntu Intrepid and Debian Experimental, though you're better off compiling it yourself as it is changing quite rapidly. It isn't especially well documented, and the manpage implies some functionality that Kerihuel is still working on, but I did have some success.

First, you need to set-up a new profile:

tom@dell-desktop:~$ mapiprofile --profile=tom.chance -w=dell-desktop \
  -I=192.168.0.11 -D=BIOREG -u=tom.chance -p=mypassword --create

You can check if it has worked by listing your mailboxes:

tom@dell-desktop:~$ openchangeclient --mailbox --profile=tom.chance \
  + Mailbox - Tom Chance
|---+ Calendar :      (Total: 774 / Unread: 0 - Container class: IPF.Appointment) [FID: 0xdadb000000000001]  
|---+ Contacts :      (Total: 59 / Unread: 0 -  Container class: IPF.Contact) [FID: 0xdbdb000000000001]
|---+ Deleted Items : (Total: 0 / Unread: 0 -   Container class: IPF.Note) [FID: 0x3efc000000000001] 
|---+ Drafts :        (Total: 0 / Unread: 0 -   Container class: IPF.Note) [FID: 0xdcdb000000000001]   
|---+ Inbox :         (Total: 474 / Unread: 0 - Container class: IPF.Note) [FID: 0x3bfc000000000001]
|---+ General :       (Total: 10 / Unread: 1 -  Container class: IPF.Note) [FID: 0xe00240000000003]

I managed to send a test email, which I picked up in Outlook without problems. When I opened the same email in KMail, however, it has a "winmail.dat" binary file attached, which you wouldn't normally get in emails from Outlook.

tom@dell-desktop:~$ openchangeclient -p=tom.chance --to="tom.chance@bioregional.com" \
  --subject="OpenChange test" --body="Hmm, did this work?" --sendmail

sendmail MAPI_E_SUCCESS (0x0)

You can also interrogate folders, send emails, create and delete contacts, calendar appointments and access most of the other Exchange functionality. Kerihuel: "Openchangeclient is a test case for libmapi, it's a useful way to test if a problem is in the client application or in libmapi, and there is a plugin for sugarcrm, so it may remain in future." There's a proxy server using Samba too, for those who want yet another way of connecting.

For Kontact users, usable integration is probably a good 6 months away. The akonadi resource can deal with most of OpenChange's functionality, "at least a bit", accord to Hards, though "Kontact can't currently make use of it because it isn't converted to akonadi yet." KDE 4.2 should come out with akonadi integration, but the OpenChange functionality might not yet be stable enough for large quantities of important data. Hards thinks KDE 4.3 is probably "the sweet spot."

Until then, Ballmer's mantra remains relevant; OpenChange and its client implementations could do with developers, developers, developers. Cracking this nut could throw open Exchange to a new range of clients, and as Kontact and its peers become stable on Windows and MacOSX, an entrenched Windows server will pose less of a threat to free software migrations on desktops.


(Log in to post comments)

Connecting to Microsoft Exchange with OpenChange

Posted Oct 16, 2008 2:26 UTC (Thu) by himdel (subscriber, #15569) [Link]

A winmail.dat file mean the mail was sent by Outlook set to send RTF mails, not really a problem of OpenChange.
But maybe it should automagically convert it (but maybe not, mangling mail!).
There's an unpacker, tnef (at sourceforge), or a script meant to convert incoming mail while processing (run from procmail; at http://www.dread.net/~striker/tnefclean/).

PostPath owned by Cisco now?

Posted Oct 16, 2008 4:09 UTC (Thu) by dowdle (subscriber, #659) [Link]

PostPath is supposedly an Exchange Server replacement... that speaks the MAPI protocol natively... without needing client side plugins.

I believe PostPath was recently acquired by Cisco. It would be so nice if Cisco, if they weren't going to FOSS the entire product, to at least FOSS the MAPI implementation. I'm not sure why Cisco would be interested in an Exchange Mail Server replacement other than for their own use... being such a big company. It might have been cheaper just to acquire PostPath that licensing Exchange. :)

I'm not trying to diss OpenChange... but I'm sure the OpenChange developers could benefit by seeing another implementation.

Also, Fedora HAD OpenChange listed as one of the upcoming features of Fedora 10... and as time has passed... it was removed. I'm not sure why that is... but I'm guessing that perhaps it was seen as too experimental... and the fact that it hasn't been integrated into any release versions of user apps (that I know of) was an issue.

I certainly look forward to future OpenChange development... but hope a server side product is in the plans somewhere.

PostPath owned by Cisco now?

Posted Oct 16, 2008 4:19 UTC (Thu) by dowdle (subscriber, #659) [Link]

Hmmm, looking at the PostPath site after the Cisco buyout announcement... reveals that PostPath is no longer selling their pre-merger products to new customers although they promise to support existing customers.

Are they going to integrate it into something else... or are they just wanting to get it rebranded before they start selling it again... or did they purchase it just for internal use? My guess would be the later. If the later, then surely they would benefit by sharing the code with the outside world as a FOSS project, right? (fingers crossed)

Copyright © 2008, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds