简体   繁体   中英

How do I search for a redirected email using EWS JAVA api?

I am sending an email using EWS and before I send it, I obtain the Message-ID of the message and using this I can search the email in the recipient mailbox (A). This email further gets automatically redirected to another mailbox (B) based on a rule set in outlook and I want to search the email in the redirected mailbox (B). Now since the Message-ID is different, I cant search the email based on Message-Id. Is there any way out for this?

    Received: from ****************** (**********) by
 *********************** with Microsoft SMTP Server (TLS) id

Received: from ****************([********************]) by
 ******************* ([*****************]) with mapi id *******************; Thu,
 3 May 2018 09:33:45 +1200
Content-Type: application/ms-tnef; name="winmail.dat"
Content-Transfer-Encoding: binary
From: ************************
To: **************************
Subject: From: ******************************
Thread-Topic: From: ******************************
Thread-Index: ************************
Date: Thu, 3 May 2018 09:33:44 +1200
Message-ID: <******************@************
Accept-Language: en-US, en-NZ
Content-Language: en-US
X-MS-Has-Attach:
X-MS-Exchange-Organization-SCL: -1
X-MS-TNEF-Correlator: ******************************>
MIME-Version: 1.0
X-MS-Exchange-Organization-AuthSource: **********************
X-MS-Exchange-Organization-AuthAs: Internal
X-MS-Exchange-Organization-AuthMechanism: 04
X-Originating-IP: [10.70.34.43]
Return-Path: *************************

The PR_INTERNET_REFERENCES property https://msdn.microsoft.com/en-us/library/office/cc839592.aspx (or the MIME References Message header) should contain the original MessageId, however if its been forward,replied multiple times this property won't just contain that MessageId but all the associated MessagesId's. I would suggest you look at a Message using and MAPI editor like MFCMapi or OutlookSpy which will let you see both the PR_INTERNET_REFERENCES and the PR_TRANSPORT_MESSAGE_HEADERS_W properties and then you can build you search from there.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM