Changing Maximum Attachment Size in Webmail in Plesk

Changing Maximum Attachment Size in Webmail in Plesk

If you’re using Webmail on Plesk, you may want to limit the maximum attachment size that users can send back and forth. Gmail has it set at 25 MB. If the files are too large, then the mail may not get sent properly. Or the user might have trouble receiving it. To avoid such scenarios, consider limiting the maximum attachment size for the users.

The particular method for this purpose depends on whether you’re using Roundcube or Horde or any other software package.

Let’s explain the steps involved for Roundcube and Horde.

Roundcube

If you’re using Roundcube, here are the steps you need to follow:

For limiting attachment size to 75 MB:
  • Using SSH, connect to the server
  • Access the php.ini file at /etc/psa-webmail/roundcube/php.ini and insert the following lines or update the value:
Code:
upload_max_filesize = 75M
post_max_size = 75M
  • Then add the following line to the config.inc.php file at /usr/share/psa-roundcube/config/config.inc.php:
Code:
$config['max_message_size'] = '133M';
The last line is there to allow the value to be 133% higher than the preferred value.

To set a higher limit than 75 MB:
  • Create a custom templates directory using:
Code:
# mkdir -p
/usr/local/psa/admin/conf/templates/custom/webmail
  • Now copy the template to this folder using:
Code:
# cp /usr/local/psa/admin/conf/templates/default/webmail/roundcube.php /usr/local/psa/admin/conf/templates/custom/webmail/
  • Now, edit the FcgidMaxRequestLen directive. You have to specify the value in bytes like this:
Code:
# sed -i '/FcgidMaxRequestLen/c\FcgidMaxRequestLen 268435456' /usr/local/psa/admin/conf/templates/custom/webmail/roundcube.php
  • Apply the changes made to all the webmails using this command:
Code:
# plesk repair web -server
Horde

If you’re an Horde user, here are the steps you’d have to follow:
  • Using SSH, connect to the server
  • Edit the php.ini file at /etc/psa-webmail/horde/imp/conf.php and include/update the following lines:
Code:
upload_max_filesize = 256M
post_max_size = 256M
Next, you need to edit the conf.php file at /etc/psa-webmail/horde/imp/conf.php and set the ‘attach_size_limit’ value to 0 like this:

Code:
# grep attach_size_limit /etc/psa-webmail/horde/imp/conf.php
$conf['compose']['attach_size_limit'] = 0;
Note: Set higher values if it is required.
  • Next, edit the templates and apply the changes you’ve made. First, create the custom template directory using:
Code:
# mkdir -p
/usr/local/psa/admin/conf/templates/custom/webmail
  • Now, copy the templates to the newly-created directory with this command:
Code:
# cp
/usr/local/psa/admin/conf/templates/default/webmail/horde.php /usr/local/psa/admin/conf/templates/custom/webmail/
  • Edit the FcgidMaxRequestLen directive using this command:
Code:
# sed -i '/FcgidMaxRequestLen/c\FcgidMaxRequestLen 268435456' /usr/local/psa/admin/conf/templates/custom/webmail/horde.php
  • Lastly, apply the changes to all webmails using this command:
Code:
# plesk repair web -server
So that’s how you can increase or limit the maximum attachment file size in Plesk. For more assistance, get in touch with the hosting provider support team.
Author
kumkumsharma
Views
2,504
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from kumkumsharma

Top