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

  1. Step 1: Connect to your server

    Establish a connection to your Linux server using SSH.

  2. Step 2: Configure PHP upload limits

    Edit the file /etc/psa-webmail/horde/horde/php.ini and add the following settings:

    upload_max_filesize = 256M
    post_max_size = 256M

    These values set the maximum file upload size to 256MB. Adjust as needed for your requirements.

  3. Step 3: Configure Horde attachment limit

    Modify the attach_size_limit value in /etc/psa-webmail/horde/imp/conf.php. Set it to 0 for 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;
  4. 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
  5. 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/
  6. Step 6: Modify FcgidMaxRequestLen directive

    Update 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/horde.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 completes the configuration and applies the attachment size limit to all Horde Webmail accounts on your server.