Adjusting the maximum attachment size in Roundcube Webmail is essential when you encounter difficulties sending large documents via email. This guide shows Plesk administrators how to configure memory limits and PHP settings to allow larger attachments across all domains on a Plesk server.
So here's how
-
Step 1: Connect to your server via SSH
Connect to your Linux server using SSH with administrator credentials.
-
Step 2: Configure PHP upload limits
Modify the file
/etc/psa-webmail/roundcube/php.iniwith the following settings:upload_max_filesize = 100M post_max_size = 100M -
Step 3: Set Roundcube maximum message size
Open the file
/usr/share/psa-roundcube/config/config.inc.phpand add or modify:$config['max_message_size'] = '133M';Note: This value should be approximately 33% higher than your upload limit to account for base64 encoding overhead.
-
Step 4: Create custom webmail template directory
Create a new directory for custom webmail templates:
mkdir -p /usr/local/psa/admin/conf/templates/custom/webmail -
Step 5: Copy the Roundcube template
Copy the default Roundcube template to your custom directory:
cp /usr/local/psa/admin/conf/templates/default/webmail/roundcube.php /usr/local/psa/admin/conf/templates/custom/webmail/ -
Step 6: Modify FcgidMaxRequestLen directive
Modify 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/roundcube.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 ensures the specified changes are implemented for all domains on your Plesk server.