diff --git a/program/js/app.js b/program/js/app.js
index 00028f7c8..75560e726 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -341,7 +341,7 @@ function rcube_webmail()
}
else if (this.env.action == 'get') {
this.enable_command('download', 'print', true);
- if (this.env.mimetype == 'message/rfc822') {
+ if (this.env.is_message) {
this.enable_command('reply', 'reply-all', 'forward', 'forward-inline', 'forward-attachment', true);
if (this.env.list_post)
this.enable_command('reply-list', true);
@@ -1217,7 +1217,7 @@ function rcube_webmail()
this.open_window(this.env.comm_path + url, true, true);
}
}
- else if (this.env.action == 'get' && this.env.mimetype != 'message/rfc822') {
+ else if (this.env.action == 'get' && !this.env.is_message) {
this.gui_objects.messagepartframe.contentWindow.print();
}
else if (uid = this.get_single_uid()) {
diff --git a/program/steps/mail/get.inc b/program/steps/mail/get.inc
index 019c063aa..019150206 100644
--- a/program/steps/mail/get.inc
+++ b/program/steps/mail/get.inc
@@ -63,9 +63,14 @@ if (!empty($_GET['_frame'])) {
));
$mimetype = $part ? rcmail_fix_mimetype($part->mimetype) : '';
- if ($part_id && $mimetype == 'message/rfc822') {
+
+ // message/rfc822 preview (Note: handle also multipart/ parts, they can
+ // come from Enigma, which replaces message/rfc822 with real mimetype)
+ if ($part_id && ($mimetype == 'message/rfc822' || strpos($mimetype, 'multipart/') === 0)) {
$uid = preg_replace('/\.[0-9.]+/', '', $uid);
$uid .= '.' . $part_id;
+
+ $OUTPUT->set_env('is_message', true);
}
$OUTPUT->set_env('mailbox', $RCMAIL->storage->get_folder());
@@ -458,9 +463,8 @@ function rcmail_message_part_frame($attrib)
{
global $RCMAIL;
- $mimetype = $RCMAIL->output->get_env('mimetype');
- if ($mimetype == 'message/rfc822') {
+ if ($RCMAIL->output->get_env('is_message')) {
$attrib['src'] = $RCMAIL->url(array(
'task' => 'mail',
'action' => 'preview',
@@ -470,6 +474,7 @@ function rcmail_message_part_frame($attrib)
));
}
else {
+ $mimetype = $RCMAIL->output->get_env('mimetype');
$frame_replace = strpos($mimetype, 'text/') === 0 ? '_embed=' : '_preload=';
$attrib['src'] = './?' . str_replace('_frame=', $frame_replace, $_SERVER['QUERY_STRING']);
}
diff --git a/skins/classic/templates/messagepart.html b/skins/classic/templates/messagepart.html
index 326f7a4d1..fe5a38080 100644
--- a/skins/classic/templates/messagepart.html
+++ b/skins/classic/templates/messagepart.html
@@ -17,7 +17,7 @@
-
+
@@ -43,7 +43,7 @@
-
+
-
+