Author Topic: Cant Manage Folders  (Read 3202 times)

Offline jerryk

  • Newbie
  • *
  • Posts: 3
Cant Manage Folders
« on: October 04, 2017, 04:21:34 PM »
Hello,
   I have  a problem where I am unable to use the "manage folders" screen of roundcube.  If I select that screen, the activity spinner runs for a while, and then the  browser window goes blank.
In /var/log/maillog we have :

Oct  4 09:14:13 tr6 roundcube: PHP Fatal error:  Allowed memory size of 67108864 bytes exhausted (tried to allocate 60293193 bytes) in /var/www/htdocs/jmproperties/secure/roundcube/roundcubemail-1.3.1/program/lib/Roundcube/rcube_imap_generic.php on line 3731

Inside rcube_imap_generic.php:
------------ snip ---------------------------------
        // Parse response
        do {
            $line = $this->readLine(4096);
            if ($response !== null) {
                $response .= $line;              <-- This is line 3731
            }
        }
 ---------------- endsnip -------------------------

It looks like it's trying to tack $line onto the end of $response. 

..and $line is a result it got from the IMAP server ( using dovecot ).

This is with the latest version of Roundcube.  It worked the same with  earlier versions though.

My mail directory is not small.  I have emails dating back to 1991.  du -Sb says it's about four gigs.  There are no symbolic links, so no obvious possibility of directory loops.

So - has anybody encountered similar before?  How to start troubleshooting?    I know nothing
about PHP - but I have written about a hundred thousand lines of Perl.   Is there a standardized way to get debug output?  Syslog?  It would be nice to know exactly
what it's trying to do when it hits that wall.   A stack trace would be especially nice. 

 Apparently, the "memory exhausted error" is pretty fatal, and cannot be trapped for analysis - because at that point, PHP itself is totally borked.

I set the limit up to 128M in .htaccess, and it still failed, just with a bigger number in the error message.

It does work for other users on my system who have less mail.



Offline alec

  • Hero Member
  • *****
  • Posts: 1,363
Re: Cant Manage Folders
« Reply #1 on: October 05, 2017, 02:15:21 AM »
How many folders do you have? Enable imap_debug in Roundcube config to see the IMAP communication in logs/imap file.

Offline jerryk

  • Newbie
  • *
  • Posts: 3
Re: Cant Manage Folders
« Reply #2 on: October 06, 2017, 10:52:37 AM »
OK, I enabled imap_debug.  Very Interesting! It seems to be listing "folders" starting at the root of my home directory.  Which contains about 10 gB of stuff.  So how does roundcube figure out where to start looking?  My guess is that it doesn't.  That the "where to start looking" question is really an IMAP/dovecot thing.

Offline jerryk

  • Newbie
  • *
  • Posts: 3
Re: Cant Manage Folders
« Reply #3 on: October 06, 2017, 05:03:14 PM »
Turned out to be a Dovecot setting.  Dovecot was set to use each user's home directory as their mail.  Ick.  Luckily, there aren't THAT many users
on my machine.  Thanks for the imap_debug hint!