MAPI Support

From MozillaZine Knowledge Base
Revision as of 14:45, 11 October 2011 by Tanstaafl (talk | contribs) (Other ways to use a Exchange server)
Jump to navigationJump to search

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


There are two types of MAPI implementations, SimpleMAPI and ExtendedMAPI. ExtendedMAPI uses MAPI as a actual messaging engine. It used by Outlook to make native calls to the Microsoft Exchange server. Outlook Express and Thunderbird don't support Extended MAPI, which is why you can only use them with a Microsoft Exchange Server if the admin also installs POP/IMAP/SMTP mail servers on that server.

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, MAPIDetails and (more importantly) MAPIResolveName [1] . They always return MAPI_E_FAILURE. 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. Its difficult to figure out why a particular application works or doesn't work with Thunderbird because there is no MAPI logging file.

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
  • 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.

RKent is working on a ExQuilla add-on for Exchange Web Services (EWS) support. There is a alpha 2 version available that only supports email, for Thunderbird 3.1.* under Windows. The experimental version is free, eventually he plans to sell the software.

See OWA for some other alternatives.

External links