On Fri, May 28, 2010 at 7:34 AM, Ralf Hildebrandt <Ralf.Hildebrandt@xxxxxxxxxx> wrote: > * Ralf Hildebrandt <Ralf.Hildebrandt@xxxxxxxxxx>: >> I'm using 1.4.20, and I found a mail which contains an unencoded >> character in the Subject: header line. >> >> When I'm trying to get a folder listing of a folder containing just >> this one (broken) mail, squirrelmail will loop infinitely, the >> associated php5-cgi process will hog the CPU: >> >> PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND >> 12402 www-data 20 0 69144 28m 18m R 100 0.5 1:45.49 /usr/bin/php5-cgi >> >> stracing the process yields no result: >> >> webmail:~# strace -p 12402 >> Process 12402 attached - interrupt to quit >> >> I have to kill -9 the process to get rid of it. >> >> I could send the problematic mail here... > > I'm not entirely sure it's due to the unencoded character, but still > an interesting problem, nonetheless I believe you are correct. There is a bug report on the tracker for this and a solution is available, although I am still fine-tuning the details. I hope it goes without saying that the sending client needs to fix their stuff. :-) In the meantime, for a quick fix, you can open functions/strings.php and find the while loop on around line 191 (I think that line # is from 1.4.21SVN so might be a little off for you). Change that while loop to look like this: while ($entity_end_pos + 1 < $actual_strlen && ($entity_pos = sq_strpos($string, '&', $entity_end_pos + 1)) !== FALSE && ($entity_end_pos = sq_strpos($string, ';', $entity_pos)) !== FALSE && $entity_pos <= $adjusted_max_chars) -- Paul Lesniewski SquirrelMail Team Please support Open Source Software by donating to SquirrelMail! http://squirrelmail.org/donate_paul_lesniewski.php ------------------------------------------------------------------------------ ----- squirrelmail-users mailing list Posting guidelines: http://squirrelmail.org/postingguidelines List address: squirrelmail-users@xxxxxxxxxxxxxxxxxxxxx List archives: http://news.gmane.org/gmane.mail.squirrelmail.user List info (subscribe/unsubscribe/change options): https://lists.sourceforge.net/lists/listinfo/squirrelmail-users