summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
Diffstat (limited to 'program')
-rw-r--r--program/lib/Roundcube/rcube_message.php16
-rw-r--r--program/steps/mail/func.inc2
2 files changed, 17 insertions, 1 deletions
diff --git a/program/lib/Roundcube/rcube_message.php b/program/lib/Roundcube/rcube_message.php
index 20329a7f1..8af334446 100644
--- a/program/lib/Roundcube/rcube_message.php
+++ b/program/lib/Roundcube/rcube_message.php
@@ -627,8 +627,19 @@ class rcube_message
$p->ctype_secondary = 'plain';
$p->mimetype = 'text/plain';
$p->realtype = 'multipart/encrypted';
+ $p->mime_id = $structure->mime_id;
$this->parts[] = $p;
+
+ // add encrypted payload part as attachment
+ if (is_array($structure->parts)) {
+ for ($i=0; $i < count($structure->parts); $i++) {
+ $subpart = $structure->parts[$i];
+ if ($subpart->mimetype == 'application/octet-stream' || !empty($subpart->filename)) {
+ $this->attachments[] = $subpart;
+ }
+ }
+ }
}
// this is an S/MIME ecrypted message -> create a plaintext body with the according message
else if ($mimetype == 'application/pkcs7-mime') {
@@ -638,8 +649,13 @@ class rcube_message
$p->ctype_secondary = 'plain';
$p->mimetype = 'text/plain';
$p->realtype = 'application/pkcs7-mime';
+ $p->mime_id = $structure->mime_id;
$this->parts[] = $p;
+
+ if (!empty($structure->filename)) {
+ $this->attachments[] = $structure;
+ }
}
// message contains multiple parts
else if (is_array($structure->parts) && !empty($structure->parts)) {
diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index 9a6be0c8c..48d989954 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -1205,7 +1205,7 @@ function rcmail_message_body($attrib)
}
// fetch part body
- $body = $part->mime_id ? $MESSAGE->get_part_body($part->mime_id, true) : $part->body;
+ $body = $MESSAGE->get_part_body($part->mime_id, true);
// extract headers from message/rfc822 parts
if ($part->mimetype == 'message/rfc822') {