Sucessful upload through round cube w/ 10MB file, then failed attempt with 650MB

Successful upload through round cube w/ 10MB file, then failed attempt with 650MB

2021-05-07 04_07_02-(282) Webmail __ Inbox - Brave
It’s right in the web interface :slight_smile:

This the limit in php.ini, however…

It seems that nginx sets a limit of 128M on the client request body:

From /etc/nginx/conf.d/local.conf:

location ~ /mail/.*\.php {
        # note: ~ has precendence over a regular location block
        include fastcgi_params;
        fastcgi_split_path_info ^/mail(/.*)()$;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME /usr/local/lib/roundcubemail/$fastcgi_script_name;
        fastcgi_pass php-fpm;

        # Outgoing mail also goes through this endpoint, so increase the maximum
        # file upload limit to match the corresponding Postfix limit.
        client_max_body_size 128M;

From the nginx docs:

Syntax: client_max_body_size size;
Default: client_max_body_size 1m;
Context: http, server, location

Sets the maximum allowed size of the client request body. If the size in a request exceeds the configured value, the 413 (Request Entity Too Large) error is returned to the client. Please be aware that browsers cannot correctly display this error. Setting size to 0 disables checking of client request body size.

Maybe check the nginx error logs to confirm?

You could probably modify the .htaccess file for Roundcube to increase it, but I’m not 100% where that lives.

@blinkingline What reads the .htaccess file in MiaB?

Roundcube is using PHP, right? The default php.ini on my box is set for a upload_max_filesize of 2M, so since Roundcube is reading that it’s max file size for upload is 16MB, I’m guessing somewhere there’s an .htaccess file that’s overriding it.

Edit, phpinfo in the roundcube directory shows the same:

So I think as @openletter mentions, there’s two things that are restricting that file size.

The error you’re seeing is hitting the nginx limit, but then if you resolve that, you’re still going to have to tweak the PHP limit.

@blinkingline The .htaccess file as I am aware is a feature of Apache, which is not a part of MiaB.

The limit of 16G is somewhere in the neighborhood of 16GB.

But as I pointed out above, nginx is configured for 128MB, and the error statement matches what the nginx documentation states would be the error.

This is what I see on my install and I have not modified any of these files:

$ grep -E 'upload_max_filesize|post_max_size' /etc/php/7.2/fpm/php.ini
;post_max_size = 8M
;upload_max_filesize = 2M

DOH, you’re right re: Apache v nginx. I was a knucklehead. And I clearly misread the default php.ini config, too!

The only other thing I’d consider is if you have too big an attachment, many mail services will reject the delivery. Most have a limit of sending attachments of 25MB - They’re unlikely to accept a 650MB file.


You would have had to read the user’s previous topic to know the goal is importing emails from a different provider.

my mistake, I’m sorry!

1 Like

After some experimenting this seems to be the case. However, I can’t confirm if this only applies to uncompressed or zip as well.


Alright, looks like you can upload pas 128MB if compressed into a zip, I guess, however much your cpu can crunch numbers, and depending on the acceptable formatting of the compressed archive.

Do you mean you can compress a file larger than 128MB such that the compressed file is under 128MB, so it can be uploaded? Because the limit in nginx should not allow any request body over 128MB, no matter the filetype.

As long as you upload a supported file, zip or otherwise equal to or less than 128MB, it seems to be okay with it.

I am trying to use this feature too.

I did changed the nginx.conf with below configuration but still I cannot import large mbox file.
client_max_body_size 16G;
client_body_timeout 120s;

I am trying with mbox file of 7.5G

How can this works ?

What is the error you receive when trying to upload?

it doesn’t gives any error on user interface, just the dialog saying “importing” disappear after a bit…

in the web console tho I still receive errors
Uncaught type error : " ". this is undefined

if the process is still going the user as no clue about it and will likely refresh or close tab.
I changed the client_body_timeout to 1200s as well

Check /var/log/nginx/access.log and error.log.

Are you importing from another mail server? Is something like imapsync and option for you?