microsoftgraph / microsoftgraph/msgraph-sdk-java
Can't read nested email attachment
Personne n'a encore pris cette issue.
- Langage dominant
- Java
- Étoiles
- 444
- Forks
- 154
- Merge moyen
- 18 h 28 min
- PR mergées (30 j)
- 4
Description
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_
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par reproduire le scénario Outlook Desktop avec SDK 6.34.0 et examinez les résultats de attachments() pour le contenu message/rfc822. Comparez ensuite l’identifiant de pièce jointe utilisé par byMessageId(...) avec le message renvoyé et déterminez si la récupération attendue de l’e-mail imbriqué est prise en charge ; la tâche est terminée lorsque le comportement est corrigé ou que sa limitation est clairement établie.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- java
- Domaine
- api
- Type d'issue
- Bug
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Activité
- À l'abandon
- Clarté
- À clarifier
- Accessibilité débutants
- 30/100