Skip to content

Guard mailbox fetch against missing rows#7196

Open
onyangodonomondi wants to merge 15 commits intomailcow:stagingfrom
onyangodonomondi:codex/mailbox-empty-row-guard
Open

Guard mailbox fetch against missing rows#7196
onyangodonomondi wants to merge 15 commits intomailcow:stagingfrom
onyangodonomondi:codex/mailbox-empty-row-guard

Conversation

@onyangodonomondi
Copy link
Copy Markdown

@onyangodonomondi onyangodonomondi commented Apr 14, 2026

What does this PR include?

Short Description

This PR adds a guard in data/web/inc/functions.mailbox.inc.php so the mailbox details lookup returns false when no database row is found.

Without this check, the code can continue accessing $row[...] after an empty query result, which risks warnings or follow-on failures for invalid or missing mailbox lookups.

Affected Containers

  • php-fpm-mailcow

Did you run tests?

What did you tested?

  • Ran php -l inside php-fpm-mailcow for data/web/inc/functions.mailbox.inc.php
  • Logged into the local demo environment as demo@demo.localhost
  • Called the live mailbox details API for an existing mailbox
  • Called the live mailbox details API for a nonexistent mailbox
  • Confirmed the local UI still responds with HTTP 200 OK

What were the final results? (Awaited, got)

Awaited:

  • Existing mailbox lookups should continue returning normal mailbox details
  • Missing mailbox lookups should fail safely without warnings or fatal errors

Got:

  • Existing mailbox lookup returned the expected mailbox details for demo@demo.localhost
  • Missing mailbox lookup returned {} cleanly for missing-mailbox-check@mail.localhost
  • No syntax errors were detected in the updated PHP file
  • The local UI continued serving normally

DerLinkman and others added 15 commits December 9, 2025 13:29
* Initial plan

* Fix duplicate login announcement display

Co-authored-by: DerLinkman <62480600+DerLinkman@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: DerLinkman <62480600+DerLinkman@users.noreply.github.com>
…rify-hash

Support for PBKDF2-SHA512 hash algorithm in verify_hash() (FreeIPA compatibility) (issue 6646)
🐄🛡️ January 2026 Update | Limited EAS/DAV Access and Restricted Alias Sending
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.

6 participants