permission problem when opening mailbox with ADODB y OLE DB
Exchange Server Forum Index Exchange Server
Discussion forums for Microsoft Exchange Server users.
Microsoft Outlook
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web ExchangeServerHelp.com
permission problem when opening mailbox with ADODB y OLE DB

 
Post new topic   Reply to topic    Exchange Server Forum Index -> Development
Author Message
Eric Lajeunesse
Guest





Posted: Sat Sep 17, 2005 12:48 am    Post subject: permission problem when opening mailbox with ADODB y OLE DB Reply with quote

Hi, the task I want to realize with my application is to read all the message
of any mailbox and alter some message according to their maliscious contents.

Actually it works find on my development environtment, but when I try it on
the production server it is not working. I've found that the problem is
because on my development server I've deleted the Administrator and Domain
Admins group the Deny for the Receive As and Send As, thus allowing the full
control over all mailbox. On the production server it's not the case. When I
put those Deny on my developpement server it is not working anymore, so this
confirm the problem.

So I would like to know if someone know how to resolve this problem ?
Someone know another way to do the same task without this problem ?

any help will be apreciate, I attach the code here.

Eric



The code is this one for scanning the Inbox of the user2:
-----------------------------------------------------------------
_ConnectionPtr conn(__uuidof(Connection));
_RecordsetPtr MyFolders(__uuidof(Recordset));
_RecordsetPtr MyPublicFolders(__uuidof(Recordset));
_RecordPtr MyRecord(__uuidof(Record));
FieldsPtr Flds;
FieldPtr Fld;
_bstr_t strURL;


conn->Provider = "Exoledb.DataSource";
_bstr_t szConnString = "file://./backofficestorage/" + strDomainName +
"/mbx/user2/Inbox";
hRes = conn->Open(szConnString,"","",0);

_bstr_t strQ = "select * from scope ('shallow traversal of \"" +
szConnString + "\"') ";
hRes =
MyFolders->Open(strQ,conn->ConnectionString,adOpenForwardOnly,adLockPessimistic,0);
int reccount = MyFolders->RecordCount;

MyFolders->MoveFirst();


for(int i=0;i<reccount;i++)
{
Flds = MyFolders->GetFields();
Fld = Flds->GetItem("DAV:href");
strURL = (_bstr_t)Fld->Value;

printf("URL: %s\n", (char *)strURL );

MyFolders->MoveNext();
}

This is the security error. Is is an exception that arise on this
instruction hRes =
MyFolders->Open(strQ,conn->ConnectionString,adOpenForwardOnly,adLockPessimistic,0);

----COM Error-----
Code = 80040e09
Code meaning = IDispatch error #3081
Source = Provider
Description = Permission denied.
------------------

Back to top
Glen Scales [MVP]
Guest





Posted: Tue Sep 20, 2005 12:58 am    Post subject: Re: permission problem when opening mailbox with ADODB y OLE Reply with quote

Have a look at http://support.microsoft.com/?kbid=262054 which gives methods
of granting users this type of access to all mailboxes.

Cheers
Glen

"Eric Lajeunesse" <EricLajeunesse@discussions.microsoft.com> wrote in
message news:DD0F0D9F-7A9D-4CFB-9BD0-4C9897AEFFB3@microsoft.com...
Quote:
Hi, the task I want to realize with my application is to read all the
message
of any mailbox and alter some message according to their maliscious
contents.

Actually it works find on my development environtment, but when I try it
on
the production server it is not working. I've found that the problem is
because on my development server I've deleted the Administrator and Domain
Admins group the Deny for the Receive As and Send As, thus allowing the
full
control over all mailbox. On the production server it's not the case. When
I
put those Deny on my developpement server it is not working anymore, so
this
confirm the problem.

So I would like to know if someone know how to resolve this problem ?
Someone know another way to do the same task without this problem ?

any help will be apreciate, I attach the code here.

Eric



The code is this one for scanning the Inbox of the user2:
-----------------------------------------------------------------
_ConnectionPtr conn(__uuidof(Connection));
_RecordsetPtr MyFolders(__uuidof(Recordset));
_RecordsetPtr MyPublicFolders(__uuidof(Recordset));
_RecordPtr MyRecord(__uuidof(Record));
FieldsPtr Flds;
FieldPtr Fld;
_bstr_t strURL;


conn->Provider = "Exoledb.DataSource";
_bstr_t szConnString = "file://./backofficestorage/" + strDomainName
+
"/mbx/user2/Inbox";
hRes = conn->Open(szConnString,"","",0);

_bstr_t strQ = "select * from scope ('shallow traversal of \"" +
szConnString + "\"') ";
hRes =
MyFolders->Open(strQ,conn->ConnectionString,adOpenForwardOnly,adLockPessimistic,0);
int reccount = MyFolders->RecordCount;

MyFolders->MoveFirst();


for(int i=0;i<reccount;i++)
{
Flds = MyFolders->GetFields();
Fld = Flds->GetItem("DAV:href");
strURL = (_bstr_t)Fld->Value;

printf("URL: %s\n", (char *)strURL );

MyFolders->MoveNext();
}

This is the security error. Is is an exception that arise on this
instruction hRes =
MyFolders->Open(strQ,conn->ConnectionString,adOpenForwardOnly,adLockPessimistic,0);

----COM Error-----
Code = 80040e09
Code meaning = IDispatch error #3081
Source = Provider
Description = Permission denied.
------------------


Back to top
 
Post new topic   Reply to topic    Exchange Server Forum Index -> Development All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server Dedicated Servers
Contact Us
New Topics Powered by phpBB