Search Our Database

Error: “Server Error” While Uploading an Attachment in Roundcube Webmail

Last updated on |
by

Introduction

When uploading attachments in Roundcube Webmail, you might encounter a “Server Error.” This issue often arises from file size limits, server security rules (such as ModSecurity settings), or network interruptions.

ModSecurity is a web application firewall designed to protect servers by monitoring and blocking potentially harmful requests. However, its strict security rules can sometimes interfere with legitimate actions like uploading large files.



Prerequisites

  1. SSH Access: Ensure you have SSH access to the server running DirectAdmin.
  2. Root or Administrative Privileges: Required for resetting email send limits.
  3. DirectAdmin Access: Verify that DirectAdmin is properly installed and running on your server.
  4. Familiarity with CLI: Basic command-line interface knowledge is recommended.

Troubleshooting Guide

Access the Server via SSH

Step 1: Connect to Your Server

Use the terminal to connect to your server with the following command:

ssh root@your_server_ip

Replace your_server_ip  with the actual IP address of your server.

Step 2: Switch to Root Privileges

To execute administrative commands, switch to root privileges:

sudo su -

Check Server Logs for Errors

Step 1: Review Error Logs

Server logs can help identify errors related to file uploads. Use this command to search for relevant errors:

cat /var/log/httpd/error_log | grep limit

You might find an error message similar to:

Error: [Wed Jan 22 01:28:53.064969 2025] [security2:error] ModSecurity: Request body (Content-Length) exceeds the configured limit (13107200).

Increase the Upload Limit

Step 1: Update ModSecurity Settings

  1. Open the ModSecurity configuration file using vi editor:
    vi /etc/httpd/conf/extra/httpd-modsecurity.conf



  2. Press ito enter insert mode and modify this setting to increase the upload limit:
    SecRequestBodyLimit 31457280  # Set the limit to 30 MB
  3. Save your changes and exit the file by pressing Esc , typing :wq! , and pressing Enter .

Step 2: Restart the Web Server

  1. Apply the changes by restarting your web server:
    systemctl restart apache2  # For Debian/Ubuntu
    systemctl restart httpd    # For CentOS/Red Hat

Conclusion

This guide covers how to resolve “Server Error” issues in Roundcube Webmail related to upload limitations. By following these instructions, you can adjust your server’s configuration to support larger attachments.

For further assistance, communicate with our support team at support@ipserverone.com.