Skip to content

Commit

Permalink
Fix REPLACEMIME functionality.
Browse files Browse the repository at this point in the history
Fixes duplicate attachment/messagebody parts when clients
issue a SMARTFORWARD request with the REPLACEMIME flag set.
  • Loading branch information
mrubinsk committed May 19, 2015
1 parent 848bedf commit ec8715b
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions framework/Core/lib/Horde/Core/ActiveSync/Mail.php
Expand Up @@ -19,7 +19,7 @@
* @package Core
*
* @property-read Horde_ActiveSync_Imap_Adapter $imapAdapter The imap adapter.
* @property-read boolean $replacemime Flag to indicate we are to replace the MIME contents of a SMART request.
* @property boolean $replacemime Flag to indicate we are to replace the MIME contents of a SMART request.
* @property-read integer $id The UID of the source email for any SMARTREPLY or SMARTFORWARD requests.
* @property-read boolean $reply Flag indicating a SMARTREPLY request.
* @property-read boolean $forward Flag indicating a SMARTFORWARD request.
Expand Down Expand Up @@ -79,7 +79,7 @@ class Horde_Core_ActiveSync_Mail
*
* @var boolean
*/
protected $_replaceMime = false;
protected $_replacemime = false;

/**
* The current EAS user.
Expand Down Expand Up @@ -152,6 +152,14 @@ public function &__get($property)
}
}

public function __set($property, $value)
{
if ($property == 'replacemime') {
$this->_replacemime = $value;
}
}


/**
* Set the raw message content received from the EAS client to send.
*
Expand Down Expand Up @@ -221,7 +229,7 @@ public function send()
throw new Horde_ActiveSync_Exception('No data set or received from EAS client.');
}
$this->_callPreSendHook();
if (!$this->_parentFolder || ($this->_parentFolder && $this->_replaceMime)) {
if (!$this->_parentFolder || ($this->_parentFolder && $this->_replacemime)) {
$this->_sendRaw();
} else {
$this->_sendSmart();
Expand Down Expand Up @@ -289,7 +297,7 @@ protected function _sendRaw()

// Replace MIME? Don't have original body, but still need headers.
// @TODO: Get JUST the headers?
if ($this->_replaceMime) {
if ($this->_replacemime) {
try {
$this->_getImapMessage();
} catch (Horde_Exception_NotFound $e) {
Expand Down

0 comments on commit ec8715b

Please sign in to comment.