Roundcube Community Forum

 

ugh attachments in roundcube

Started by shaidy, September 08, 2013, 10:16:14 AM

Previous topic - Next topic

shaidy

Hello RoundCubers


i manage a mail server and would like to allow my clients to send very big files via their email.

my infra structure:
* Ubuntu 12
* Postifix + Couter
* Apache 2
* php 5.4
* Round Cube 0.9.4

iv'e wrote a  small milter script that runs on the postfix to strip big files from the mail and send a link instead.

now, that's works good when i send emails with files that are even 1GB from desktop clients.

what i want to achieve is to allow my webmail client (roundcube)  to support uploading those big files either.

the porblem is, that uploading the files on the roundcube side simply crashes apache.

iv'e already took care  for the apache and php5 settings but that seems that roundcube attachments fail and i get the php fatal error "exhausted"

is there any solution for that?

SKaero


shaidy

#2
Hi Skaero

the full error is

PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 21233743 bytes) in /mnt/must/roundcube/roundcubemail-0.9.3/program/lib/Roundcube/rcube_db.php on line 631


i even tried to increased the allowed php memory to heigher but it seems that roundcube handle attachments in a wierd way that makes them becomes much bigger then they are

SKaero

If I had to guess I'd say that RoundCubes temp directory isn't writable. When RoundCube can't store the attachment it has to hold it in the session which causes memory problems.

alec

That's not true. If it can't store attachment it raises error. Attachment body is never (or should not) store attachment body in session. @shaidy, what plugins are you using?

SKaero

Quote from: alec on September 09, 2013, 09:10:43 AM
That's not true. If it can't store attachment it raises error. Attachment body is never (or should not) store attachment body in session. @shaidy, what plugins are you using?
I'd swear I've seen small attachments in the session before when the temp folder wasn't wirable, did it change some time back or am I just remembering it wrong?

shaidy

@alec, this is my plugins line form the config file:


$rcmail_config['plugins'] = array('plugin_manager','calendar','carddav','compose_in_taskbar','crawler','fancybox','folderbuttons','jscolor','lang_sel','persistent_login','placeholder','planner','plaxo_contacts','savepassword','timepicker','webmail_notifier','archivefolder','blockspamsending','zipdownload','message_highlight','database_attachments','contextmenu');



but i was also trying to run RoundCube without any plugin and still - same results.


shaidy

#7
@SKaero,
there is no problem to upload small files and i can see while uploading that the files goes to the temp directory and then deleted. i'm pretty sure it's something with using the file AFTER UPLOAD.

here is my roundcube directory structure

root@ip-10-83-22-247:/mnt/ebs/roundcubemail-0.9.4# ll
total 168
drwxr-xr-x 11      501 admin     4096 Sep  8 12:03 ./
drwxr-xr-x  3 root     root      4096 Aug 29 09:57 ../
-rw-r--r--  1      501 admin     1351 Sep  7 14:06 .htaccess
-rw-r--r--  1      501 admin    15754 Sep  6 12:20 CHANGELOG
-rw-r--r--  1 www-data www-data  8677 Aug 21 17:26 INSTALL
-rw-r--r--  1      501 admin    35147 Sep  6 12:20 LICENSE
-rw-r--r--  1      501 admin     4022 Sep  6 12:20 README.md
drwxr-xr-x  6 www-data www-data  4096 Sep  7 10:23 SQL/
-rw-r--r--  1      501 admin     2712 Sep  6 12:20 UPGRADING
-rw-r--r--  1 root     root         0 Aug 24 18:06 aig3bmo2v0pl96gmrsouh738j4.myrc
drwxr-xr-x  2 www-data www-data  4096 Sep  7 10:23 bin/
-rw-r--r--  1 www-data www-data   381 Aug 21 17:26 composer.json-dist
drwxrwxrwx  2 www-data www-data  4096 Sep  7 13:59 config/
-rw-r--r--  1      501 admin    11999 Sep  6 12:20 index.php
drwxr-xr-x  3 www-data www-data  4096 Sep  7 10:23 installer/
-rwxr-xr-x  1 www-data www-data 19195 Aug 24 17:26 logo.png*
drwxrwxrwx  2 www-data www-data  4096 Sep  9 08:08 logs/
drwxr-xr-x 71 www-data www-data  4096 Sep  9 07:21 plugins/
drwxr-xr-x  8 www-data www-data  4096 Aug 24 16:01 program/
-rw-r--r--  1 www-data www-data    26 Aug 21 17:26 robots.txt
drwxr-xr-x  4 www-data www-data  4096 Aug 24 16:01 skins/
drwxrwxrwx  2 www-data www-data 12288 Sep 10 10:56 temp/



if you think that something is wrong, please let me know what


maybe it's not related or maybe yes but iv'e noticed that if i try to upload 12 files at once, sometimes one of them fail. actually if i use the same specific 12 files - it's always the same file that left over. wierd, but i don't know why it's happend.

alec

database_attachments plugin stores attachments in database. This is not a good choice if you want to handle very big attachments. Remove it from the list.

shaidy

@alec - removing the database attachment plugin does seems to solve the problem with the multiple files issue but the system still get exahusted on ugh files