I'm looking to write an automated monitor script to programmatically retrieve information from another user's Exchange 2003 inbox. I have working C++ code to log into MAPI and connect to my own inbox. I can also use the Control Panel->Mail applet to configure another user's mailbox into my profile, and my code can access that way. However, this was done on my desktop with Outlook installed, which provides a richer mail profile editor.
我正在寻找一个自动化的监视器脚本,以编程方式从另一个用户的Exchange 2003收件箱中检索信息。我有工作的C ++代码登录到MAPI并连接到我自己的收件箱。我还可以使用控制面板 - >邮件小程序将另一个用户的邮箱配置到我的配置文件中,我的代码可以访问该方式。但是,这是在安装了Outlook的桌面上完成的,它提供了更丰富的邮件配置文件编辑器。
Since this will run on a server, I'd prefer not to install Outlook at all. Instead, I can install the MAPI client. I then create a simple MAPI app that pops up the mail profile wizard using MAPILogonEx()
with the MAPI_LOGON_UI
flag. However, the basic MAPI client doesn't have the features to configure another user's mailbox. As a requirement, I can only run this script as the service account of the monitoring application, so I cannot tell it to run as the account whose mailbox I want.
由于这将在服务器上运行,我宁愿根本不安装Outlook。相反,我可以安装MAPI客户端。然后,我创建一个简单的MAPI应用程序,使用带有MAPI_LOGON_UI标志的MAPILogonEx()弹出邮件配置文件向导。但是,基本MAPI客户端没有配置其他用户的邮箱的功能。作为一项要求,我只能将此脚本作为监控应用程序的服务帐户运行,因此我无法将其作为我想要的邮箱运行。
Is it still possible to connect to another user's mailbox (assuming permissions are already granted) using the basic MAPI client? Or is it absolutely necessary to install Outlook for this functionality?
是否仍然可以使用基本MAPI客户端连接到另一个用户的邮箱(假设已授予权限)?或者是否绝对有必要为此功能安装Outlook?
3 个解决方案
#1
1
I would strongly recommend using the Microsoft Exchange MAPI Client (as you have linked). It is engineered to be far more robust than the Outlook version of these libraries. You should find the API no different between Outlook and Exchange Server with respect to Extended MAPI.
我强烈建议使用Microsoft Exchange MAPI客户端(因为您已链接)。它被设计为比这些库的Outlook版本更强大。您应该发现Outlook和Exchange Server之间的API与扩展MAPI没有区别。
You will need to use Extended MAPI (as described by Cain T S Random) to open other mail stores, and of course your application will need to be logged in as the Windows user with appropriate permissions on the Exchange server.
您将需要使用扩展MAPI(如Cain T S Random所述)打开其他邮件存储,当然您的应用程序需要以具有Exchange服务器上相应权限的Windows用户身份登录。
#2
1
I see... I'm not sure how to do that explicitly; that's usually a side effect of calling CreateStoreEntryID
with the wrong flags. What's you're looking to do is probably:
我明白了......我不确定如何明确地做到这一点;这通常是使用错误的标志调用CreateStoreEntryID的副作用。你要做的是:
- Get an
IID_IExchangeManageStore
from your default message store - Call
CreateStoreEntryID
-
Then open that store by the entry ID
然后按条目ID打开该商店
LPEXCHANGEMANAGESTORE mapiObject = NULL; store->QueryInterface( IID_IExchangeManageStore, (LPVOID *) &mapiObject); mapiObject->CreateStoreEntryID( server, mailbox, OPENSTORE_TAKE_OWNERSHIP | OPENSTORE_USE_ADMIN_PRIVILEGE, &len, &buffer); //Call OpenEntry on the entry id
从默认邮件存储中获取IID_IExchangeManageStore
If you want a more detailed example, search the source of the MFC MAPI project for CreateStoreEntryID
. If you have other questions, the best place to get them answered is the microsoft.public.win32.programmer.messaging
newsgroup.
如果需要更详细的示例,请在MFC MAPI项目的源中搜索CreateStoreEntryID。如果您还有其他问题,那么获得答案的最佳位置是microsoft.public.win32.programmer.messaging新闻组。
#3
0
Have you looked into ConfigureMsgService? I believe that works with Exchange MAPI, or are you saying you tried that and it didn't work?
你看过ConfigureMsgService了吗?我相信它可以与Exchange MAPI一起使用,或者你是说你尝试过它而且它不起作用?
#1
1
I would strongly recommend using the Microsoft Exchange MAPI Client (as you have linked). It is engineered to be far more robust than the Outlook version of these libraries. You should find the API no different between Outlook and Exchange Server with respect to Extended MAPI.
我强烈建议使用Microsoft Exchange MAPI客户端(因为您已链接)。它被设计为比这些库的Outlook版本更强大。您应该发现Outlook和Exchange Server之间的API与扩展MAPI没有区别。
You will need to use Extended MAPI (as described by Cain T S Random) to open other mail stores, and of course your application will need to be logged in as the Windows user with appropriate permissions on the Exchange server.
您将需要使用扩展MAPI(如Cain T S Random所述)打开其他邮件存储,当然您的应用程序需要以具有Exchange服务器上相应权限的Windows用户身份登录。
#2
1
I see... I'm not sure how to do that explicitly; that's usually a side effect of calling CreateStoreEntryID
with the wrong flags. What's you're looking to do is probably:
我明白了......我不确定如何明确地做到这一点;这通常是使用错误的标志调用CreateStoreEntryID的副作用。你要做的是:
- Get an
IID_IExchangeManageStore
from your default message store - Call
CreateStoreEntryID
-
Then open that store by the entry ID
然后按条目ID打开该商店
LPEXCHANGEMANAGESTORE mapiObject = NULL; store->QueryInterface( IID_IExchangeManageStore, (LPVOID *) &mapiObject); mapiObject->CreateStoreEntryID( server, mailbox, OPENSTORE_TAKE_OWNERSHIP | OPENSTORE_USE_ADMIN_PRIVILEGE, &len, &buffer); //Call OpenEntry on the entry id
从默认邮件存储中获取IID_IExchangeManageStore
If you want a more detailed example, search the source of the MFC MAPI project for CreateStoreEntryID
. If you have other questions, the best place to get them answered is the microsoft.public.win32.programmer.messaging
newsgroup.
如果需要更详细的示例,请在MFC MAPI项目的源中搜索CreateStoreEntryID。如果您还有其他问题,那么获得答案的最佳位置是microsoft.public.win32.programmer.messaging新闻组。
#3
0
Have you looked into ConfigureMsgService? I believe that works with Exchange MAPI, or are you saying you tried that and it didn't work?
你看过ConfigureMsgService了吗?我相信它可以与Exchange MAPI一起使用,或者你是说你尝试过它而且它不起作用?