Reply drafts saved to the IMAP Drafts mailbox lose In-Reply-To and References
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 78/100
Direzione di ricerca
Leggi lib/IMAP/ImapTransmissionConnector.php, concentrandoti su saveMessage() e sulla gestione esistente delle intestazioni in sendMessage(). Aggiungi le intestazioni di risposta quando salvi le bozze, poi controlla nella sorgente della bozza la presenza di In-Reply-To e References; l’issue indica anche startComposerSession per verificare che le bozze riaperte mantengano la relazione di risposta.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
When a reply is saved as a draft and moved to the IMAP Drafts mailbox, the stored message has no In-Reply-To and no References header, although the local draft knows the message it replies to (inReplyToMessageId).
The headers are only written on the send path. ImapTransmissionConnector::sendMessage() adds them:
if (($inReplyTo = $message->getInReplyToMessageId()) !== null) {
$fccHeaders->addHeader('References', $inReplyTo);
$fccHeaders->addHeader('In-Reply-To', $inReplyTo);
}
ImapTransmissionConnector::saveMessage(), which DraftsService::sendMessage() uses to store a draft in the Drafts mailbox, builds its own header set (Date, Message-ID, From, To, Cc, Bcc, Subject) and does not include them.
Consequences
- Reopening a reply draft in Mail. When the composer is closed, the draft is moved to IMAP (
moveDraft). Reopening it from the Drafts mailbox goes through thetemplateMessageIdbranch ofstartComposerSession, which does not restoreinReplyToMessageIdeither. Sending it then produces a reply withoutIn-Reply-To/References. - Finishing a reply draft in another client (Thunderbird, Outlook, Apple Mail, mobile) via the shared IMAP Drafts folder. The other client sends the draft as stored, so the reply is not linked to the original.
- Drafts created through the API (
POST /api/draftswithinReplyToMessageId, thenPOST /api/drafts/move/{id}) are affected in the same way.
Replying and sending in one composer session works, because that goes through the outbox/send path.
Recipients' clients that thread by these headers (Thunderbird, Gmail, Apple Mail) show such a reply outside the conversation, and the sender's own original is not flagged as answered.
Steps to reproduce
- Open a received message and click Reply.
- Type some text and close the composer, so the draft is saved to the Drafts mailbox.
- View the source of the draft in the Drafts mailbox: no
In-Reply-To, noReferences. - Reopen the draft in Mail (or in any other IMAP client) and send it.
- View the source of the sent message: no
In-Reply-To, noReferences.
Alternatively via API: POST /apps/mail/api/drafts with inReplyToMessageId set, then POST /apps/mail/api/drafts/move/{id}, then GET /apps/mail/api/messages/{id}/source for the message in the Drafts mailbox.
Expected behavior
The draft stored in the Drafts mailbox carries In-Reply-To and References, like the sent copy does, so the reply relation survives closing the composer and switching clients.
Suggested fix
Add the same block to saveMessage() in lib/IMAP/ImapTransmissionConnector.php, after the Subject header:
if (($inReplyTo = $message->getInReplyToMessageId()) !== null) {
$headers->addHeader('References', $inReplyTo);
$headers->addHeader('In-Reply-To', $inReplyTo);
}
For consequence 1, the templateMessageId branch of startComposerSession could additionally take inReplyToMessageId from the fetched message's inReplyTo, so that a reopened draft keeps the relation when sent from Mail.
Environment
- Nextcloud server 33.0.9
- Mail app: code paths checked against current
mainon 2026-10-27 - IMAP account with a regular Drafts mailbox
- Lingua principale
- JavaScript
- Stelle
- 1.1k
- Fork
- 373
- Merge medio
- 1g 11h
- PR unite (30g)
- 91
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di nextcloud/mail
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
1. to develop bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
nextcloud/mail#13922 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
1. to develop enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
nextcloud/mail#13903 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[Feature]: Need a close preview button/option in mail viewForse già presa @steven-mpawulo l’ha presa 10 giorni fa. Aperta1. to develop enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
nextcloud/mail#13841 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
1. to develop enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
nextcloud/mail#13828 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di nextcloud/mail
Issue simili
-
Package downloads never retry: getUrlWithResuming's retry catch cannot see a rejected requestAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
account: profile bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 5 giorni
-
ai-driven-fuzzing bug claude Minor
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
linagora/cozy-client#1777 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
NanmiCoder/dsh-agent-teams#326 ·
I maintainer di solito rispondono entro 1 giorno
-
[guide] AGENTS.md claims the coverage gate, e2e and full lint run on every PR after ADR 0011 focused validationForse già presa @hivecommons-hive l’ha presa oggi. Apertaagent/guide documentation hive/claimed-by-guide stage/040-covered-by-pr
Difficoltà 2/5 1-3 ore Idoneità per principianti 81/100
cncf/endusers#2006 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno