summaryrefslogtreecommitdiff
path: root/program/lib/Roundcube
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2015-01-16 16:13:15 +0100
committerThomas Bruederli <bruederli@kolabsys.com>2015-01-16 16:13:15 +0100
commitef29153a3270dd2407cce20f3eb3ec6322d4053b (patch)
treef4bacbe75f46553a00ff3a9f3a6b61ff1cf54b0c /program/lib/Roundcube
parentb7e3b15a8a551092a69a43cb7f6af8726988f723 (diff)
Improve display of pgp/mime and s/mime messges. Reverts commit f4154d91
Diffstat (limited to 'program/lib/Roundcube')
-rw-r--r--program/lib/Roundcube/rcube_message.php16
1 files changed, 16 insertions, 0 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)) {