From e0fa44f4016eb7e707dd478c79117a013a708654 Mon Sep 17 00:00:00 2001
From: Ralf Becker <ralfbecker@outdoor-training.de>
Date: Thu, 23 Apr 2015 13:14:05 +0000
Subject: [PATCH] display encrypted messages, not just show an empty window

---
 .../inc/class.emailadmin_imapbase.inc.php     | 20 +++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/emailadmin/inc/class.emailadmin_imapbase.inc.php b/emailadmin/inc/class.emailadmin_imapbase.inc.php
index 1782f0cca4..861f63ee55 100644
--- a/emailadmin/inc/class.emailadmin_imapbase.inc.php
+++ b/emailadmin/inc/class.emailadmin_imapbase.inc.php
@@ -3969,6 +3969,25 @@ class emailadmin_imapbase
 							break;
 					}
 					break;
+				case 'application':
+					switch($part->getSubType())
+					{
+						case 'pgp-encrypted':
+							if (($part = $_structure->getPart($mime_id+1)) &&
+								$part->getType() == 'application/octet-stream')
+							{
+								$this->fetchPartContents($_uid, $part);
+								$bodyPart[] = array(
+									'body'		=> $part->getContents(array(
+										'stream' => false,
+									)),
+									'mimeType'  => 'text/plain',
+									'charSet'	=> $_structure->getCharset(),
+								);
+							}
+							break;
+					}
+					break;
 
 				case 'text':
 					switch($part->getSubType())
@@ -4282,6 +4301,7 @@ class emailadmin_imapbase
 					case 'mixed':
 					case 'report':
 					case 'signed':
+					case 'encrypted':
 						$bodyParts = $this->getMultipartMixed($_uid, $_structure, $this->htmlOptions, $_preserveSeen);
 						break;