diff --git a/program/lib/Roundcube/rcube_imap_generic.php b/program/lib/Roundcube/rcube_imap_generic.php index ec73094a4a7..e8ae9e8322d 100644 --- a/program/lib/Roundcube/rcube_imap_generic.php +++ b/program/lib/Roundcube/rcube_imap_generic.php @@ -2500,6 +2500,13 @@ public function fetch($mailbox, $message_set, $is_uid = false, $query_items = ar list($field, $string) = explode(':', $str, 2); $field = strtolower($field); + if ($field == 'date') { + $newlinepos = strpos($string,"\n"); + if ($newlinepos) { + // ensure Date string is only a single line so that parsing doesn't hang + $string = substr($string,0,$newlinepos); + } + } $string = preg_replace('/\n[\t\s]*/', ' ', trim($string)); switch ($field) {