Files
jmap-webmail/lib
Matthieu MALVACHE acbbcb134c fix(email): route outgoing mail through Drafts to avoid self-send dedup
Creating the outgoing Email directly in Sent before running
EmailSubmission/set makes Stalwart's duplicate-message check trigger
on inbound delivery when a user sends to themselves: the SMTP-
delivered copy matches the local Sent copy's Message-ID and gets
dropped, so the inbox stays empty.

Keep the email in Drafts (or the sent mailbox as a fallback if no
Drafts exists) during submission and let EmailSubmission's
onSuccessUpdateEmail atomically move it to Sent — clearing the
$draft keyword and setting $seen — only after the server has handed
the outbound copy to SMTP. SMTP delivery for email-to-self now sees
no existing Message-ID in the account and goes through.

Applies to both the draft-send and the send-from-scratch paths.
Closes #60.
2026-04-17 14:48:17 +02:00
..