[horde] IMP attachment upload limit with PHP-FPM and .user.ini
Admin Beckspaced
admin at beckspaced.com
Mon Sep 7 13:52:44 UTC 2026
Hello again,
just a small follow-up to my message from yesterday, as I noticed
something that might be relevant for diagnosing this issue.
On the same server I am also running Roundcube 1.6.16 with the same
Apache / proxy_fcgi / PHP-FPM setup.
Interestingly, Roundcube behaves exactly as I would have expected with
regard to .user.ini.
The PHP-FPM php.ini contains the default:
upload_max_filesize = 2M
For the Roundcube web directory I override the PHP limits via .user.ini,
and Roundcube correctly uses these values. Larger attachments can be
uploaded without having to define the values as php_admin_value in the
PHP-FPM pool configuration.
So, on the same server and with the same PHP-FPM setup, the situation is
basically:
Roundcube 1.6.16:
php.ini = 2M
.user.ini = higher value
-> higher .user.ini value is effective for attachment uploads
Horde / IMP:
php.ini = 2M
.user.ini = 32M
-> PHP test script reports 32M
-> IMP still rejects attachments above approximately 2 MB
-> only setting 32M as php_admin_value in the FPM pool solves it
This seems to indicate that .user.ini itself and the Apache/PHP-FPM
configuration are working correctly, since Roundcube can use the
overridden values without any problem.
I thought this comparison might be useful and perhaps helps to narrow
down why IMP behaves differently.
Greetings
Becki
Am 06.09.2026 um 11:08 schrieb Admin Beckspaced:
> Hello there :)
>
> I recently migrated my mail server from openSUSE Leap 15.6 to openSUSE
> Leap 16.0 and ran into a strange issue with attachment uploads in IMP.
>
> My current setup is:
>
> *
>
> openSUSE Leap 16.0
>
> *
>
> PHP 8.4.24
>
> *
>
> Apache with proxy_fcgi and PHP-FPM
>
> *
>
> Horde: dev-FRAMEWORK_6_0 (1b16603)
>
> *
>
> IMP: dev-FRAMEWORK_6_0 (3852464)
>
> *
>
> Horde Core: 3.3.0
>
> *
>
> Horde Browser: 3.0.0
>
> Horde is installed via Composer under:
>
> |/srv/www/horde/httpdocs|
>
> The active PHP-FPM configuration contained the PHP default:
>
> |/etc/php8/fpm/php.ini: upload_max_filesize = 2M|
>
> For the Horde installation I had a |.user.ini| in the web directory
> containing:
>
> |upload_max_filesize = 32M post_max_size = 40M memory_limit = 128M|
>
> I verified with a PHP test script in the same web environment that PHP
> reported these values from |.user.ini| correctly.
>
> Nevertheless, IMP refused attachments larger than approximately 2 MB
> and displayed:
>
> |Your attachment(s) are too large and cannot be uploaded.|
>
> IMP itself was configured with:
>
> |$conf['compose']['link_attachments'] = false;
> $conf['compose']['attach_size_limit'] = 0;
> $conf['compose']['attach_count_limit'] = 0;|
>
> According to IMP's |conf.xml|, |attach_size_limit = 0| means that
> there is no IMP-specific total attachment size limit.
>
> As a test I also explicitly set:
>
> |$conf['compose']['attach_size_limit'] = 33554432;|
>
> but this made no difference. IMP still rejected attachments larger
> than approximately 2 MB.
>
> I then looked at |Horde_Browser::allowFileUploads()|. As far as I
> understand the code, the upload limit is determined from:
>
> |ini_get('upload_max_filesize') ini_get('post_max_size')|
>
> with the smaller value being returned.
>
> What finally solved the problem was setting the limits directly in the
> active PHP-FPM pool configuration:
>
> |/etc/php8/fpm/php-fpm.d/www.conf|
>
> |php_admin_value[upload_max_filesize] = 32M
> php_admin_value[post_max_size] = 40M php_admin_value[memory_limit] =
> 128M|
>
> After restarting PHP-FPM, IMP immediately accepted larger attachments.
> I successfully tested uploads with attachments of 4.4 MB and 7.1 MB.
>
> So the practical problem is solved, but I would like to understand the
> reason for this behaviour.
>
> The interesting point for me is that the PHP-FPM |php.ini| definitely
> contained |upload_max_filesize = 2M|, while the |.user.ini| contained
> |upload_max_filesize = 32M|. A PHP test script in the Horde web
> environment reported the 32M value correctly, but IMP still behaved as
> if the 2M value from the FPM |php.ini| was being used.
>
> Only after setting the same 32M value as |php_admin_value| directly in
> the FPM pool did IMP accept larger attachments.
>
> Is there anything in IMP's dynamic attachment upload handling or in
> |Horde_Browser::allowFileUploads()| that could explain why the
> |.user.ini| value appeared to be effective in a PHP test script, but
> IMP still behaved according to the 2M FPM default?
>
> And is configuring these limits directly in the PHP-FPM pool the
> recommended way to configure Horde/IMP when using Apache with
> |proxy_fcgi| and PHP-FPM?
>
> Thanks in advance for any hints or explanations.
>
> Greetings
> Becki
>
>
More information about the horde
mailing list