Cantech Knowledge Base

Your Go-To Hosting Resource

How to Set Limit to Attachment Size for Horde on Plesk Server?

We want to ensure that our webmail system is functioning efficiently and securely when using a Plesk web hosting environment. If you’re using Horde webmail, you might be interested in knowing how to set or alter this limit; maybe you have users who are having difficulty uploading files that are too large, or you simply want to optimize webmail for quicker transfers by configuring appropriate maximum file uploads for your users.

Why Set a Limit on Attachment Size?

Limiting attachment sizes can:

  • Improve server performance
  • Prevent mail queue bottlenecks
  • Enhance security by blocking huge files
  • Optimize resource allocation across user

It brings us to the step-by-step process you can follow for both a Linux and Windows environment.

For Linux-Based Plesk Servers

1. Update PHP Configuration for Horde

Connect to your server using SSH, and edit the PHP settings specific to Horde:

sudo vi /etc/psa-webmail/horde/horde/php.ini

Add or modify these values:

upload_max_filesize = 256M
post_max_size = 256M

These settings define the maximum file size a user can upload and the total allowed POST data.

2. Configure Horde’s Internal Attachment Limit

Next, tweak Horde’s internal configuration:

sudo vi /etc/psa-webmail/horde/imp/conf.php

Find and edit the following line:

$conf['compose']['attach_size_limit'] = 0;

Setting it to 0 removes the limit entirely. You can specify a number (in bytes) if you’d prefer a cap.

3. Update Webmail Templates

To ensure changes apply system-wide:

sudo mkdir -p /usr/local/psa/admin/conf/templates/custom/webmail
sudo cp /usr/local/psa/admin/conf/templates/default/webmail/horde.php /usr/local/psa/admin/conf/templates/custom/webmail/

Then, update the FastCGI request limit:

sudo sed -i '/FcgidMaxRequestLen/c\FcgidMaxRequestLen 268435456' /usr/local/psa/admin/conf/templates/custom/webmail/horde.php

This sets the limit to 256MB (in bytes).

4. Apply the Changes

To activate your changes:

sudo plesk repair web -server

This command rebuilds the webmail configuration for all domains.

5. Optional: Update ModSecurity Limits

If you’re running ModSecurity:

  • Go to Tools & Settings > Web Application Firewall (ModSecurity) > Settings
  • In the custom directives section, add:

SecResponseBodyLimit 268435456

Click “Apply” to save.

For Windows-Based Plesk Servers

1. Edit PHP Configuration

Using RDP, navigate to the following file:

%plesk_dir%\webmail\horde\conf\php.ini

Update these values:

upload_max_filesize = 64M
post_max_size = 128M

2. Adjust Horde’s Attachment Size Limit

Open the configuration file:

%plesk_dir%\Webmail\horde\horde\imp\config\conf.php
And change this setting:
$conf['compose']['attach_size_limit'] = 0;

3. Restart the SMTP and Web Services

Restart the necessary services through the Windows “Services” console, to apply all your settings.

In Conclusion

Limiting attachment size in Horde for Plesk is important for keeping the server healthy, protecting against abuse, and giving users a better experience. It does not matter if it’s a Linux or Windows server; these steps can keep your settings in line with your business practices.

FAQs

What is the default attachment size in Horde?

It varies by server config, typically around 2MB to 8MB. Updating PHP and Horde settings overrides this.

Does this limit affect incoming emails?

No. This only controls the size of attachments you send through Horde.

Can I completely remove the limit?

Yes, by setting attach_size_limit = 0, but be cautious of server load and abuse.

Why is my limit change not taking effect?

You may need to restart services or reapply webmail configurations using plesk repair web -server.

How do I check the current attachment size limit?

Check both php.ini and conf.php files, or send a test attachment in Horde to verify.

June 20, 2025