Conversation
SentMailboxHandler aborted the send chain before the SMTP submission when the account had no sent mailbox mapped, so messages stranded in the outbox indefinitely with STATUS_NO_SENT_MAILBOX while the UI first reported success and then failure. Post-send handling of a missing sent mailbox already exists in CopySentMessageHandler, which marks the message STATUS_IMAP_SENT_MAILBOX_FAIL after the message went out. STATUS_NO_SENT_MAILBOX stays defined and mapped in the API for rows written by older versions. Fixes nextcloud#10546 Fixes nextcloud#4153 Assisted-by: DeepSeek-Harness:glm-5.3 Signed-off-by: Tarek Loubani <tarek@tarek.org>
tareko
requested review from
ChristophWurst,
GretaD and
kesselb
as code owners
September 9, 2026 16:38
This was referenced Sep 9, 2026
Contributor
|
Why would you keep |
Assisted-by: DeepSeek-Harness:glm-5.3 Signed-off-by: Tarek Loubani <tarek@tarek.org>
tareko
force-pushed
the
fix/send-without-sent-mailbox
branch
from
September 10, 2026 18:23
ce10e9e to
bf5bf7a
Compare
Author
|
Good point. Thank you and removed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note: Assisted by GLM 5.3.
Problem
When an account has no sent mailbox configured (
sent_mailbox_idisNULL— e.g. the IMAP server does not advertise special-use folders and the folder was never mapped),SentMailboxHandleraborts the send chain before the SMTP submission. The message strands in the outbox indefinitely withSTATUS_NO_SENT_MAILBOX, while the UI first shows "message sent" and then an error a few seconds later.Decision
There are two paths to addressing this: The first is to automatically generate some default folders like "Sent" - I felt this required a wider discussion. Instead, I chose to just allow the send and log a warning.
Changes
SentMailboxHandlerno longer blocks the chain: it logs a warning and continues, so the message is actually sent.CopySentMessageHandleralready handles the missing-sent-mailbox case after the SMTP send, marking the messageSTATUS_IMAP_SENT_MAILBOX_FAIL, which the API surfaces as 202 "sent, copying will be retried".STATUS_NO_SENT_MAILBOXstays defined and mapped inMessageApiControllerfor rows written by older versions.SentMailboxHandlerTestto assert the chain continues and no status is set pre-send.Testing
tests/Unit/Send/— 21 tests, 82 assertions ✅tests/Unit/Service/OutboxServiceTest.php— 14 tests ✅tests/Unit/Controller/MessageApiControllerTest.php— 19 tests ✅composer cs:check✅^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0); left to CIFixes #10546
Fixes #4153