Roundcube Community Forum

News and Announcements => General Discussion => Topic started by: ardena on September 11, 2013, 06:45:19 AM

Title: Attachment limit to 2 MB
Post by: ardena on September 11, 2013, 06:45:19 AM
I've changed these parameters:

php.ini
- post_max_size = 20M

.htaccess
upload_max_filesize = 20M
post_max_size = 20M

When I attach a file to an email, RoundCube display an error. It doesn't accepts files size over 2MB. Can Someone help me to find the problem?

Thankyou.
Title: Re: Attachment limit to 2 MB
Post by: ardena on September 11, 2013, 08:22:08 AM
I've found the problem.

In php.ini I must change also upload_max_filesize.
Title: Re: Attachment limit to 2 MB
Post by: meshok0 on September 24, 2013, 07:50:46 AM
I have almost the same problem. But there are no errors (in interface or logs). Roundcube just saying "Uploading file..."

http://trac.roundcube.net/ticket/1489355

In my /etc/php5/apache2/php.ini  I have:

upload_max_filesize = 40M
post_max_size = 50M
memory_limit = 128M

What "configuration problem" I have?


upd:
Here is the same issue, but "under IIS7 on Windows 2008 with Hmailserver":
http://www.roundcubeforum.net/index.php/topic,11186.msg44047.html#msg44047

upd1:
My roundcube root:
$ ls -la /var/www/roundcubemail
итого 120
drwxr-xr-x 11 root root      4096 Сен 24 12:53 .
drwxr-xr-x 16 root root      4096 Сен 24 11:48 ..
drwxr-xr-x  2 root root      4096 Сен 24 11:56 bin
-rw-r--r--  1 root root     15754 Сен  6 16:20 CHANGELOG
drwxr-xr-x  2 root root      4096 Сен 24 11:56 config
-rw-r--r--  1 root root      1348 Сен 24 11:58 .htaccess
-rw-r--r--  1 root root     11999 Сен  6 16:20 index.php
-rw-r--r--  1 root root      8546 Ноя 28  2012 INSTALL
drwx------  3 root root       156 Сен 24 11:56 installer
-rw-r--r--  1 root root     35147 Сен  6 16:20 LICENSE
-rw-r--r--  1 root root      1451 Июн 18 13:33 logo_start.png
drwxrwxr-x  2 root www-data    61 Июн 13 12:35 logs
drwxr-xr-x 31 root root      4096 Сен 24 11:56 plugins
drwxr-xr-x  8 root root       136 Сен 24 11:56 program
-rw-r--r--  1 root root      4022 Сен  6 16:20 README.md
-rw-r--r--  1 root root        26 Ноя 28  2012 robots.txt
drwxr-xr-x  4 root root        32 Ноя 28  2012 skins
drwxr-xr-x  6 root root      4096 Сен 24 11:56 SQL
drwxrwxr-x  2 root www-data    22 Сен 24 12:22 temp
-rw-r--r--  1 root root      2712 Сен  6 16:20 UPGRADING
Title: Re: Attachment limit to 2 MB
Post by: SKaero on September 24, 2013, 08:23:58 AM
I see on the ticket you posted you have a php error:
Code: [Select]
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/suhosin.so' - /usr/lib/php5/20100525/suhosin.so: cannot open shared object file: No such file or directory in Unknown on line 0
You should get that fixed.

RoundCube should be creating a error log with error messages, make sure the logs directory is writable by the web server.
Title: Re: Attachment limit to 2 MB
Post by: meshok0 on September 24, 2013, 09:33:18 AM
I see on the ticket you posted you have a php error:
Code: [Select]
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/suhosin.so' - /usr/lib/php5/20100525/suhosin.so: cannot open shared object file: No such file or directory in Unknown on line 0
You should get that fixed.
I get that fixed:
$ php -v
PHP 5.4.4-14+deb7u2 (cli) (built: Jun  5 2013 07:56:44)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies

