Hello!

Please help, I don't know how to solve this problem.

May be I don't understand how to work OpenUserMailbox function. In documentation:

   _PUBLIC_ enum MAPISTATUS OpenUserMailbox     (    struct
   mapi_session *     session,
           const char *     username,
           mapi_object_t *     obj_store            )


I write tiny Python (ctypes) binding and try to get another user calendar. I call:

   session = pointer(mapi_session())
   store = mapi_object_t()

   MapiLogonEx(pointer(session), login, password)
   OpenUserMailbox(session, user, pointer(store))

   fid = c_uint64()

   GetDefaultFolder(pointer(store), pointer(fid), olFolderCalendar) <-
   returns error (-1)


I look at source and found error path:

GetDefaultFolder <-
   CacheDefaultFolders (because folder id > 6) <-
       GetReceiveFolder <-
status = emsmdb_transaction(session->emsmdb->ctx, mapi_request, &mapi_response); MAPI_RETVAL_IF(!NT_STATUS_IS_OK(status), MAPI_E_CALL_FAILED, mem_ctx);
                retval = mapi_response->mapi_repl->error_code;
                MAPI_RETVAL_IF(retval, retval, mem_ctx);

               seems like retval here = -1

Is my code correct?

Hi Evgeny,
Hello!

Thank you for your answer!

I would suggest you to check for OpenUserMailbox return value.
OpenUserMailbox returns MAPI_E_SUCCESS.
Sounds to
me like you don't have the permissions to browse this user calendar
using the login/password you have specified.
When I try to get user calendar from Outlook client, everything is ok. But it fails when I use libmapi.
You should also set global_mapi_ctx->dump_data to true and debuglevel to
10, this would give you some enhanced network trace associated to your
code and make debug/help much easier for me to provide.

It seems, I have no access to global_mapi_ctx from ctypes.


--
Kind regards,
Evgeny Stepanischev

        


begin:vcard
fn;quoted-printable:=D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9 =D0=A1=D1=82=D0=B5=D0=BF=D0=B0=
	=D0=BD=D0=B8=D1=89=D0=B5=D0=B2
n;quoted-printable;quoted-printable:=D0=A1=D1=82=D0=B5=D0=BF=D0=B0=D0=BD=D0=B8=D1=89=D0=B5=D0=B2=D1=91;=D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9
org;quoted-printable;quoted-printable:=D0=AF=D0=BD=D0=B4=D0=B5=D0=BA=D1=81;=D0=B3=D1=80=D1=83=D0=BF=D0=BF=D0=B0 =D1=80=D0=B0=D0=B7=D1=80=D0=B0=D0=B1=
	=D0=BE=D1=82=D0=BA=D0=B8 =D0=B2=D0=BD=D1=83=D1=82=D1=80=D0=B5=D0=BD=D0=BD=
	=D0=B8=D1=85 =D1=81=D0=B5=D1=80=D0=B2=D0=B8=D1=81=D0=BE=D0=B2
adr;quoted-printable;quoted-printable;dom:;;=D0=A2=D0=B0=D0=B3=D0=B0=D0=BD=D0=BA=D0=B0;=D0=9C=D0=BE=D1=81=D0=BA=D0=B2=D0=B0
email;internet:[email protected]
title;quoted-printable:=D1=80=D1=83=D0=BA=D0=BE=D0=B2=D0=BE=D0=B4=D0=B8=D1=82=D0=B5=D0=BB=D1=8C
tel;work:6466
tel;cell:+7 (915) 010-6997
x-mozilla-html:FALSE
version:2.1
end:vcard

_______________________________________________
devel mailing list
[email protected]
http://mailman.openchange.org/listinfo/devel

Reply via email to