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

  1. Step 1: Connect to your server via SSH

    Connect to your Linux server using SSH with administrator credentials.

  2. Step 2: Configure PHP upload limits

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

    upload_max_filesize = 100M
    post_max_size = 100M
  3. Step 3: Set Roundcube maximum message size

    Open the file /usr/share/psa-roundcube/config/config.inc.php and 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.

  4. 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
  5. 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/
  6. Step 6: Modify FcgidMaxRequestLen directive

    Modify the FcgidMaxRequestLen directive 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
  7. Step 7: Apply changes to all webmail accounts

    Execute the following command to apply the template changes across all webmail accounts:

    plesk repair web -server

    This ensures the specified changes are implemented for all domains on your Plesk server.