We have Email Archive application which will continuesly fetch the
email from Journaling mailbox. Envelope Journaling is turned on and
thus all the messages are embedded attached messages.
The application is working for some time and we are able to process
the embedded messages. At one point/time MAPI call
IMessage::OpenProperty() fails with the error 0x80004005
(MAPI_E_CALL_FAILED) and failed to open/process the embedded message.
Once we recieve this error, all subsequent messages fetch from
journaling mailbox also reports the same error. We move/store these
failed archived messages to "Sent Items" folder.
If we restart our applications and move the above failed messages from
"Sent Items" folder back to Inbox folder, they get processed fine
without any error. The application will work over the period and again
start recieving error 0x80004005 (MAPI_E_CALL_FAILED).
Your help and time is appreciated in advance.
Following is the C++ code snapshot we are using...
CComPtr<IAttach> pAttach;
//Step 1 - Open the envelope based on the LTID
if (FAILED (hr = m_pSession->OpenEntry( lpEid->cb, //LPSBinary lpEid
is passed
(LPENTRYID)lpEid->lpb,
NULL,
MAPI_MODIFY ,
&ulObjType,
(IUnknown **)&pEnvelope.p) ))
{
return hr ;
}
//Setp 2 - Once we have the envelope we get the 1st attachment, which
is the message.
// Remember the message is always in position 0 of the envelope.
ULONG ulFlags = MAPI_DEFERRED_ERRORS ;
if ( FAILED (hr = pEnvelope->OpenAttach( 0,
NULL,
ulFlags,
&pAttach.p ) ))
{
return hr ;
}
//Step 3 - Now that we have the attachment we need to query for the
the message.
if ( FAILED(hr = pAttach->OpenProperty( PR_ATTACH_DATA_OBJ ,
(LPIID)&IID_IMessage,
0,
MAPI_MODIFY ,
(IUnknown **)&pMsg.p) ))
{
return hr ;
}
Thanks,
Sameer
--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"Sameer" <sammo...@gmail.com> wrote in message
news:b7fc735f-88c7-4dfb...@s31g2000yqs.googlegroups.com...