Skip to content

php: add the imap extension - #48

Open
rajtik76 wants to merge 1 commit into
flock-php:mainfrom
rajtik76:feature/107-imap-extension
Open

rajtik76 wants to merge 1 commit into
flock-php:mainfrom
rajtik76:feature/107-imap-extension

Conversation

@rajtik76

@rajtik76 rajtik76 commented Nov 5, 2026 •

Copy link
Copy Markdown

Part of flock-php/flock#107

What and why

imap left PHP's core in 8.4 and Flock's PHP doesn't have it, so apps requiring ext-imap can't run on Flock.

  • macOS and Linux: imap is added to shared_extensions, so every minor (8.1–8.5) ships ext/imap.so. 8.1–8.3 build the extension in php-src; 8.4+ build PECL imap 1.0.3, pinned in build.sh like opentelemetry. Linked against static-php-cli's c-client with OpenSSL, no Kerberos.
  • The 8.4+ tarballs still contain ext/imap/tests, so static-php-cli treats the extension as extracted and skips the PECL source. build.sh extracts php-src first and removes the leftover when it has no config.m4.
  • FrankenPHP: static-php-cli refuses imap in ZTS builds (not thread-safe). frankenphp.skip_extensions takes it out of the shared list in both jobs of the macOS and Linux workflows, so build, smoke test and flock-package.json agree.
  • Windows: the official builds have php_imap.dll up to 8.3. For 8.4 and 8.5 the packs add the PHP team's PECL DLL from downloads.php.net. Those have no published checksum, so php.windows.extensions.imap pins the SHA-256 per minor.
  • build raised for macOS, Linux and the Windows packs to rebuild the published versions.

Flock loads the extension with flock-php/flock#109.

How I tested it

CI on my fork, nothing published: runs

  • php 8.1.34, 8.2.35, 8.3.36, 8.4.27, 8.5.12 on macos-arm64, linux-x64 and linux-arm64: build, portability check and smoke test with REQUIRE_SHARED=1, then the fresh runner / no-Homebrew job.
  • frankenphp 8.4.27 on macos-arm64 and linux-x64: built without imap, smoke test passes.
  • php-exts 8.3, 8.4, 8.5: 8.4 and 8.5 load imap 1.0.3.

Locally, the official imap test suite (php-src ext/imap/tests for 8.1–8.3, PECL 1.0.3's for 8.4+) against Dovecot 2.3 with the suite's own config:

macOS (this build) Windows (official build + DLL)
8.1 87/87 87/87
8.2 89/89 89/89
8.3 89/89 89/89
8.4 88/88 88/88
8.5 88/88 88/88

Notes:

  • bug63126 is skipped everywhere: it needs a GSSAPI-capable client and server, and none of these builds has Kerberos (upstream skips it on CI too).
  • On PHP 8.5, imap_fetchbody_basic fails in the suite itself: it uses case 'FT_UID';, deprecated in 8.5. With : it passes. Not fixed upstream yet.
  • The Windows DLL has no CRAM-MD5, so Dovecot also offered PLAIN/LOGIN there.

A Laravel app's imap import tests that failed with Undefined constant "OP_SILENT" pass on the 8.4 and 8.5 macOS builds.

This branch has not been deployed

No deployments
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.

1 participant