[/quote]
RoundCube should be creating a error log with error messages, make sure the logs directory is writable by the web server.
[/quote]
Logs directory writable by the web server: when I input wrong username in username field there is
Code: [Select]
[24-Sep-2013 17:27:12 +0400]: IMAP Error: Login failed for xxx@xxx.xx from 192.168.xx.xx(X-Real-IP: 192.168.xx.xx,X-Forwarded-For: 192.168.xx.xx. AUTHENTICATE PLAIN: Authentication failed. in /var/www/roundcubemail/program/lib/Roundcube/rcube_imap.php on line 184 (POST /?_task=login&_action=login)
in errors
Title: Re: Attachment limit to 2 MB
Post by: SKaero on September 24, 2013, 01:33:16 PM
Any errors in the JS console? Any plugins? Are you using a custom or modified skin?
Title: Re: Attachment limit to 2 MB
Post by: meshok0 on September 25, 2013, 01:30:05 AM
Hm..
After I click "Upload" after selecting > 2mb file in "Add attachment" pop-up, there is in Firefox's Web Console:
Code: [Select]
[09:20:19.209] POST https://xxx.xx/?_task=mail&_id=xxx8618815242727e09c74&_uploadid=xxx0086418949&_action=upload [HTTP/1.1 413 Request Entity Too Large 2ms]

If file size do not exceed ~ 2mb:
Code: [Select]
[09:22:07.909] POST https://xxx.xx/?_task=mail&_id=xxx8618815242727e09c74&_uploadid=xxx0086527544&_action=upload [HTTP/1.1 200 OK 111ms]
[09:22:08.129] Use of getUserData() or setUserData() is deprecated.  Use WeakMap or element.dataset instead. @ resource://gre/modules/XPIProvider.jsm -> jar:file:///home/xxx/.mozilla/firefox/rg75j56k.default/extensions/%7Bd10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d%7D.xpi!/bootstrap.js -> jar:file:///home/xxx/.mozilla/firefox/rg75j56k.default/extensions/%7Bd10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d%7D.xpi!/lib/requestNotifier.js:64
[09:22:08.645] GET https://xxx.xx/skins/larry/images/filetypes.png?v=3aa2.8551 [HTTP/1.1 200 OK 3ms]

I use default skin and LDAP addressbook.
Title: Re: Attachment limit to 2 MB
Post by: SKaero on September 26, 2013, 08:56:45 AM
It looks like your post_max_size and upload_max_filesize settings aren't in effect, check you apache log it should have an error message when the problem occurs.
Title: Re: Attachment limit to 2 MB
Post by: meshok0 on September 26, 2013, 10:32:51 AM
There are no messages in error nor access logs when I try to upload >2mb file.
In "Add attachment" dialog I see my configured 40 mb limit.

I had this problem earlier. Then I had updated roundcube to 0.8.4 and it had disappered. After recent "apt-get upgrade" OR(I don't know exactly) upgrading roundcube to 0.9.4 I have the same issue.
Title: Re: Attachment limit to 2 MB
Post by: SKaero on September 26, 2013, 12:24:05 PM
What does a phpinfo() in the RoundCube folder say your setting are for post_max_size and upload_max_filesize?
Title: Re: Attachment limit to 2 MB
Post by: meshok0 on September 26, 2013, 01:56:36 PM
Directive   Local Value   Master Value
allow_url_fopen   On   On
allow_url_include   Off   Off
always_populate_raw_post_data   Off   Off
arg_separator.input   &   &
arg_separator.output   &   &
asp_tags   Off   Off
auto_append_file   no value   no value
auto_globals_jit   On   On
auto_prepend_file   no value   no value
browscap   no value   no value
default_charset   no value   no value
default_mimetype   text/html   text/html
disable_classes   no value   no value
disable_functions   pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,   pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
display_errors   Off   Off
display_startup_errors   Off   Off
doc_root   no value   no value
docref_ext   no value   no value
docref_root   no value   no value
enable_dl   Off   Off
enable_post_data_reading   On   On
error_append_string   no value   no value
error_log   no value   no value
error_prepend_string   no value   no value
error_reporting   22527   22527
exit_on_timeout   Off   Off
expose_php   On   On
extension_dir   /usr/lib/php5/20100525   /usr/lib/php5/20100525
file_uploads   On   On
highlight.comment   #FF8000   #FF8000
highlight.default   #0000BB   #0000BB
highlight.html   #000000   #000000
highlight.keyword   #007700   #007700
highlight.string   #DD0000   #DD0000
html_errors   On   On
ignore_repeated_errors   Off   Off
ignore_repeated_source   Off   Off
ignore_user_abort   Off   Off
implicit_flush   Off   Off
include_path   .:/usr/share/php:/usr/share/pear   .:/usr/share/php:/usr/share/pear
log_errors   On   On
log_errors_max_len   1024   1024
mail.add_x_header   On   On
mail.force_extra_parameters   no value   no value
mail.log   no value   no value
max_execution_time   30   30
max_file_uploads   20   20
max_input_nesting_level   64   64
max_input_time   60   60
max_input_vars   1000   1000
memory_limit   128M   128M
open_basedir   no value   no value
output_buffering   4096   4096
output_handler   no value   no value
post_max_size   50M   50M
precision   14   14
realpath_cache_size   16K   16K
realpath_cache_ttl   120   120
register_argc_argv   Off   Off
report_memleaks   On   On
report_zend_debug   On   On
request_order   GP   GP
sendmail_from   no value   no value
sendmail_path   /usr/sbin/sendmail -t -i    /usr/sbin/sendmail -t -i
serialize_precision   17   17
short_open_tag   On   On
SMTP   localhost   localhost
smtp_port   25   25
sql.safe_mode   Off   Off
track_errors   Off   Off
unserialize_callback_func   no value   no value
upload_max_filesize   40M   40M
upload_tmp_dir   no value   no value
user_dir   no value   no value
user_ini.cache_ttl   300   300
user_ini.filename   .user.ini   .user.ini
variables_order   GPCS   GPCS
xmlrpc_error_number   0   0
xmlrpc_errors   Off   Off
zend.detect_unicode   On   On
zend.enable_gc   On   On
zend.multibyte   Off   Off
zend.script_encoding   no value
Title: Re: Attachment limit to 2 MB
Post by: ABerglund on September 26, 2013, 04:11:12 PM
Is your php.ini being overridden by something in the .htaccess file in the root of the roundcubemail directory?
Title: Re: Attachment limit to 2 MB
Post by: meshok0 on September 27, 2013, 01:42:12 AM
Yes.
I changed upload_max_filesize, post_max_size, memory_limit in .htaccess to test. Phpinfo and "Add attachment"'s maximum size showed changes.
I also tried to comment all three settings in .htaccess and even delete .htaccess to make apache to bring values from php.ini - the same result. 
 

Title: Re: Attachment limit to 2 MB
Post by: ABerglund on September 27, 2013, 11:18:05 AM
Is this a server that you manage, or hosted?
Title: Re: Attachment limit to 2 MB
Post by: meshok0 on September 27, 2013, 04:27:52 PM
I manage this server.
Title: Re: Attachment limit to 2 MB
Post by: mackal on May 02, 2015, 04:46:16 PM
You have the same problem as mine. I solved this problem. You have change one more file the settings in the /etc/roundcube/htaccess. For more information, visit http://maciej.pawlikowice.info/artykuly/36-linux/82-roundcube-zmiana-rozmiaru-maksymalnego-wysylanych-zalacznikow