Replace the MIME part of the message sent from the client. Headers from
the original message are always used.
public replaceMime ( Horde_Mime_Part $part ) | ||
$part | Horde_Mime_Part | The new MIME part. |
/** * Some clients (HTC One devices, for one) generate HTML signatures * that contain line lengths too long for servers without BINARYMIME to * send. If we are here, see if that's the reason by checking content * encoding and trying again. * * @return boolean */ protected function _tryWithoutBinary($recipients, array $headers) { // All we need to do is re-assign the mime object. This will cause the // content transfer encoding to be re-evaulated and set to an approriate // value if needed. $mime = $this->_raw->getMimeObject(); $this->_raw->replaceMime($mime); try { $GLOBALS['injector']->getInstance('Horde_Mail')->send($recipients, $headers, $this->_raw->getMessage()->stream); } catch (Exception $e) { return false; } return true; }
protected function _callPreSendHook() { $hooks = $GLOBALS['injector']->getInstance('Horde_Core_Hooks'); $params = array('raw' => $this->_raw, 'imap_msg' => $this->imapMessage, 'parent' => $this->_parentFolder, 'reply' => $this->_reply, 'forward' => $this->_forward); try { if (!($result = $hooks->callHook('activesync_email_presend', 'horde', array($params)))) { throw new Horde_ActiveSync_Exception('There was an issue running the activesync_email_presend hook.'); } if ($result instanceof Horde_ActiveSync_Mime) { $this->_raw->replaceMime($result->base); } } catch (Horde_Exception_HookNotSet $e) { } }