Extended MAPI Fun



Hi all,

i have a problem with extended mapi running under a service and temporary
profiles.

When creating the temporaryprofile and calling configureMsgService, i alwas
get the dialog to enter the servername (The field in the configuration
dialog is blank), i tripple checked and the servername is supplied.

The mailboxname is correctly displayed in the configuration dialog, just the
servername is blank!? when i enter the servername again in the configuration
dialog, everything works..

i tried PR_PROFILE_UNRESOLVED_SERVER and PR_PROFILE_HOME_SERVER but both
properties will popup the configuration dialog. when the service starts.

below is the code snippet i use

Does anyone have an answer?

Mario,



function TExtMAPI.CreateTemporaryProfile(Profile: string;ServerName
:string;MailBoxName :string): boolean;

const Columns : record
cValues : ULONG;
aulPropTag : array[0..1] of ULONG;
end =
(cValues: 2; aulPropTag : (PR_SERVICE_UID, PR_SERVICE_NAME));

var hr :HResult;
FServiceAdmin:IMsgServiceAdmin;
lppTable:IMAPITABLE;
pRows: PSRowSet;
lpProp : PSPropValueArray;
I:byte;
MsgStoreUID :PMAPIUID;
lppMAPIError: PMAPIError;
sres :TSRestriction;
spv :TSPropValue;
PropList :array[0..1] of TSPropValue;


begin
pRows:=nil;
lppTable:=nil;
MsgStoreUID:=nil;
lppMAPIError:=nil;
Result:=False;
hr:=S_OK;
try
hr:=MAPIAdminProfiles(0,FProfileAdmin);
if Failed(hr) then exit;
FProfileAdmin.DeleteProfile(PChar(Profile),0);
hr:=FProfileAdmin.CreateProfile(PChar(Profile), nil, 0, 0);
if Failed(hr) then exit;
hr:=FProfileAdmin.AdminServices(PChar(Profile),nil,0,0,FServiceAdmin);
if Failed(hr) then exit;
hr:=FServiceAdmin.CreateMsgService('MSEMS',nil,0,0);
if Failed(hr) then exit;
hr:=FServiceAdmin.GetMsgServiceTable(0,lppTable);
if Failed(hr) then exit;
sres.rt := RES_CONTENT;
sres.res.resContent.ulFuzzyLevel := FL_FULLSTRING;
sres.res.resContent.ulPropTag := PR_SERVICE_NAME;
sres.res.resContent.lpProp := @spv;
spv.ulPropTag := PR_SERVICE_NAME;
spv.Value.lpszA := 'MSEMS';

hr := HrQueryAllRows(lppTable,@Columns, @sres, nil, 0, pRows);
if Failed(hr) then exit;
MsgStoreUID:=PMAPIUID(pRows.aRow[0].lpProps[0].Value.bin.lpb);

PropList[1].ulPropTag := PR_PROFILE_UNRESOLVED_NAME;
PropList[1].Value.lpszA:=PChar(MailboxName);
PropList[0].ulPropTag := PR_PROFILE_UNRESOLVED_SERVER;
PropList[0].Value.lpszA:=PChar(Servername);

hr:=FServiceAdmin.ConfigureMsgService(MsgStoreUID,0, SERVICE_UI_ALLOWED,
2, PSPropValue(@PropList));
finally
Result:=not Failed(hr);
if Assigned(pRows) then FreePRows(pRows);
lppTable:=nil;
if not Result then begin
try
if Assigned(FServiceAdmin) then
FServiceAdmin.GetLastError(hr,0,lppMAPIError)
else if Assigned(FProfileAdmin) then
FProfileAdmin.GetLastError(hr,0,lppMAPIError);
if Assigned(lppMapiError) then
FLastError:=lppMapiError.lpszError;
finally
lppMAPIError:=nil;
end;
if Assigned(FProfileAdmin) then
FProfileAdmin.DeleteProfile(PChar(Profile),0);
end;
FServiceAdmin:=nil;
end;
end;


.



Relevant Pages

  • Re: [opensuse] Webcam / Skype question
    ... Just opens a gray window, with grand total of 5 menu choices, including exit, ... none of which are setup, configuration or options. ...
    (SuSE)
  • Re: NJ Turnpike Exit 15X - Map/Photo?
    ... configuration of the NJ Turnpike's Exit 15X? ... but couldn't find anything in the way of a map of ... and then loop west past the Secaucus Junction train station and out to ...
    (misc.transport.road)
  • Re: HELLO Command with PARM=-1
    ... I did check the configuration ... in SYSGEN and as most of you suspected the ENFORCE LOGON UDCS was set to ... misc> SHOW SY ... sysgen> EXIT ...
    (comp.sys.hp.mpe)
  • Re: Video Card on RedHat 9.0
    ... > would like to have a text menu to select other video card/monitor and the ... > possibility to TEST the new configuration before changing the file. ... video card and the monitor selection. ... and like it, exit out and: ...
    (linux.redhat)
  • Re: [Apache] Vhost with mod_rewrite
    ... I have looked the documentation of apache with your url and i created ... ServerName %0 ... Apache is down with this configuration... ...
    (Debian-User)