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

Adjusting the maximum attachment size is crucial if you encounter difficulties sending documents via email. Plesk administrators can define a memory limit for Roundcube Webmail attachment sizes.

Setting Attachment Size Limit

  1. Connect to your Linux server using SSH.

  2. Modify the file /etc/psa-webmail/roundcube/php.ini with the following settings:

upload_max_filesize = 100M

post_max_size = 100M

  1. Open the file /usr/share/psa-roundcube/config/config.inc.php.

$config['max_message_size'] = '133M';

Note: The value mentioned here should be 33% higher than the limit you set.

Continuing, these adjustments must be applied across all domains, necessitating template modifications.

  1. Create a new directory for custom webmail templates:

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

  1. Copy or input this template into the directory:

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

/usr/local/psa/admin/conf/templates/custom/webmail/

  1. Modify the FcgidMaxRequestLen directive in the custom template with the specified value in Bytes. (For example: 256MB = 268435456 Bytes)

# sed -i '/FcgidMaxRequestLen/c\FcgidMaxRequestLen 268435456'

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

To complete the process, apply these changes across the templates of all webmail accounts.

  1. Execute the command:

# plesk repair web -server

This ensures a seamless implementation of the specified changes within the templates for all webmail accounts.


Was this article helpful?

mood_bad Dislike 0
mood Like 0
visibility Views: 254