Issue Description
A message sent to a mailbox on the same server is delivered within a second, undoStatus becomes final, but deliveryStatus.<rcpt>.delivered is unknown forever and smtpReply keeps the queue reply. Clients cannot show “delivered” even for internal mail, where the server knows the result.
Expected Behavior
RFC 8621, section 7 (deliveryStatus / delivered):
"yes": “The message was successfully delivered to the mail store of the recipient. The smtpReply property is final.”"unknown": “The final delivery status is unknown, (e.g., it was relayed to an external machine and no further information is available).”
For a local recipient the final status is known, so after delivery delivered should be "yes" (or "no" on failure) with the final reply.
Actual Behavior
curl -s -u "[email protected]:$PASS1" -H 'Content-Type: application/json' https://mail.example.com/jmap/ -d '{
"using": ["urn:ietf:params:jmap:core", "urn:ietf:params:jmap:mail", "urn:ietf:params:jmap:submission"],
"methodCalls": [
["Email/set", {"accountId": "c", "create": {"e": {"mailboxIds": {"<drafts>": true}, "keywords": {"$draft": true},
"from": [{"email": "[email protected]"}], "to": [{"email": "[email protected]"}], "subject": "probe now",
"bodyValues": {"1": {"value": "probe"}}, "textBody": [{"partId": "1", "type": "text/plain"}]}}}, "e"],
["EmailSubmission/set", {"accountId": "c", "create": {"s": {"identityId": "<identity>", "emailId": "#e",
"envelope": {"mailFrom": {"email": "[email protected]"}, "rcptTo": [{"email": "[email protected]"}]}}}}, "s"]]}'
["EmailSubmission/set", {"accountId": "c", "newState": "ssica", "created": {"s": {"id": "bq",
"sendAt": "2026-10-21T11:00:04Z", "undoStatus": "pending"}}}, "s"]
The recipient has the message with receivedAt 2026-10-21T11:00:04Z. EmailSubmission/get one second and again 25 seconds later returns the same:
["EmailSubmission/get", {"accountId": "c", "state": "ssica", "list": [{"undoStatus": "final",
"deliveryStatus": {"[email protected]": {"delivered": "unknown", "smtpReply": "250 2.1.5 Queued",
"displayed": "unknown"}}, "sendAt": "2026-10-21T11:00:04Z", "id": "bq"}], "notFound": []}, "g"]
Reproduction Steps
The exact requests and responses are under Actual Behavior.
Stalwart Version
v0.16.x
Installation Method
Docker
Database Backend
RocksDB
Blob Storage
RocksDB
Search Engine
Internal
Directory Backend
Internal
Additional Context
Where it seems to come from:
crates/jmap/src/submission/set.rs stores Delivered::Unknown with “250 2.1.5 Queued” at creation. crates/jmap/src/submission/get.rs overrides it with live per-recipient status (Completed → Yes, PermanentFailure → No) only while the message is still in the queue (read_message_archive(queue_id)). Once the queue entry is removed after delivery, the stored creation-time value is returned again, so the final status is lost. Persisting the final per-recipient status into the EmailSubmission when the queue entry completes (or keeping it until the submission expires) would fix it.
Stalwart v0.16.27, Docker image stalwartlabs/stalwart:v0.16-alpine, default setup from the bootstrap wizard.
I have reviewed the documentation and FAQ and confirm that my issue is NOT addressed there.
on
I have searched this support forum (open and closed topics) and confirm this is not a duplicate.
on
I understand that topics in this category are triaged by a bot first but a human reply will follow up. If I’d prefer a human-only reply, I’ll add the no-ai tag to my topic.
on