RoundCube not displaying mails with attachments over certain size

Abstract: Resolve RoundCube failing to display large email attachments by increasing PHP upload limits and IIS request size restrictions.

Created: 2026-09-18 by
RoundCube fails to display emails with large attachments because PHP and IIS enforce strict upload limits that truncate or block the request before RoundCube can process the message. To resolve this, you must increase the post_max_size and upload_max_filesize directives in your php.ini configuration file to exceed the size of the largest expected attachment. Additionally, ensure that IIS web server settings allow sufficiently large requests by updating the maxAllowedContentLength attribute in your web.config file.

Understanding the Limiting Factors

When an email client like RoundCube attempts to load a message containing a large attachment, the data travels from the mail server through the web server (IIS) and into the PHP runtime environment. Each layer has its own security and performance thresholds. If any single layer rejects the payload due to size constraints, the user sees a blank page, a timeout error, or simply does not see the attachment link in the interface. This is rarely a bug within RoundCube itself but rather a configuration mismatch between the application expectations and the server capabilities. The most common culprit is the PHP configuration. By default, many hosting environments set conservative limits to prevent resource exhaustion. However, for business or personal use cases involving media files, archives, or large documents, these defaults are often too restrictive. The second major factor is the Internet Information Services (IIS) module responsible for handling HTTP requests. IIS acts as a gateway, and if it blocks the incoming stream based on content length, PHP never even receives the full request body to parse.

Configuring PHP Limits Correctly

You need to modify the active php.ini file used by your IIS installation. Locate this file using the path specified in your server documentation or by creating a temporary phpinfo() script to identify the loaded configuration file path. Open the file in a text editor with administrative privileges. Search for the following directives and update them to values higher than your target attachment size. It is critical to understand that these values must be expressed in bytes or specific suffixes, not arbitrary strings.
  • upload_max_filesize: This controls the maximum size of individual uploaded files. Set this to at least 10MB larger than your largest expected attachment.
  • post_max_size: This controls the maximum size of the entire POST request. Since attachments are sent via POST, this value must be greater than upload_max_filesize. A good rule of thumb is to set this to roughly 1.5 times the upload_max_filesize.
For example, if you want to support 50MB attachments, you might set:
upload_max_filesize = 50M
post_max_size = 60M
Note that some older or misconfigured guides suggest using raw byte integers without units, which can lead to confusion. Modern PHP versions accept suffixes like 'M' for megabytes and 'G' for gigabytes. Ensure there are no comments (# or ;) preceding these lines that would disable them. After saving the file, you must restart the PHP service or the IIS worker processes for changes to take effect. Simply reloading the webpage will not apply new PHP ini settings.

Adjusting IIS Web Server Settings

Even if PHP allows large uploads, IIS may reject the request at the HTTP protocol level. IIS uses the <requestFiltering> section in the web.config file to limit request sizes. If this limit is lower than your PHP limits, the request will fail with a 404.13 or 404.12 error, or appear as a silent failure in RoundCube. Navigate to the root directory of your RoundCube installation or the site configuration folder. Open the web.config file. Look for the <security> > <requestFiltering> node. You need to add or modify the <requestLimits> element to include the maxAllowedContentLength attribute. This value must be specified in bytes. To calculate the byte value, multiply your desired megabyte limit by 1,048,576 (1024 * 1024). For a 50MB limit, the calculation is 50 * 1048576 = 52,428,800 bytes. Your configuration should look like this:
<configuration>
  <system.webServer>
    <security>
      <requestFiltering>
        <requestLimits maxAllowedContentLength="52428800" />
      </requestFiltering>
    </security>
  </system.webServer>
</configuration>
If the <requestLimits> tag already exists, simply update the maxAllowedContentLength attribute. Do not use string formats like "50M" here; IIS strictly requires integer byte values. Save the web.config file and recycle the application pool associated with your RoundCube site to ensure the new filter rules are loaded.

Verifying the Configuration

After applying both PHP and IIS changes, verify that the new limits are active. Create a simple PHP script named test_limits.php in your RoundCube directory with the following content:
<?php
phpinfo();
?>
Access this file via your browser and search for "upload_max_filesize" and "post_max_size". Confirm they reflect your updated values. While phpinfo does not directly show IIS limits, you can test the functionality by attempting to upload a file slightly smaller than your new limit through RoundCube's webmail interface. If the attachment appears correctly, the issue is resolved. If you continue to experience issues, check the IIS logs for HTTP status codes indicating rejection, such as 404.13, which points back to the web.config setting being insufficient or incorrectly formatted. For more advanced server management tasks, you might find it useful to explore how to manage application structures effectively. See How to Add a New Folder to Yii2 with Nginx for insights on organizing web application resources, which shares similar principles regarding server configuration hierarchy.

Frequently Asked Questions

Why do I get a 404.13 error after changing php.ini?

This error indicates that IIS rejected the request before passing it to PHP. It means your web.config maxAllowedContentLength is still too low. You must increase this byte-value limit in the IIS configuration to match or exceed your PHP settings.

Does restarting IIS clear the cache for these settings?

Yes, recycling the application pool or restarting the IIS service is required for both php.ini and web.config changes to take effect immediately. Without a restart, the server continues to use the previously cached configuration values.

Can I set different limits for different users in RoundCube?

No, these limits are enforced at the server level by PHP and IIS, not within the RoundCube application logic. All users accessing the same site instance share the same upload capacity constraints defined in the global configuration files.

What happens if post_max_size is smaller than upload_max_filesize?

PHP will fail to process the request entirely, often resulting in empty $_POST arrays or a fatal error. The post_max_size must always be greater than upload_max_filesize to accommodate the file data plus other form fields sent in the same request.

Is there a security risk in increasing these limits significantly?

Yes, allowing extremely large uploads can lead to denial-of-service attacks or disk space exhaustion. Always balance usability with server health, and consider implementing additional validation scripts or rate limiting if you expose your webmail to untrusted networks.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More