Merge branch '2015.11' into 2015.11-develop
[tine20] / tine20 / Tinebase / Mail.php
index 7dbb4d3..e6d1af4 100644 (file)
@@ -218,7 +218,27 @@ class Tinebase_Mail extends Zend_Mail
 
         return $this;
     }
-    
+
+    public function setBodyPGPMime($amored)
+    {
+        $this->_type = 'multipart/encrypted; protocol="application/pgp-encrypted"';
+
+        // PGP/MIME Versions Identification
+        $pgpIdent = new Zend_Mime_Part('Version: 1');
+        $pgpIdent->encoding = '7bit';
+        $pgpIdent->type = 'application/pgp-encrypted';
+        $pgpIdent->description = 'PGP/MIME Versions Identification';
+        $this->_bodyText = $pgpIdent;
+
+        // OpenPGP encrypted message
+        $pgpMessage = new Zend_Mime_Part($amored);
+        $pgpMessage->encoding = '7bit';
+        $pgpMessage->disposition = 'inline; filename=encrypted.asc';
+        $pgpMessage->type = 'application/octet-stream; name=encrypted.asc';
+        $pgpMessage->description = 'OpenPGP encrypted message';
+        $this->_bodyHtml = $pgpMessage;
+    }
+
     /**
      * set headers
      * 
@@ -298,7 +318,7 @@ class Tinebase_Mail extends Zend_Mail
         
         return $this;
     }
-    
+
     /**
      * Sets Sender-header and sender of the message
      *