Skip to content

Comments

Throw SentMailboxNotSetException when sent mailbox not configured#30

Draft
Copilot wants to merge 6 commits intomainfrom
copilot/investigate-sentmailboxnotsetexception
Draft

Throw SentMailboxNotSetException when sent mailbox not configured#30
Copilot wants to merge 6 commits intomainfrom
copilot/investigate-sentmailboxnotsetexception

Conversation

Copy link

Copilot AI commented Feb 6, 2026

SentMailboxNotSetException was defined in the interface contract but never thrown. Error handling relied solely on status codes, resulting in generic error messages and no actionable feedback for missing sent mailbox configuration.

Changes

Backend

  • SentMailboxHandler now throws SentMailboxNotSetException with warning log (accountId, userId)
  • Chain catches exception, logs at info level (accountId, messageId), sets STATUS_NO_SENT_MAILBOX
  • OutboxController returns HTTP 403 with user-actionable message instead of generic error

Frontend

  • Added STATUS_NO_SENT_MAILBOX constant
  • OutboxMessageListItem displays "No 'Sent' folder configured. Please pick one in account settings" and disables retry button

Tests

  • Updated unit tests to verify exception throw/catch flow and dual logging

Example Flow

// SentMailboxHandler.php
if ($account->getMailAccount()->getSentMailboxId() === null) {
    $this->logger->warning('No sent mailbox configured', ['accountId' => ...]);
    throw new SentMailboxNotSetException();
}

// Chain.php
try {
    $result = $handlers->process($account, $localMessage, $client);
} catch (SentMailboxNotSetException $e) {
    $this->logger->info('Message send aborted: No sent mailbox', ['accountId' => ...]);
    $localMessage->setStatus(LocalMessage::STATUS_NO_SENT_MAILBOX);
    return $this->localMessageMapper->update($localMessage);
}

