Can't read nested email attachment

未關閉
#2,360 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
5/5
預估耗時
一週以上
新手友好度
30/100
Issue 類型
缺陷
描述清晰度
需要釐清
活躍度
停滯
技術堆疊
java
領域
api

研究方向

首先使用 SDK 6.34.0 重現 Outlook 桌面版情境,並檢查針對 message/rfc822 內容的 attachments() 結果。接著,將 byMessageId(...) 使用的附件 ID 與傳回的郵件進行比較,並判斷是否支援預期的巢狀郵件擷取;行為獲得修正或其限制獲得明確確認,即表示完成。

由索引模型根據 Issue 內容生成。

描述

status:waiting-for-triage type:bug
Describe the bug

My email message has a attachment which is also an email. The SDK sees this attachment as FileAttachment. With the contentType I can detect that the attachment is in fact an email (message/rfc822). But I don't have the possibility to retrieve this messages with it's own attachments. I tried the following with the id of the attachment but it seems it returns the original email and not the email as attachment even though the id of the original email and the id of the email attachment differ:

graphClient.users().byUserId(username).messages().byMessageId(attachment.id).get()

Apparently this situation occurs when attaching another email as attachment with the Oulook desktop application. When I do this in Gmail the attached emails are shown as ItemAttachment.

Expected behavior

Well I first expected that an email attachment would be an ItemAttachment type instead of a FileAttachment. Second I expected that: graphClient.users().byUserId(username).messages().byMessageId(attachment.id).get() would return the email attachment instead of the original email.

How to reproduce

In the Outlook desktop application create an email which has another email as attachment (EML format). The email as attachment also has an attachment. Try to retrieve all (nested) attachments from the original email using:

graphClient.users().byUserId(username).messages().byMessageId(mailId).attachments().get().value?.forEach { attachment ->
 if (attachment is ItemAttachment) {
...
}
 else if (attachment.contentType == "message/rfc822") {
val message = getUser().messages().byMessageId(attachment.id).get()
// handle nested emails
}
else if (attachment is FileAttachment) {
}
}
SDK Version

6.34.0

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output
Click to expand log ```
</details>


### Configuration

macOS Sequoia
M4 Max

### Other information

_No response_
主要語言
Java
星號
444
分支
154
平均合併
18 小時 28 分鐘
30 天內合併 PR
4

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

microsoftgraph/msgraph-sdk-java 的其他 Issue

查看 microsoftgraph/msgraph-sdk-java 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。