MAPI and Exchange 2007
Most of you have realized by now that Exchange 2007 doesn't include MAPI "in the box". We're supporting two ways to put MAPI on an Exchange 2007 server:
- The MAPI Download
- Outlook 2007
Some of you have noticed as well that with Exchange 2007, you don't have to have a Public Folder store. What happens when you try to connect to an Exchange 2007 server that doesn't have a Public Folder store?
With Outlook 2007, you connect with no problem. Earlier versions of Outlook get this error:
"Your Exchange Server administrator has blocked the version of Outlook that you are using. Contact your administrator for assistance."
MAPI applications will get the error MAPI_E_FAILONEPROVIDER if they're using any version of MAPI except the version supplied by Outlook 2007.
So what's a developer to do? Are you locked in to Outlook 2007's MAPI? Why did we provide a MAPI download if it won't even work?
Introducing CONNECT_IGNORE_NO_PF
Exchange 2007 blocks all MAPI providers earlier than Outlook 2007 when Public Folders are not available. This is because all of the earlier clients assume Public Folders will be available and will experience failures if allowed to connect. For customers whose code does not depend on Public Folders, a new flag has been made available to allow this check to be bypassed.
Right now, the only version of MAPI which supports this new flag is the MAPI download.
Details on the new flag:
#define CONNECT_IGNORE_NO_PF ((ULONG)0x8000)
This is set in the PR_PROFILE_CONNECT_FLAGS property on the global profile section.
The global profile section can be accessed by calling OpenProfileSection with pbGlobalProfileSectionGuid, which is defined in edkmdb.h.
When this flag is set, Exchange 2007 will not check if public folders are available when logging on. Use of this flag can be demonstrated with MAPI Editor:
- Install the new MAPI download
- In MAPI Editor, do Profile/Show Profiles and open the profile you wish to work on
- Locate the MSEMS service and open it
- Locate the profile section with the PR_PROVIDER_UID of 13DBB0C8AA05101A9BB000AA002FC45A and single click on it
- In the lower pane, locate PR_PROFILE_CONNECT_FLAGS
- Edit this property to OR in the new flag. So for instance, if it previously had 0x2 in there, it would now have 0x8002
- Close all the profile windows and attempt to log on
Caveats
- Even with this flag you won't be able to use Public Folders (they don't exist) so any errors attempting to open or reference them would be expected.
- Both the client side MAPI binaries and the Exchange store need to be aware of the flag for it to work.
- Builds of MAPI that understand this flag are the one from the download only and Exchange 2003 06.05.09.7652 or higher (KB 929751)
- Builds of the Exchange store that understand this flag are Exchange 2007 and Exchange 2003 06.05.09.7652 or higher (KB 929751)
- The build of CDO included in the download will automatically set this flag on dynamic profiles.
- Previous versions of Exchange may not understand this flag, so be sure only to set it when logging on to an Exchange 2007 mailbox.
Update - 4/17/07 Removed inadvertent assertion that there is a build of Exchange 2003 MAPI that understands this flag. If such a build does become available I'll update again.
Comments
Anonymous
March 20, 2007
Steve, Can you disclose how exchange is verifying the outlook version? Could we as developers change the version in the profile to be 2007 and remove the public folder provider from the profile? For that matter, why can't we just remove the PF provider and have downlevel clients work? I agree that the default for older clients is to have a PF provider in the profile, but it seems unfair that no check is made to determine if a PF provider even exists before failing on the profile. Regards, EriqAnonymous
March 20, 2007
Outlook on an Exchange Server? Steve, maybe i am misinterpreting your comments. In previous releases it was strongly cautioned against deploying Outlook on an exchange server because of the mapi stub. Is this no longer the case? Can outlook 2007 be installed on a 2007 exchange server without issue? -EriqAnonymous
March 20, 2007
That we support putting Outlook 2007 on an Exchange 2007 server should be in the release notes. Dave blogged about it here: http://blogs.msdn.com/dgoldman/archive/2007/02/27/installing-outlook-2007-on-an-exchange-2007-server.aspx The version number that Exchange gets is actually the version of the emsmdb32.dll binary, so you won't be able to "set" it.Anonymous
March 21, 2007
Steve, which methods will return MAPI_E_FAILONEPROVIDER in case of the version mismatch? Is it on the first call that causes an RPC?Anonymous
March 21, 2007
Dmitry - Good question - it's on OpenMsgStore. If you play around with this, you'll probably see that AB access still works.Anonymous
March 21, 2007
Steve, Does 'the MAPI Download' still use the 'stubbed' approach as previous versions?Anonymous
March 21, 2007
The MAPI download installs Exchange's MAPI32.dll directly into system32 - it does not use the stub.Anonymous
March 24, 2007
Steve, speaking of versions, versions of Outlook prior to 2007 used to set the PR_PROFILE_SERVER_VERSION in the global profile section. I don't think Outlook 2007 does that anymore in neither cached nor online mode. Is the Exchange server version still stored somewhere?Anonymous
March 29, 2007
Following up on my previous article on CONNECT_IGNORE_NO_PF , I had a customer recently who claimed MAPIAnonymous
March 30, 2007
Dmitry - there IS a new prop (in the same place as the old one), but it's not documented (yet). I'm sure you'll be able to find it. :)Anonymous
May 02, 2007
We have an EDK based MAPI connector with Exchange 2000/2003. How do you use it on Exchange 2007 ? Can i use it or no ? Any help is appreciated...Anonymous
May 04, 2007
You can't - but you don't need to either. Exchange 2007 has a much simpler mechanism for building connectors. See the documentation on Foreign Connectors: http://technet.microsoft.com/en-us/library/aa996779.aspxAnonymous
May 11, 2007
Hi, The download MAPI works fine for the 'old-format' PST but does not work for Outlook 2003/2007 format. IMsgServiceAdmin->ConfigureMsgService() returns MAPI_E_EXTENDED_ERROR. I read in some other blog that Exchange 2007 SP1 will provide functionality to export/import also the new PST. Is this anyhow related with the standalona MAPI and will this be enhanced to support new SPT format too?Anonymous
May 11, 2007
The download is Exchange's MAPI, which only includes an ANSI PST provider. What you're looking for is the Unicode PST provider - don't hold your breath waiting for it to show up in the download.Anonymous
June 18, 2007
What else has to happen to the profile? I am creating a brand new profile and now when OpenMsgStore() is called, I receive a unconfigured profile error (8004011C) instead of the 011D. Even if I stop my program and manually update the profile in the middle I will get this error. It seems like the profile isn't getting fully saved before the update happens. I'm just not sure what is wrong, the code works with Ex2007 with public folders, Ex2003, Ex2000, even 5.5. Do you have any sample code to show the process of updating the PR_PROFILE_CONNECT_FLAGS?Anonymous
June 19, 2007
kevin - did you try the steps I gave for MFCMAPI? They describe exactly what you need to do.Anonymous
July 24, 2007
In my exchange 2007 setup even after downloading "ExchangeMapiCdo.EXE" MAPI code is failing during GetMessageStore with error code "HRESULT: 8004011d" . Any idea whats wrong? Regards, ShivarajAnonymous
July 25, 2007
I can only guess you didn't set CONNECT_IGNORE_NO_PF correctly on the profile.Anonymous
August 07, 2007
If you've been bit by the problems with the web download of CDO 1.21 returning a 8004011D when tryingAnonymous
September 06, 2007
Stephen, is there a true 64 bit version of MAPI32.dll for use with x64 applications? We are running a 64 bit app and MAPIInitialize returns E_FAIL. The MAPI/CDO download for Exchange 2007 does not fix this eitherAnonymous
September 06, 2007
MAPI is 32 bit only. We don't make a 64 bit MAPI right now.Anonymous
October 01, 2007
Hello Stephen, do we have any opportunity to install .PST provider without Outlook. If yes, how we can do this? And another one what is the latest version of pst provider is available for NT4?Anonymous
October 01, 2007
Exchange's MAPI includes an ANSI only PST provider. As for NT4 - um - maybe you could install the Exchange 5.5 system manager?Anonymous
December 13, 2007
Is there a way to access Personal Store (PST) wihtout having Outlook installed? Reason: Take out theAnonymous
March 11, 2008
One quick question regarding the MAPI download. Is it true, that this version of mapi32.dll does not return the STORE_UNICODE_OK flag in the PR_STORE_SUPPORT_MASK property? Even if the store supports UNICODE, the flag is never set. Forcing MAPI_UNICODE works as expected, but how can i find out if a store is really UNICODE capable?Anonymous
March 12, 2008
I looked in the code and it doesn't appear Exchange's implementation of MAPI is aware of the STORE_UNICODE_OK flag. As far as MAPI_UNICODE is concerned, calls that don't support it will always let you know...Anonymous
July 14, 2008
One of my customers reported that using the MAPI download , they were unable to get a referral from ExchangeAnonymous
August 27, 2008
Hi, I have modified the user profile as you said (using MFCMAPI) but when i try to get the store mailbox table on exchange server 2007 i get the error for HrQueryAllRows function : "MAPI_E_NOT_INITIALIZED == 0x80040605". The user has admin privileges and I even tried with the administrator also. I am getting this error after logging in and got the IEXCHANGEMANAGER and the when i use HrQueryAllRows function. I thought something must be wrong with my code so i used MFCMAPI. it also gives the same error: "MAPI_E_NOT_INITIALIZED == 0x80040605 Function m_lpContentsTable->QueryColumns( 0, &lpOriginalColSet)" What might be the problem?Anonymous
August 27, 2008
I've seen people follow the steps incorrectly and set the prop on the wrong profile section. Try again, and make sure to follow each step carefully. Do not use "Open Profile Section" as a shortcut. Also - after you set the flag, make sure the hex value is 0x8002.Anonymous
August 27, 2008
Yes I have double checked the steps for modifying and also verified the PR_PROVIDER_UID of 13DBB0C8AA05101A9BB000AA002FC45A. I opened the correct profile, and there was only one service : MSEMS. After modifying the flag i verified that the value is 0x8002. but still i get the same error. Is it the problem with server configuration or am i missing some dll files?Anonymous
October 22, 2008
Hello, I was just looking at the MAPI download link and was wondering if Microsoft has plans to release versions other than English? Just wondering cause of the PR_LOCALE_ID chicken/egg issue in which MAPILogonEx changes the value to what the DLL language is and you can't get the previous PR_LOCALE_ID value without doing a logon so you can set it back to what it should be. Thanks!Anonymous
November 17, 2008
I've had a few customers lately getting hangs using Exchange's MAPI to talk to Exchange. Their specificAnonymous
December 07, 2008
Hi, Maybe this is the wrong forum, but I'm stumped to find the right one. I am trying to send a Task Request through the MAPI. Is it possible? if so, how?Anonymous
December 08, 2008
It is possible, but you'll need to read through the Exchange protocol documentation to figure out what you need to do. Start by looking at the MSDN article on creating task items: http://msdn.microsoft.com/en-us/library/cc963264.aspxAnonymous
July 22, 2009
I'm using the recent MAPI CDO library (6.5.8069.0) for connecting to an Exchange Server 2007 without a public folder. If I edit the PR_PROFILE_CONNECT_FLAGS using MFC MAPI program, both the MFC MAPI and my program can connect via this profile, it works. But when i change the flag programmatically, i get MAPI_E_FAILONEPROVIDER from OpenMsgStore. The windows account and the mail account are the same (administrator).. I call MapiLogonEx, change the flags and then try to open the message store. Is it about the order of methods? When exactly i should change the flag?Anonymous
July 22, 2009
Cash - you shouldn't be logging on to the profile first. All the modifications should happen before you log on. Take a look at the source for gcreconnect if you want to see code that sets this flag.Anonymous
July 23, 2009
Using GcReconnect code, I've written the code below. Although it seems to change the flag to 0x8002, OpenMsgStore still fails with MAPI_E_FAILONEPROVIDER. MAPIAdminProfiles(0, &lpProfAdmin); lpProfAdmin->AdminServices((LPTSTR)Profile, NULL, NULL, 0, &lpSvcAdmin); SvcAdminOpenProfileSection(lpSvcAdmin,(LPMAPIUID)&pbGlobalProfileSectionGuid, NULL, MAPI_MODIFY, &lpGlobalProfSect); SizedSPropTagArray(1,sptTags) = {1, PR_PROFILE_CONNECT_FLAGS}; hRes = lpGlobalProfSect->GetProps((LPSPropTagArray) &sptTags, 0, &ulValues, &pPropArray); if (SUCCEEDED(hRes) && (MAPI_W_ERRORS_RETURNED != hRes)) { pPropArray[0].Value.ul |= CONNECT_IGNORE_NO_PF; hRes = lpGlobalProfSect->SetProps(1, pPropArray, NULL); } else { } if (FAILED(hr = lpGlobalProfSect->SaveChanges(FORCE_SAVE))) { } And then... MAPILogonEx(0,cProfile,"",ulFlags,&lpSession); HrMAPIFindDefaultMsgStore(lpSession, &cbDefStoreEid, &pDefStoreEid); lpSession->OpenMsgStore(0, cbDefStoreEid, pDefStoreEid, NULL, MAPI_BEST_ACCESS,&lpMDB); What may be wrong?Anonymous
July 24, 2009
You should confirm gcreconnect works - there may be a problem with your environment.Anonymous
October 11, 2009
I couldn't find directly related topic, so i'm asking under this topic (cause it may be an Exchange 2007 issue); I set a latest delivery time for a message to get a non delivery report after a given time via PR_LATEST_DELIVERY_TIME (10 minutes i.e.). However, NDR arrives after the time which the "maximum expiry time" settings of MS Exchange 2007 indicates (1 day by default) even though i set PR_LATEST_DELIVERY_TIME. Isn't it possible to set the latest delivery time using MAPI on Exchange 2007? I used to use this property on Exchange 2003.Anonymous
November 17, 2009
How does one set the PKI certificate info, in case the email is S/MIME encoded? Is PR_CONNECT_FLAG control this?Anonymous
October 04, 2010
Hi Steve, Your post says to me that you "can" put MAPI on the Exchange 2007 server. Is it also true that you "have" to put MAPI on the Exchange 2007 server so that clients such as the Blckkberry BES server can successfully access the Exchange?Anonymous
October 04, 2010
It is untrue. You have to put MAPI on machines where MAPI clients run. Exchange is always a MAPI server and does not need the MAPI client bits to operate as a MAPI server. Now - if you plan on running a MAPI client on the Exchange server, you'd need to install MAPI for that client's sake, but not for the server's sake.Anonymous
March 29, 2012
i'm getting MAPI_E_UNCONFIGURED == 0x8004011C when attempting to connect to an exchange 2010. this worked in the past. also found another server this fails on.