Change maximum attachment size for webmail on Linux Plesk server

Want to change the maximum attachment size for webmail on the Linux Plesk server? We can help you.

As part of our Server Management Services, we assist our customers with several Plesk queries.

Today, let us see how our techs change the attachment size.

 

Change maximum attachment size for webmail on Linux Plesk server

Here, our Support Techs discuss how to change the attachment size on RoundCube and Horde.

  • RoundCube

Initially, we connect to the server via SSH.

Then in /etc/psa-webmail/roundcube/php.ini, we change the PHP settings as follows:

upload_max_filesize = 256M
post_max_size = 256M

We need to modify the templates and apply the change to all domains.

After that, we create the custom templates directory for webmail:

mkdir -p /usr/local/psa/admin/conf/templates/custom/webmail

Then we copy the template to the custom templates folder:

cp /usr/local/psa/admin/conf/templates/default/webmail/roundcube.php /usr/local/psa/admin/conf/templates/custom/webmail/

Later, we edit the FcgidMaxRequestLen directive in the custom template:

sed -i ‘/FcgidMaxRequestLen/cFcgidMaxRequestLen 268435456’ /usr/local/psa/admin/conf/templates/custom/webmail/roundcube.php

Finally, we apply the changes within the template to all webmails:

plesk repair web -server
  • Horde

Here, we first connect to the server via SSH.

Then we change the PHP settings as follows in /etc/psa-webmail/horde/horde/php.ini:

upload_max_filesize = 256M
post_max_size = 256M

In addition, we need to modify the horde attach_size_limit value at /etc/psa-webmail/horde/imp/conf.php. We set it to 0:

grep attach_size_limit /etc/psa-webmail/horde/imp/conf.php $conf[‘compose’][‘attach_size_limit’] = 0;

Then we modify templates and apply the change to all domains.

Once done, we create the custom templates directory for webmail:

mkdir -p /usr/local/psa/admin/conf/templates/custom/webmail

Then copy the template to the custom templates folder:

cp /usr/local/psa/admin/conf/templates/default/webmail/horde.php /usr/local/psa/admin/conf/templates/custom/webmail/

We also need to edit the FcgidMaxRequestLen directive in the custom template:

sed -i ‘/FcgidMaxRequestLen/cFcgidMaxRequestLen 268435456’ /usr/local/psa/admin/conf/templates/custom/webmail/horde.php

Finally, to apply changes within the template to all webmails, we run:

plesk repair web -server

However, if there is server-wide ModSecurity limitation or timeouts due to bandwidth, our Support Techs recommend the steps below:

  • If the server uses ModSecurity

  1. First, we log in to Plesk.
  2. Then we navigate to Tools & settings > Web Application Firewall (ModSecurity) > Settings > Custom directives
  3. Here, we add the directive:
    SecResponseBodyLimit 268435456
  4. Then we press Apply
  • If Bandwidth limitations cause a timeout

in this case, we connect to the server via SSH.

Then we backup the apache2 config file, increase the timeout delay up to 2 minutes and restart the apache2 server:

a) For Rhel-based OS:

cp /etc/httpd/conf.d/fcgid.conf{,.bkp}
sed -i ‘/FcgidIOTimeout/c FcgidIOTimeout 120’ /etc/httpd/conf.d/fcgid.conf
systemctl restart httpd2

b) For Debian-based OS:

cp /etc/apache2/mods-enabled/fcgid.conf{,.bkp}
sed -i ‘/FcgidIOTimeout/c FcgidIOTimeout 120’ /etc/apache2/mods-enabled/fcgid.conf
systemctl restart apache2

[Stuck in between? We’d be happy to assist you]

 

Conclusion

In short, we saw how our Support Techs fix the attachment issue for webmail.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED