*/
$mime_drivers['imp']['plain'] = array(
'inline' => true,
- 'handles' => array('text/plain', 'text/rfc822-headers', 'application/pgp'),
+ 'handles' => array(
+ 'text/plain', 'text/rfc822-headers', 'application/pgp'
+ ),
/* If you want to limit the display of message data inline for large
* messages, set the maximum size of the displayed message here (in
* bytes). If exceeded, the user will only be able to download the part.
'icons' => array(
'default' => 'html.png'
),
+ /* If you want to limit the display of message data inline for large
+ * messages, set the maximum size of the displayed message here (in
+ * bytes). If exceeded, the user will only be able to download the part.
+ * Set to 0 to disable this check. */
+ 'limit_inline_size' => 1048576,
/* Run 'tidy' on all HTML output? This requires at least version 2.0 of the
* PECL 'tidy' extension to be installed on your system. */
'tidy' => false,
case self::RENDER_INLINE_AUTO:
case self::RENDER_INLINE_DISP_NO:
$textmode = 'inline';
+ $limit = $viewer->getConfigParam('limit_inline_size');
+ if ($limit && ($mime_part->getBytes() > $limit)) {
+ return array(
+ $mime_id => array(
+ 'data' => '',
+ 'name' => '',
+ 'status' => array(
+ array(
+ 'text' => array(
+ _("This message part cannot be viewed because it is too large."),
+ sprintf(_("Click %s to download the data."), $this->linkView($mime_part, 'download_attach', _("HERE")))
+ )
+ )
+ ),
+ 'type' => 'text/html; charset=' . NLS::getCharset()
+ )
+ );
+ }
break;
case self::RENDER_INFO: