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.
Hello!
I continue the researches. I have written the small script illustrating
a problem (look attached file). It is necessary Python 2.5 or Python 2.4
with the module ctypes.
After run I receive the following:
Fid: 3055410872194170881
OpenFolder : MAPI_E_NOT_FOUND (0x8004010F)
The problem in OpenFolder or OpenUserMailbox seems. It seems, that it do
not work together.
--
Kind regards,
Evgeny Stepanischev
from ctypes import *
MAPI_E_SUCCESS = 0
olFolderTopInformationStore = 1
def e(error):
lib.mapi_errstr(error, lib.GetLastError())
import sys
sys.exit()
class mapi_object_t(Structure):
_fields_ = [
('id', c_uint64),
('handler', c_uint32),
('session', c_void_p),
('private_data', c_void_p)
]
lib = CDLL('libmapi.so')
session = c_void_p()
lib.MAPIInitialize('profile.ldb')
if lib.MapiLogonEx(pointer(session), 'TestUserA', '1234567') != MAPI_E_SUCCESS:
e('MapiLogonEx')
store = mapi_object_t()
if lib.OpenUserMailbox(session, 'conference_ural', pointer(store)) !=
MAPI_E_SUCCESS:
e('OpenUserMailbox')
fid = c_uint64()
if lib.GetDefaultFolder(pointer(store), pointer(fid),
olFolderTopInformationStore) != MAPI_E_SUCCESS:
e('GetDefaultFolder')
print "Fid: %d" % fid.value
folder = mapi_object_t()
if lib.OpenFolder(pointer(store), fid, pointer(folder)) != MAPI_E_SUCCESS:
e('OpenFolder')
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