mirror of
https://github.com/root-fr/jmap-webmail.git
synced 2026-09-24 00:01:14 +00:00
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.