Menu ▾ ▴

#2873 SquirrelMail 1.4.23-svn: PHP 8.5 compatibility and IMAP SEARCH response handling

Produces PHP errors
open
None
1
2 days ago
2 days ago
Dave Wreski
No

This patch makes the latest squirrelmail-1.4.23-svn work with php-8.5.12

Environment

  • Fedora 44
  • PHP CLI and PHP-FPM 8.5.12
  • SquirrelMail 1.4.23-svn, originally installed from the July 30, 2024 snapshot, with local compatibility patches
  • Dovecot IMAP backend

Summary

We encountered PHP compatibility warnings and IMAP search/message handling failures in this installation. We previously described related fixes on the squirrelmail-users mailing list under:

“SquirrelMail 1.4.23-svn: PHP 8.5 compatibility and IMAP search/message error handling (patches attached)”

This ticket provides a persistent place to review the core changes and their validation. SquirrelSpell changes are being discussed separately under bug #2869.

Reproduced SEARCH failure

The IMAP reader can discard a valid SEARCH response when the server also returns an unsolicited FETCH flag update.

For example:

  • 2 FETCH (FLAGS (\Seen) UID 42)
  • SEARCH 42 43
    A1 OK Search completed

Using the affected reader with a SEARCH command returns only the FETCH flag-update group. The caller then reports that no SEARCH response was received, even though the server supplied one.

Expected behavior

Preserve the SEARCH response while keeping unrelated FETCH responses and message literal contents out of search-result parsing.

Proposed changes

  • Preserve SEARCH response data when separate FETCH response groups are present.
  • Select the requested BODY response group separately from unrelated flag updates.
  • Handle unavailable message bodies visibly without attempting to resend page headers.
  • Improve failure diagnostics without logging message bodies or search terms.

Validation

The SEARCH failure was reproduced locally using the affected reader and a controlled IMAP response fixture.

Regression tests cover SEARCH responses mixed with flag updates, empty search results, exclusion of FETCH literal contents from search parsing, and body retrieval with unrelated response groups.

The deployed changes passed PHP syntax checks and regression tests under PHP 8.5.12. PHP-FPM configuration validation and reload also succeeded.

Limitations

These are targeted compatibility and response-handling fixes, not a claim of complete PHP 8.5 compatibility.

An IMAP success response without body data can be legitimate when the requested UID no longer exists. The changes improve handling and diagnostics; they cannot recover a removed message.

Separate mailbox-list rendering warnings remain under investigation.

Patch baseline

The public diff needs to identify the exact upstream revision or source-file hashes used for comparison. Our production snapshot date should not be treated as proof that every issue remains present in current SM-1_4-STABLE.

Dave Wreski
Guardian Digital

6 Attachments

Discussion


Log in to post a comment.