microsoftgraph / microsoftgraph/msgraph-sdk-java

Can't read nested email attachment

Offen
#2,360 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

status:waiting-for-triage type:bug
Vorherrschende Sprache
Java
Sterne
444
Forks
154
Ø Merge
18 Std. 28 Min.
Gemergte PRs (30 T.)
4

Beschreibung

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_

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, das Outlook-Desktop-Szenario mit SDK 6.34.0 nachzustellen und die Ergebnisse von attachments() für message/rfc822-Inhalte zu prüfen. Vergleiche dann die von byMessageId(...) verwendete Anhang-ID mit der zurückgegebenen Nachricht und stelle fest, ob der erwartete Abruf verschachtelter E-Mails unterstützt wird; abgeschlossen ist die Aufgabe, wenn das Verhalten korrigiert oder seine Einschränkung eindeutig festgestellt wurde.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
java
Bereich
api
Issue-Typ
Bug
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
30/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.