views:

49

answers:

2

Hi folks,

while try to read the ACL Table of a folder, I ran into this problem:

In a C++ tool (MFCMAPI) this method is used to get the Property PR_ACL_TABLE in a usable data type:

// Open the table in an IExchangeModifyTable interface
 EC_H(lpMAPIProp->OpenProperty(
  ulPropTag,
  (LPGUID)&IID_IExchangeModifyTable,
  0,
  MAPI_DEFERRED_ERRORS,
  (LPUNKNOWN FAR *)&lpExchTbl));

I figured out to do this in python win32:

table = mystore.OpenProperty(mapitags.PR_ACL_TABLE, IID_IExchangeModifyTable, 0 , mapi.MAPI_DEFERRED_ERRORS)

But it seems that the MAPI Extension does not know the IID_IExchangeModifyTable type. I just got just this error:

AttributeError: 'module' object has no attribute 'IID_IExchangeModifyTable'

Does anybody know another way to get and modify the ACL data from exchange via the MAPI (and python)?

Thanks - Marquies

+1  A: 

According to the docs, you need a PyIID object.

However, in almost all cases, functions that expect a CLSID/IID as a param will accept either a string object, or a native PyIID object.

That said, I've seen mapi.IID_IMessage used with the OpenProperty method.

Mark
marquies
+1  A: 

IExchangeModifyTable is declared in edkmdb.h Are you using mapi33 in python? Is that interface even declared in mapi33? You can use RDOFolder.ACL in Redemption: http://www.dimastr.com/redemption/rdo/RDOACL.htm

Dmitry Streblechenko
Thanks for the edkmdb.h hint. I used some libs from MFCMAPI to write an extension of pywin32 mapi to get this work. I will contribute it to the project, let's see if it is welcome.
marquies