MAPI and NT Service

Bill Tutt billtut at microsoft.com
Tue Jan 25 03:16:00 EST 2000


The issue is described in the following KB article:

http://support.microsoft.com/support/kb/articles/Q197/8/20.ASP


To handle the MAPIInitialize call as required you can do the following:
import mapi

mapi.MAPIInitialize((mapi.MAPI_INIT_VERSION, mapi.MAPI_NT_SERVICE))

To handle the MAPILogonEx requirement the following MIGHT work from within
the service:
# assumes import mapi.

rawSession = mapi.MAPILogonEx(0, <profile name>, <password>, 
  mapi.MAPI_EXPLICIT_PROFILE | mapi.MAPI_NEW_SESSION | mapi.MAPI_NO_MAIL | 
  mapi.MAPI_NT_SERVICE)

# assume session points at a CDO/Active Messageing session object.
session.Logon(profileName=<blah>, profilePassword=<blah>, showDialog=0, 
newSession = 0, NoMail=1)

This should hopefully will allow you to do what you want, assuming your
service already is authenticated as the user who can log into the passed in
MAPI profile. The default system account can't access MAPI Profile
information.

Hope this helps,
Bill








More information about the Python-list mailing list