MozillaZine

MAPI Support

From MozillaZine Knowledge Base

This article was written for Thunderbird but also applies to Mozilla Suite/SeaMonkey Mail.


There are two types of MAPI implementations, SimpleMAPI and ExtendedMAPI.

SimpleMAPI is a subset that is used by applications to call the default email client to send a message without that application having to know anything about what email client is doing the actual work. For example, if Thunderbird was the default email client you could use Microsoft Word, Microsoft Excel, or MYOB to send a message. Many scanners also use SimpleMAPI to mail an image file.

All you need to do to support SimpleMAPI is to configure Thunderbird as the default email client and make certain you don't configure any other email clients that you might run as the default email client. Otherwise the email clients will fight to be the default email client.

The default email client replaces MAPI32.DLL with a stub that redirects any calls to that DLL to itself. This isn't something unique to Thunderbird, that is the way Microsoft designed it. This can have side-effects. Outlooks calendar is implemented as a MAPI provider, so it needs to call the original MAPI32.DLL. This will break if you make Thunderbird the default email client. Novells Groupwise application only supports SimpleMAPI but it insists on being the default email client or it will not work. You can try to workaround this by copying the Groupwise MAPI32.DLL stub to the Groupwise directory. (When a application tries to find a DLL it normally searches in the current directory before it searches the windows system directory.)

Thunderbird's SimpleMAPI support is buggy. It also doesn't fully implement MAPIAddress and MAPIDetails. They always return MAPI_E_FAILURE. MAPIResolveName is implemented in Thunderbird 13.0 [1]. Some third party applications that actually only use SimpleMAPI calls check for whether ExtendedMAPI is supported. This is sloppy programming, and there is nothing you can do to work around it. It's difficult to figure out why a particular application works or doesn't work with Thunderbird because there is no MAPI logging file.

ExtendedMAPI uses MAPI as a actual messaging engine. It is used by Outlook to make native calls to the Microsoft Exchange server. Outlook Express and Thunderbird don't support Extended MAPI. The normal way to use Thunderbird with a Microsoft Exchange Server requires the admin to enable the POP/IMAP/SMTP mail servers that are bundled with that server. If they don't do that see here for some alternatives.

Outlook supports Corporate and Workgroup modes that let you connect to a Microsoft Exchange Server and use any of the information services listed in the Exchange profile. Thunderbird doesn't support that since it can't make native Exchange calls. It supports what Microsoft calls Internet Mail Only (IMO) mode. Thunderbird can access a Microsoft Exchange Global Address List (GAL) by treating it as a LDAP based address book.

Microsoft appears to be migrating from ExtendedMAPI to Exchange Web Services (EWS) . ExtendedMAPI is now considered a legacy API. They have released versions of Entourage and Outlook email clients that support EWS. Mail.App in Snow Leopard also supports EWS. See Migrating from Exchange 2007 Legacy APIs for more information.

Application calls wrong email client

If you configured Thunderbird as the default email client but an application keeps calling a different email client try renaming mapi32.dll to something else and then run "fixmapi.exe". That should create a new mapi32.dll. [2]

Troubleshooting

  • Check that Thunderbird is configured as the default email client and that any other email clients you might have are not configured to try to be the default email client.
  • Try using either Outlook Express or Windows Mail as the default email client. If that works then your problem was due to a bug in Thunderbird's SimpleMAPI support. You might want to register with Bugzilla (Mozilla's bug reporting system) and vote to fix the bug
  • Some users have run into a problem with MAPIResolveName() not working under Windows 7, essentially breaking SimpleMAPI. This effects any email client, not just Thunderbird. If this happens to you the workaround is to install the hotfix from http://support.microsoft.com/kb/980681 .
  • If you have Outlook, try using it as the default email client. If that works then whatever you did required ExtendedMAPI support, which Thunderbird doesn't support.
  • There have been a couple of bugs (all fixed) where the registry keys for Simple MAPI support are set incorrectly if you upgrade (rather than install using the setup program). If the problem shows up after upgrading, try re-installing Thunderbird. Uninstalling doesn't delete your profile but if you're worried, back it up first with Moazbackup. [3]

Operating Systems

  • Windows supports SimpleMAPI. ExtendedMAPI support is added as part of installing Outlook or Exchange.
  • OSX doesn't support MAPI. Entourage uses WebDAV to communicate with Microsoft Exchange servers, not ExtendedMAPI [4]
  • Linux doesn't support MAPI. Wine supports SimpleMAPI but many of the APIs seems to be just stubs. [5]
  • OpenChange is a open source emulation of Microsoft Exchange. That project has a libmapi library used by Evolution, KMail and Mailody (Linux email clients) to access Microsoft Exchange servers natively. There are two old bug reports [6][7] requesting Thunderbird use that library. It was also requested [8] in the planning for Thunderbird 3.0.

Related bug reports

Other ways to use a Exchange server

DavMail is a POP/IMAP/SMTP/Caldav/CardDAV/LDAP gateway allowing any e-mail/calendar client to access Exchange via OWA. Its written in Java and doesn't seem to require tweaking any scripts like the other solutions do. CardDAV (it synchronizes contact data) can be used in Thunderbird with the SOGo Connector add-on. Using DavMail Gateway To Allow Thunderbird To Access Microsoft Exchange Server 2007 & Earlier has links to Thunderbird specific instructions.

If you want to enable the experimental EWS support, set the hidden davmail.enableEws property to true in davmail.properties. [9]

RKent is working on a ExQuilla addon that allows access to both messages and contacts stored on Exchange Server 2007 or 2010. It uses EWS (Exchange Web Services) for access to the server. It is currently available in a beta version that supports Thunderbird 13 - 15 on Windows, Linux, and OSX platforms, and supports messages and contacts. Calendar features (which work with the Lightning addon) are being added experimentally, but are not officially supported yet. The current beta version is free, but he plans to charge a small annual fee for the official release to cover development costs. Its also available on the Mozilla Add-ons web site as ExQuilla for Microsoft Exchange.

The Provider for Microsoft Exchange add-on lets you use Microsoft Exchange calendars in Thunderbird, via Exchange Web Services. It supports Microsoft Exchange 2007 and above.

See OWA for some other alternatives.

External links