我正在使用ews-java-api
我需要使用别名电子邮件过滤电子邮件。
我的意思是,我有一个邮件帐户a@b.com和一个别名电子邮件b@b.com这个帐户。
现在用户可以发送电子邮件到b@b.com,这封电子邮件发送到a@b.com的索引,现在我需要过滤这些来自b@b.com地址的电子邮件
我已尝试过以下代码,但没有帮助提交b@b.com的别名
FindItemsResults<Item> fiResults = exchangeService.findItems(WellKnownFolderName.Inbox, new ItemView(100));
PropertySet propertySet = new PropertySet(BasePropertySet.FirstClassProperties, ItemSchema.MimeContent);
exchangeService.loadPropertiesForItems(fiResults, propertySet);
for (Item item : fiResults) {
String messageContent = new String(((EmailMessage) item).getMimeContent().getContent());
System.out.println(messageContent);
}
输出是这样的:
"null" -> "Received: from .namprd11.prod.outlook.com
by .namprd11.prod.outlook.com with HTTPS via
PROD.OUTLOOK.COM; Tue, 27 Mar 2018 07:21:50 +0000
Received: from namprd11.prod.outlook.com (10.175.62.11) by
namprd11.prod.outlook.com (10.172.70.13) with Microsoft SMTP
Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id
15.20.609.10; Tue, 27 Mar 2018 07:21:49 +0000
Received: from CY4PR11MB1941.namprd11.prod.outlook.com
([fe80::dcc2:abd8:21c8:9bba]) by .namprd11.prod.outlook.com
([fe80::dcc2:abd8:21c8:9bba%18]) with mapi id 15.20.0609.012; Tue, 27 Mar
2018 07:21:49 +0000
From: "user, pre" <a@b.com>
To: " pre" <a@b.com>
Subject: Testing Emails with One attachment
Thread-Topic: Testing Emails with One attachment
Thread-Index: AQHTxZxElAIQ6TfnUU+t50OSMcm/SQ==
Date: Tue, 27 Mar 2018 07:21:49 +0000
Me"
在上述输出中显示a@b.com,但实际上我是从b@b.com发送的,也是来自b@b.com
需要帮助