Error messages are now consistent across UI, API, and logs, providing clear guidance to configure sent folder in account settings.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/Art4/urllinker/zipball/d72c28bd68698ebb912783bc0e5caf6a8f0904b5
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/ArthurHoaro/favicon/zipball/2f2af255e4a2ea0abff2a1b34b51cf4e57e6a230
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/Cerdic/CSSTidy/zipball/ffc835dc6c122e96b7a13f9936a107e0dd0e84d6
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/MyIntervals/PHP-CSS-Parser/zipball/d8e916507b88e389e26d4ab03c904a082aa66bb9
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/PHPMailer/DKIMValidator/zipball/ce691bdbb8a2f122cdfa315169bc0e1cd1965b77
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/RubixML/ML/zipball/e0960dcb19c9722ccbc4826f5b9417a75fa01613
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/RubixML/Tensor/zipball/9f0ee170319280dcf081984adccefa8b0e6f06b8
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/amphp/amp/zipball/ded3d9be08f526089eb7ee8d9f16a9768f9dec2d
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/amphp/byte-stream/zipball/4f0e968ba3798a423730f567b1b50d3441c16ddc
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/amphp/parallel/zipball/508ca221f2f47235327db5120f0a89d43435b69b
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/amphp/parser/zipball/3cf1f8b32a0171d4b1bed93d25617637a77cded7
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/amphp/process/zipball/55b837d4f1857b9bd7efb7bb859ae6b0e804f13f
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/amphp/serialization/zipball/693e77b2fb0b266c3c7d622317f881de44ae94a1
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/amphp/sync/zipball/85ab06764f4f36d63b1356b466df6111cf4b89cf
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/andrewdalpino/OkBloomer/zipball/39321cb515c1e99128d28489b0187120ba7ce84c
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/bamarni/composer-bin-plugin/zipball/e7ef9e012667327516c24e5fad9903a3bc91389d
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/bytestream/Crypt_Blowfish/zipball/c1888c663374f8931d0d84768e3c61c53ee8aa4e
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/bytestream/Exception/zipball/d0f25e79a21f7de648f27ea49b902d13f596d5ca
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/bytestream/Idna/zipball/e625a869cd73c92d891dd63cf9558104d4d2e9d4
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/bytestream/Imap_Client/zipball/33dc825bb4fb0a3fc6c892625404807aee7cd861
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/bytestream/ListHeaders/zipball/2a0193be55ad69c210b6a8849b9df05cd4e3c202
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/bytestream/Mail/zipball/73f5798734caaf7c6aa3e7348ddc9e0d0b6a768e
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/bytestream/Mime/zipball/63eb21725983e437536d457135719df5a42e3cf4
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/bytestream/Secret/zipball/75d1575820d4422ad8c485fd3606652948d9f2b6
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/bytestream/Socket_Client/zipball/7687d26b43c65bbabdd9b6452770aaddea82946d
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/bytestream/Stream/zipball/98c1813c743342832b7d6c87be9ccfcf47bfef62
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/bytestream/Stream_Filter/zipball/ce3663e2baa11cd6bb927968fcb7cd90813f5355
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/bytestream/Stream_Wrapper/zipball/d9b8637203a3f7cdddf6a46691021a93604aae10
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/bytestream/Stringprep/zipball/ab90e418923f86b069b6e9a3d5f6a73f62255691
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/bytestream/Support/zipball/6e5d9594cf42f470ce1e2622a91a2acdf26d8ec0
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/bytestream/Text_Filter/zipball/f4654f42665c1784911c63de22f3ab2eca682380
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/bytestream/Text_Flowed/zipball/97153c2e68a600662c54eb02e973eda797134de1
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/bytestream/Translation/zipball/50b32bf614164e3e44deb23f4210e709f967cbc6
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/bytestream/Util/zipball/352b5aee46e2df0b85961c1bde47c03a6b440224
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/cweagans/composer-configurable-plugin/zipball/15433906511a108a1806710e988629fd24b89974
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/cweagans/composer-patches/zipball/bfa6018a5f864653d9ed899b902ea72f858a2cf7
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/ezyang/htmlpurifier/zipball/b287d2a16aceffbf6e0295559b39662612b77fcf
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/glenscott/url-normalizer/zipball/b8e79d3360a1bd7182398c9956bd74d219ad1b3c
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/gravatarphp/gravatar/zipball/6b9f6a45477ce48285738d9d0c3f0dbf97abe263
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/hamza221/html2text/zipball/77498a184e4bd59698a8daf458addd6d94c8dbf5
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/jeremykendall/php-domain-parser/zipball/98401b32371fc1a75d93d4653d311b38e71f0d82
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/joomla-framework/string/zipball/0b3d33564db389e27346f7e275c694897c939434
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/nextcloud-libraries/kitinerary-bin/zipball/58ae0fc814e7b78f29555261e88742396bbd4345
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/nextcloud-libraries/kitinerary-flatpak/zipball/9f5ea95be1e1f3b8f3a8637119c34f304766a877
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/nextcloud-libraries/kitinerary-sys/zipball/f54aae1a22c407befa41127fe92c57292e1db8bf
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/nextcloud-libraries/kitinerary/zipball/f27f6a465f9f38f015b522ebe7d70078d7aa14ed
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/nextcloud/horde-managesieve/zipball/fd81621064a4b4bef74aadeffa0e610d844314aa
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/nextcloud/horde-smtp/zipball/29b9a574136a067a206def77078cacc8f6acf3e5
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/php-fig/log-test/zipball/83acb6c12875ea4f349dc4fe8b7d8e239c2b3715
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/psalm/phar/zipball/8a38e7ad04499a0ccd2c506fd1da6fc01fff4547
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/symfony/deprecation-contracts/zipball/63afe740e99a13ba87ec199bb07bbdee937a5b62
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/symfony/polyfill-php82/zipball/5d2ed36f7734637dacc025f179698031951b1692
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/symfony/polyfill-php83/zipball/2fb86d65e2d424369ad2905e83b236a8805ba491
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)
  • https://api.github.com/repos/wamania/php-stemmer/zipball/d96509294ea843b4b86e4900df27424a6ea0ace8
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/14dZ6Y /usr/bin/composer install --quiet (http block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 5 commits February 6, 2026 08:11
Co-authored-by: printminion-co <145785698+printminion-co@users.noreply.github.com>
Co-authored-by: printminion-co <145785698+printminion-co@users.noreply.github.com>
Co-authored-by: printminion-co <145785698+printminion-co@users.noreply.github.com>
…tion

Co-authored-by: printminion-co <145785698+printminion-co@users.noreply.github.com>
Co-authored-by: printminion-co <145785698+printminion-co@users.noreply.github.com>
Copilot AI changed the title [WIP] Investigate usage of SentMailboxNotSetException and error handling Throw SentMailboxNotSetException when sent mailbox not configured Feb 6, 2026
Copilot AI requested a review from printminion-co February 6, 2026 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants