This guide shows how to configure attachment size limits for Horde Webmail on a Plesk server. By adjusting PHP memory limits and Horde configuration files, you can control the maximum size of email attachments that users can send through webmail.
How to Configure Attachment Size Limits
-
Step 1: Connect to your server
Establish a connection to your Linux server using SSH.
-
Step 2: Configure PHP upload limits
Edit the file
/etc/psa-webmail/horde/horde/php.iniand add the following settings:upload_max_filesize = 256M post_max_size = 256MThese values set the maximum file upload size to 256MB. Adjust as needed for your requirements.
-
Step 3: Configure Horde attachment limit
Modify the
attach_size_limitvalue in/etc/psa-webmail/horde/imp/conf.php. Set it to0for unlimited size, or specify a value in bytes:grep attach_size_limit /etc/psa-webmail/horde/imp/conf.php $conf['compose']['attach_size_limit'] = 0; -
Step 4: Create custom webmail template directory
To apply these changes across all domains, you need to customize the templates. Create a directory for custom webmail templates:
mkdir -p /usr/local/psa/admin/conf/templates/custom/webmail -
Step 5: Copy the Horde template
Copy the default Horde template to your custom directory:
cp /usr/local/psa/admin/conf/templates/default/webmail/horde.php /usr/local/psa/admin/conf/templates/custom/webmail/ -
Step 6: Modify FcgidMaxRequestLen directive
Update the
FcgidMaxRequestLendirective in the custom template with your desired value in bytes. For example, 256MB equals 268435456 bytes:sed -i '/FcgidMaxRequestLen/c\FcgidMaxRequestLen 268435456' /usr/local/psa/admin/conf/templates/custom/webmail/horde.php -
Step 7: Apply changes to all webmail accounts
Execute the following command to apply the template changes across all webmail accounts:
plesk repair web -serverThis completes the configuration and applies the attachment size limit to all Horde Webmail accounts on your server.