/
/
Changing the maximum attachment size in Roundcube

Changing the maximum attachment size in Roundcube

Why?

A larger attachment limit may be required when sending large files within the same email domain.

Instructions

PLEASE NOTE!

In the ispmanager 6.107.0 or earlier change settings of the native version of PHP (marked as "native") instead of changing settings of the PHP 7.4.

If you run server under CloudLinux you need to change settings of the PHP 7.4. manually in its configuration file in /opt/php74/etc/php.ini or in pool configuration of the Roundcube in /opt/php74/etc/php-fpm.d/roundcube.php-fpm.conf.

To increase the attachment size limit in Roundcube, you will need to change the alternate PHP 7.4.33 settings under "Settings" - "PHP Settings". Select the alternate PHP 7.4.33 (marked as "alt") and click "Advanced Settings", then change the following settings:

  • max_execution_time
  • upload_max_filesize
  • post_max_size

 

When setting these values, keep in mind that post_max_size should be at least twice the value of upload_max_filesize.

You should also check that the memory_limit is not less than the upload_max_filesize.

Next, change the parameter $config['max_message_size'] in the configuration file /etc/roundcube/defaults.inc.php – the size limit of attachments in Roundcube itself is 75% of this parameter.

Note that Exim's default email size limit is 50MB:

#exim -bP | grep message_size_limit
message_size_limit = 50M

Even if you increase this value on your mail server, there is no guarantee that the target recipient will be able to accept an email of this size due to standard Exim limitations.

So if you change this parameter, it is recommended to check whether other mail services can receive huge emails, as they may simply not be received, getting rejected by the recipients.

In this article