From 804d558e68fe3db24116e231b1e41ec5a6a58ef7 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 21 Oct 2015 14:36:18 +0000 Subject: [PATCH] fixing the fix ;-) --- phpgwapi/inc/class.egw_mailer.inc.php | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/phpgwapi/inc/class.egw_mailer.inc.php b/phpgwapi/inc/class.egw_mailer.inc.php index 26423f2692..687ad8de08 100644 --- a/phpgwapi/inc/class.egw_mailer.inc.php +++ b/phpgwapi/inc/class.egw_mailer.inc.php @@ -505,13 +505,25 @@ class egw_mailer extends Horde_Mime_Mail } try { + // no flowed for encrypted messages + $flowed = $this->_body && $this->_body->getType() != 'multipart/encrypted'; + // handling of alternativ body - if (!empty($this->_alternateBody)) + if (!empty($this->_alternativBody)) { $body = new Horde_Mime_Part(); $body->setType('multipart/alternative'); if (!empty($this->_body)) { + // Send in flowed format. + if ($flowed) + { + $text_flowed = new Horde_Text_Flowed($this->_body->getContents(), $this->_body->getCharset()); + $text_flowed->setDelSp(true); + $this->_body->setContentTypeParameter('format', 'flowed'); + $this->_body->setContentTypeParameter('DelSp', 'Yes'); + $this->_body->setContents($text_flowed->toFlowed()); + } $body[] = $this->_body; } if (!empty($this->_htmlBody)) @@ -521,11 +533,9 @@ class egw_mailer extends Horde_Mime_Mail } $body[] = $this->_alternativBody; unset($this->_alternativBody); - $this->setBody($body); + $this->_body = $body; + $flowed = false; } - // no flowed for encrypted messages - $flowed = $this->_body && $this->_body->getType() != 'multipart/encrypted'; - parent::send($this->account->smtpTransport(), true, $flowed); // true: keep Message-ID } catch (Exception $e) {