MAPI Session timeout

G

Guest

I have a pst file (1.5GB in size). There are over 1700 messages with very large attachement

I need to extrac each messages to files. I am using CDO, redemption to get those messages out.

However, when the applicaiton processes messages till 1200+. My application responses "MAPI session time out". How to hold the Mapi sesssion? I am using CDO to create MAPI.session

I need to process large .pst files and contains thousands of messages. Any possibility
 
D

Dmitry Streblechenko \(MVP\)

Which method returns the timeout error?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool


Roger said:
I have a pst file (1.5GB in size). There are over 1700 messages with very large attachement.

I need to extrac each messages to files. I am using CDO, redemption to get those messages out.

However, when the applicaiton processes messages till 1200+. My
application responses "MAPI session time out". How to hold the Mapi
sesssion? I am using CDO to create MAPI.session.
 
G

Guest

I dumped the error mesage.

Failed to add MAPI message [Collaboration Data Objects - [E_OUTOFMEMORY(8007000E)]

Here is what I did

MAPILogonEx() to logon session in a servic
Get Inbox Folder ptr using CD
Start to process folders in Inbo
( Use Redemption to get each message and then create RFC822 files

The applicaiton always stops when it processes to message 1100 - 1200.

Any clue
 
G

Guest

I think 'sItem->put_Item' is the place casued error. (Failed to add MAPI message [Collaboration Data Objects - [E_OUTOFMEMORY(8007000E)]]

the program stops when it processes Mesasge No 1200+

Redemption::ISafeMailItemPtr sItem
hr = m_SafeMailItemFactory->CreateInstance(NULL, __uuidof(Redemption::ISafeMailItem), (void**)&sItem)

for (int i=1; i<= MsgCount; i++
{
CurrentMsg = msgs->GetNext();

hr = sItem->put_Item(CurrentMsg);
hr = sItem->raw_SaveAs(_bstr_t(MsgFile), _variant_t((long)Redemption::blush:lRFC822));

}
 
D

Dmitry Streblechenko \(MVP\)

Hmmm... Redemption does not return any "Collaboration Data Objects" errors.
Are you sure it is 'sItem->put_Item' line? It could also be msgs->GetNext
line. Are you using straight VC++ or .Net?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool


Roger said:
I think 'sItem->put_Item' is the place casued error. (Failed to add MAPI
message [Collaboration Data Objects - [E_OUTOFMEMORY(8007000E)]])
the program stops when it processes Mesasge No 1200+.


Redemption::ISafeMailItemPtr sItem;
hr = m_SafeMailItemFactory->CreateInstance(NULL,
__uuidof(Redemption::ISafeMailItem), (void**)&sItem);
 
G

Guest

I am using C++

I will have more test on it this weekend

Also, if the error is really caused by GetNext(), will it be possible to use Redemption

Here is an example of my current pst file

- Inbox (728 message
- test1 (488 messages
- test2 (720 mesages) --> My application will fail here.

Actually, my application can't process the message over 1650. It fails at the message each time.
 
D

Dmitry Streblechenko \(MVP\)

How do you declare CurrentMsg? Do you release it *inside* of the for loop?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool


Roger said:
I am using C++.

I will have more test on it this weekend.

Also, if the error is really caused by GetNext(), will it be possible to use Redemption?

Here is an example of my current pst file.

- Inbox (728 message)
- test1 (488 messages)
- test2 (720 mesages) --> My application will fail here.

Actually, my application can't process the message over 1650. It fails at
the message each time.
 
D

Doru K

Hi, I'm new around here, and specially around Redemption, but I quickly
got to realize it's a great tool. I only have one question (for now :) -
I'm developing in Visual C++, and I'm trying to replace my old security
affected code, with the 'safe' code.

So, here is my old code:

//this is the code I want to replace:

CComPtr<Outlook::_NameSpace> spNS;
HRESULT hr = m_spApp->GetNamespace(T2W("MAPI"), &spNS);
CComPtr<Outlook::MAPIFolder> spContacts;
hr = spNS->GetDefaultFolder(olFolderContacts, &spContacts);
if(FAILED(hr))
return false;
CComPtr<Outlook::_Items> spItms;
hr = spContacts->get_Items(&spItms);
if(FAILED(hr))
return false;

CComPtr<IDispatch> spFirstItem;
hr = spItms->GetFirst(&spFirstItem);
if(FAILED(hr))
return false;
CString strTmp;
while(spFirstItem != NULL) //there are still addresses here
{
CComQIPtr<Outlook::_ContactItem> spFirstContactItem(spFirstItem);
//HOW DO I DO THIS IN THE CODE USING REDEMPTION???
BSTR emailAddress;
hr = spFirstContactItem->get_Email1Address(&emailAddress);
if(FAILED(hr))
return false;
strTmp = W2T(emailAddress);
if(!strTmp.IsEmpty())
m_saWhiteList.Add(strTmp);

spFirstItem.Release();
bFirstLoop = false;
hr = spItms->GetNext(&spFirstItem);
if(FAILED(hr))
break;
}


Now, I thought that I could use this instead:
...bla-bla
CComPtr<IDispatch> spFirstItem;
hr = spItms->GetFirst(&spFirstItem);
if(FAILED(hr))
return false;

ISafeContactItemPtr pSafeContact;
CLSID clsid;

if ((hr = ::CLSIDFromProgID(L"Redemption.SafeContactItem", &clsid)) !=
NOERROR)
{
return false;
}

if ((hr = ::CoCreateInstance(clsid, NULL, CLSCTX_INPROC_SERVER,
__uuidof(ISafeContactItem),
(void**)&pSafeContact)) != S_OK)
{
return false;
}

//HERE IS THE PROBLEM: How do I bound the info I have in spFirstItem, to
pSafeContact. In the old code, I only had to do this:
CComQIPtr<Outlook::_ContactItem> spFirstContactItem(spFirstItem);

CString strTmp;
if(pSafeContact != NULL)
{
BSTR emailAddress;
hr = pSafeContact->get_Email1Address(&emailAddress);
if(FAILED(hr))
return false;
strTmp = W2T(emailAddress);
bla-bla...
}

I hope I wasn't to complicated :) Actually, all I want to know is how do
I bound spFirstItem to pSafeContact. Thank you!

Doru K.
 
D

Dmitry Streblechenko \(MVP\)

You need to set the SafeContactItem.Item property to the original OOM
object:

pSafeContact->put_Item(spFirstContactItem);


Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top