PHP-IMAP removed from php-core and dropped from Debian
Describe the issue The package PHP-IMAP has been dropped from php-core and isn't available in the main Debian 13 package list. Configuring z-push for Backend-IMAP no longer works on standard install.
To Reproduce Steps to reproduce the behavior: Install bare Debian 13 Install Z-Push and apache Configure z-push with define('BACKEND_PROVIDER', 'BackendIMAP'); php z-push-top.php -> FatalException: BackendIMAP(): php-imap module is not installed
apt install php-imap Package php-imap is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source
Error: Package 'php-imap' has no installation candidate
Expected behavior BackendIMAP should be available.
Screenshots Details of removal noted here https://php.watch/versions/8.4/imap-unbundled
Desktop (please complete the following information): N/A
Smartphone (please complete the following information): N/A
FWIW, here's how I worked around this with PHP 8.3/8.4:
cd /usr/local/src
git clone --depth 1 https://github.com/uw-imap/imap.git
git clone --depth 1 https://github.com/php/pecl-mail-imap.git
cd pecl-mail-imap
phpize
./configure \
--with-imap=shared,/usr/local/src/imap \
--with-imap-ssl=shared
make && make install
echo extension=imap > /etc/php.d/20-imap.ini
systemctl restart php-fpm
apachectl graceful
Update: It's impossible to run Z-Push on RedHat family OS 9 and 10.
- CentOS/Rocky/AlmaLinux 9 offers PHP 8.0.30, but no php-imap package. It's impossible to build php-imap package with php source rpm due to missing dependent packages like
c-client,libc-client-devel,libpq-devel, etc. - CentOS/Rocky/AlmaLinux 10 offers PHP 8.3.19, installing
imappackage withpeclfailed due to compile error.
Hope developers can figure out a way to get it working.
Hi @matidau,
Could you help take a look at this?
Strictly speaking, it is not impossible to run Z-Push on the RHEL 9/10, but it is significantly painful. You need to pull the uw-imap-2007f source package from the RHEL 8 EPEL and rebuild it, which will provide the missing build dependencies. Noting that libpq-devel requires activating the appstream repository and is part of RHEL9 at least.
The bigger issue is that php-imap is deprecated and for good reason. It depends on the IMAP extension to PHP, which in turn depends on uw-imap, which has not been updated since 2011, because the University of Washington abandoned it in 2008, and then the principal author (Mark Crispin) passed away in 2012.
As of PHP 8.4, the IMAP extension has been removed from PHP, following its long-term deprecation. Basically, the IMAP backend needs porting to an alternative IMAP library; otherwise, it will become unusable in due course. Exactly what the right way forward is I don't think I am qualified to say however. Personally, I am looking at ditching my custom mix of Roundcube, Radical, Z-Push and migrating to SoGo instead.
It might be worth looking at this repo for the pecl builds:
https://rpms.remirepo.net/enterprise/9.4/modular/x86_64/repoview/php-pecl-imap.html
Also has the php-imap 8.3 packages for el9:
https://rpms.remirepo.net/enterprise/9.4/modular/x86_64/repoview/php-imap.html
Haven't tested these, but they would be my starting point.
And to round things out for debian, it is in experimental, so should be supported soon https://tracker.debian.org/pkg/php-imap
And is in Ubuntu now https://launchpad.net/ubuntu/+source/php-imap
Long term we will create a second IMAP backend and move to one of the userland frameworks for IMAP.
The Remi repo requires you to replace the entire OS PHP stack with the REMI one. Not ideal and potentially unacceptable. Besides, the IMAP extension has been removed with PHP 8.4 for the reasons I outlined, making it a stopgap solution at best.
Long term we will create a second IMAP backend and move to one of the userland frameworks for IMAP.
These are the thoughts on it so far. https://github.com/Z-Hub/Z-Push/issues/126#issuecomment-2519066835
Personally, I am looking at ditching my custom mix of Roundcube, Radical, Z-Push and migrating to SoGo instead.
Hi @jabuzz,
Support for activesync will be removed in SOGo v6, replaced by MAPI over HTTP. https://www.sogo.nu/news/2025/sogo-v6-septembre.html
Hi @matidau
Would you mind sharing your plan?
follow up https://github.com/Z-Hub/Z-Push/issues/126