Changeset 5490 in subversion
- Timestamp:
- Nov 25, 2011 8:47:07 AM (19 months ago)
- Location:
- trunk/roundcubemail
- Files:
-
- 8 edited
-
CHANGELOG (modified) (1 diff)
-
program/include/main.inc (modified) (1 diff)
-
program/localization/en_US/labels.inc (modified) (1 diff)
-
program/localization/en_US/messages.inc (modified) (1 diff)
-
program/steps/mail/func.inc (modified) (5 diffs)
-
program/steps/mail/get.inc (modified) (3 diffs)
-
skins/default/common.css (modified) (1 diff)
-
skins/default/mail.css (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/CHANGELOG
r5485 r5490 2 2 =========================== 3 3 4 - Prevent from memory_limit exceeding when trying to parse big messages bodies (#1487424) 4 5 - Add possibility to add SASL mechanisms for SMTP in smtp_connect hook (#1487937) 5 6 - Mark (with different color) folders with recent messages (#1486234) -
trunk/roundcubemail/program/include/main.inc
r5473 r5490 1847 1847 1848 1848 /** 1849 * Check if we can process not exceeding memory_limit 1850 * 1851 * @param integer Required amount of memory 1852 * @return boolean 1853 */ 1854 function rcmail_mem_check($need) 1855 { 1856 $mem_limit = parse_bytes(ini_get('memory_limit')); 1857 $memory = function_exists('memory_get_usage') ? memory_get_usage() : 16*1024*1024; // safe value: 16MB 1858 1859 return $mem_limit && $memory + $need > $mem_limit ? false : true; 1860 } 1861 1862 1863 /** 1849 1864 * Check if working in SSL mode 1850 1865 * -
trunk/roundcubemail/program/localization/en_US/labels.inc
r5457 r5490 153 153 $labels['invert'] = 'Invert'; 154 154 $labels['filter'] = 'Filter'; 155 156 155 $labels['list'] = 'List'; 157 156 $labels['threads'] = 'Threads'; -
trunk/roundcubemail/program/localization/en_US/messages.inc
r5319 r5490 158 158 $messages['mispellingsfound'] = 'Spelling errors detected in the message.'; 159 159 $messages['parentnotwritable'] = 'Unable to create/move folder into selected parent folder. No access rights.'; 160 $messages['messagetoobig'] = 'The message part is too big to process it.'; 160 161 161 162 ?> -
trunk/roundcubemail/program/steps/mail/func.inc
r5486 r5490 973 973 */ 974 974 function rcmail_message_body($attrib) 975 {975 { 976 976 global $CONFIG, $OUTPUT, $MESSAGE, $IMAP, $RCMAIL, $REMOTE_OBJECTS; 977 977 … … 990 990 $header_attrib[$regs[1]] = $value; 991 991 992 if (!empty($MESSAGE->parts)) 993 { 994 foreach ($MESSAGE->parts as $i => $part) 995 { 992 if (!empty($MESSAGE->parts)) { 993 foreach ($MESSAGE->parts as $i => $part) { 996 994 if ($part->type == 'headers') 997 995 $out .= rcmail_message_headers(sizeof($header_attrib) ? $header_attrib : NULL, $part->headers); 998 else if ($part->type == 'content' && $part->size) 999 { 996 else if ($part->type == 'content' && $part->size) { 997 // Check if we have enough memory to handle the message in it 998 // #1487424: we need up to 10x more memory than the body 999 if (!rcmail_mem_check($part->size * 10)) { 1000 $out .= html::span('part-notice', rcube_label('messagetoobig'). ' ' 1001 . html::a('?_task=mail&_action=get&_download=1&_uid='.$MESSAGE->uid.'&_part='.$part->mime_id 1002 .'&_mbox='. urlencode($IMAP->get_mailbox_name()), rcube_label('download'))); 1003 continue; 1004 } 1005 1000 1006 if (empty($part->ctype_parameters) || empty($part->ctype_parameters['charset'])) 1001 1007 $part->ctype_parameters['charset'] = $MESSAGE->headers->charset; … … 1031 1037 else 1032 1038 $out .= html::div('message-part', $plugin['prefix'] . $body); 1033 }1034 1039 } 1035 1040 } 1041 } 1036 1042 else { 1037 $plugin = $RCMAIL->plugins->exec_hook('message_body_prefix', array( 1038 'part' => $MESSAGE, 'prefix' => '')); 1039 1040 $out .= html::div('message-part', $plugin['prefix'] . html::tag('pre', array(), 1041 rcmail_plain_body(Q($MESSAGE->body, 'strict', false)))); 1042 } 1043 // Check if we have enough memory to handle the message in it 1044 // #1487424: we need up to 10x more memory than the body 1045 if (!rcmail_mem_check(strlen($MESSAGE->body) * 10)) { 1046 $out .= html::span('part-notice', rcube_label('messagetoobig'). ' ' 1047 . html::a('?_task=mail&_action=get&_download=1&_uid='.$MESSAGE->uid.'&_part=0' 1048 .'&_mbox='. urlencode($IMAP->get_mailbox_name()), rcube_label('download'))); 1049 } 1050 else { 1051 $plugin = $RCMAIL->plugins->exec_hook('message_body_prefix', array( 1052 'part' => $MESSAGE, 'prefix' => '')); 1053 1054 $out .= html::div('message-part', $plugin['prefix'] . html::tag('pre', array(), 1055 rcmail_plain_body(Q($MESSAGE->body, 'strict', false)))); 1056 } 1057 } 1043 1058 1044 1059 // list images after mail body … … 1058 1073 'alt' => $attach_prop->filename, 1059 1074 ))); 1060 }1075 } 1061 1076 } 1062 1077 } … … 1067 1082 1068 1083 return html::div($attrib, $out); 1069 }1084 } 1070 1085 1071 1086 -
trunk/roundcubemail/program/steps/mail/get.inc
r5479 r5490 71 71 } 72 72 73 else if ( $pid = get_input_value('_part', RCUBE_INPUT_GET)) {73 else if (strlen($pid = get_input_value('_part', RCUBE_INPUT_GET))) { 74 74 75 75 if ($part = $MESSAGE->mime_parts[$pid]) { … … 110 110 // deliver part content 111 111 if ($ctype_primary == 'text' && $ctype_secondary == 'html' && empty($plugin['download'])) { 112 // get part body if not available 113 if (!$part->body) 114 $part->body = $MESSAGE->get_part_content($part->mime_id); 112 // Check if we have enough memory to handle the message in it 113 // #1487424: we need up to 10x more memory than the body 114 if (!rcmail_mem_check($part->size * 10)) { 115 $out = '<body>' . rcube_label('messagetoobig'). ' ' 116 . html::a('?_task=mail&_action=get&_download=1&_uid='.$MESSAGE->uid.'&_part='.$part->mime_id 117 .'&_mbox='. urlencode($IMAP->get_mailbox_name()), rcube_label('download')) . '</body></html>'; 118 } 119 else { 120 // get part body if not available 121 if (!$part->body) 122 $part->body = $MESSAGE->get_part_content($part->mime_id); 123 124 $out = rcmail_print_body($part, array('safe' => $MESSAGE->is_safe, 'inline_html' => false)); 125 } 115 126 116 127 $OUTPUT = new rcube_html_page(); 117 $OUTPUT->write( rcmail_print_body($part, array('safe' => $MESSAGE->is_safe, 'inline_html' => false)));128 $OUTPUT->write($out); 118 129 } 119 130 else { … … 121 132 @set_time_limit(0); 122 133 123 $filename = $part->filename ? $part->filename : ($MESSAGE->subject ? $MESSAGE->subject : 'roundcube') . '.'.$ctype_secondary; 134 $ext = '.' . ($mimetype == 'text/plain' ? 'txt' : $ctype_secondary); 135 $filename = $part->filename ? $part->filename : ($MESSAGE->subject ? $MESSAGE->subject : 'roundcube') . $ext; 124 136 $filename = preg_replace('[\r\n]', '', $filename); 125 137 -
trunk/roundcubemail/skins/default/common.css
r5454 r5490 233 233 234 234 #message div.notice, 235 #messagebody .part-notice, 235 236 #message-objects div.notice 236 237 { -
trunk/roundcubemail/skins/default/mail.css
r5483 r5490 1204 1204 } 1205 1205 1206 #message-objects div 1206 #messagebody span.part-notice 1207 { 1208 display: block; 1209 } 1210 1211 #message-objects div, 1212 #messagebody span.part-notice 1207 1213 { 1208 1214 margin: 8px; … … 1211 1217 } 1212 1218 1213 #message-objects div a 1219 #message-objects div a, 1220 #messagebody span.part-notice a 1214 1221 { 1215 1222 color: #666666; … … 1217 1224 } 1218 1225 1219 #message-objects div a:hover 1226 #message-objects div a:hover, 1227 #messagebody span.part-notice a:hover 1220 1228 { 1221 1229 color: #333333;
Note: See TracChangeset
for help on using the changeset viewer.
