Projects
Kolab:Winterfell
kolab-syncroton
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 5
View file
kolab-syncroton.spec
Changed
@@ -31,7 +31,7 @@ Name: kolab-syncroton Version: 2.3.3 -Release: 0.20160229.git%{?dist} +Release: 0.20160307.git%{?dist} Summary: ActiveSync for Kolab Groupware Group: Applications/Internet
View file
debian.changelog
Changed
@@ -1,4 +1,4 @@ -kolab-syncroton (2.3.3~dev20160229-0~kolab1) unstable; urgency=low +kolab-syncroton (2.3.3~dev20160307-0~kolab1) unstable; urgency=low * Release of version 2.3.2, see:
View file
kolab-syncroton-2.3.3.tar.gz/lib/ext/Syncroton/Command/SendMail.php
Changed
@@ -6,28 +6,29 @@ * @subpackage Command * @license http://www.tine20.org/licenses/lgpl.html LGPL Version 3 * @copyright Copyright (c) 2009-2012 Metaways Infosystems GmbH (http://www.metaways.de) + * @copyright Copyright (c) 2009-2016 Kolab Systems AG (http://kolabsystems.com) * @author Lars Kneschke <l.kneschke@metaways.de> + * @author Aleksander Machniak <machniak@kolabsystems.com> */ /** - * class to handle ActiveSync Sendmail command + * class to handle ActiveSync SendMail command * * @package Syncroton * @subpackage Command */ class Syncroton_Command_SendMail extends Syncroton_Command_Wbxml { - protected $_defaultNameSpace = 'uri:ComposeMail'; - protected $_documentElement = 'SendMail'; + protected $_defaultNameSpace = 'uri:ComposeMail'; + protected $_documentElement = 'SendMail'; + protected $_mime; protected $_saveInSent; - protected $_source; - protected $_replaceMime = false; - + protected $_source; + protected $_replaceMime = false; + /** - * process the XML file and add, change, delete or fetches data - * - * @return resource + * Process the XML file and add, change, delete or fetches data */ public function handle() { @@ -35,20 +36,20 @@ $this->_mime = $this->_requestBody; $this->_saveInSent = $this->_requestParameters['saveInSent']; $this->_replaceMime = false; - - $this->_source = array( - 'collectionId' => $this->_requestParameters['collectionId'], - 'itemId' => $this->_requestParameters['itemId'], - 'instanceId' => null - ); - - } else { + + $this->_source = array( + 'collectionId' => $this->_requestParameters['collectionId'], + 'itemId' => $this->_requestParameters['itemId'], + 'instanceId' => null + ); + + } else if ($this->_requestBody) { $xml = simplexml_import_dom($this->_requestBody); - + $this->_mime = (string) $xml->Mime; $this->_saveInSent = isset($xml->SaveInSentItems); $this->_replaceMime = isset($xml->ReplaceMime); - + if (isset ($xml->Source)) { if ($xml->Source->LongId) { $this->_source = (string)$xml->Source->LongId; @@ -61,27 +62,49 @@ } } } - - if ($this->_logger instanceof Zend_Log) - $this->_logger->debug(__METHOD__ . '::' . __LINE__ . " saveInSent: " . (int)$this->_saveInSent); + + if (empty($this->_mime)) { + if ($this->_logger instanceof Zend_Log) + $this->_logger->warn(__METHOD__ . '::' . __LINE__ . " Sending email failed: Empty input"); + + + if (version_compare($this->_device->acsversion, '14.0', '<')) { + header("HTTP/1.1 400 Invalid content"); + die; + } + + $response_type = 'Syncroton_Model_' . $this->_documentElement; + $response = new $response_type(array( + 'status' => Syncroton_Exception_Status::INVALID_CONTENT, + )); + + $response->appendXML($this->_outputDom->documentElement, $this->_device); + + return $this->_outputDom; + } + + + if ($this->_logger instanceof Zend_Log) + $this->_logger->debug(__METHOD__ . '::' . __LINE__ . " saveInSent: " . (int)$this->_saveInSent); } - + /** * this function generates the response for the client - * - * @return void + * + * @return void|DOMDocument */ public function getResponse() { $dataController = Syncroton_Data_Factory::factory(Syncroton_Data_Factory::CLASS_EMAIL, $this->_device, $this->_syncTimeStamp); try { - $dataController->sendEmail($this->_mime, $this->_saveInSent); + $this->sendMail($dataController); } catch (Syncroton_Exception_Status $ses) { if ($this->_logger instanceof Zend_Log) $this->_logger->warn(__METHOD__ . '::' . __LINE__ . " Sending email failed: " . $ses->getMessage()); - $response = new Syncroton_Model_SendMail(array( + $response_type = 'Syncroton_Model_' . $this->_documentElement; + $response = new $response_type(array( 'status' => $ses->getCode(), )); @@ -90,4 +113,13 @@ return $this->_outputDom; } } + + /** + * Execute email sending method of data controller + * To be overwritten by SmartForward and SmartReply command handlers + */ + protected function sendMail($dataController) + { + $dataController->sendEmail($this->_mime, $this->_saveInSent); + } }
View file
kolab-syncroton-2.3.3.tar.gz/lib/ext/Syncroton/Command/SmartForward.php
Changed
@@ -21,27 +21,10 @@ protected $_documentElement = 'SmartForward'; /** - * this function generates the response for the client - * - * @return void + * Execute email sending method of data controller */ - public function getResponse() + protected function sendMail($dataController) { - $dataController = Syncroton_Data_Factory::factory(Syncroton_Data_Factory::CLASS_EMAIL, $this->_device, $this->_syncTimeStamp); - - try { - $dataController->forwardEmail($this->_source, $this->_mime, $this->_saveInSent, $this->_replaceMime); - } catch (Syncroton_Exception_Status $ses) { - if ($this->_logger instanceof Zend_Log) - $this->_logger->warn(__METHOD__ . '::' . __LINE__ . " Sending email failed: " . $ses->getMessage()); - - $response = new Syncroton_Model_SmartForward(array( - 'status' => $ses->getCode(), - )); - - $response->appendXML($this->_outputDom->documentElement, $this->_device); - - return $this->_outputDom; - } + $dataController->forwardEmail($this->_source, $this->_mime, $this->_saveInSent, $this->_replaceMime); } }
View file
kolab-syncroton-2.3.3.tar.gz/lib/ext/Syncroton/Command/SmartReply.php
Changed
@@ -21,27 +21,10 @@ protected $_documentElement = 'SmartReply'; /** - * this function generates the response for the client - * - * @return void + * Execute email sending method of data controller */ - public function getResponse() + protected function sendMail($dataController) { - $dataController = Syncroton_Data_Factory::factory(Syncroton_Data_Factory::CLASS_EMAIL, $this->_device, $this->_syncTimeStamp); - - try { - $dataController->replyEmail($this->_source, $this->_mime, $this->_saveInSent, $this->_replaceMime); - } catch (Syncroton_Exception_Status $ses) { - if ($this->_logger instanceof Zend_Log) - $this->_logger->warn(__METHOD__ . '::' . __LINE__ . " Sending email failed: " . $ses->getMessage()); - - $response = new Syncroton_Model_SmartReply(array( - 'status' => $ses->getCode(), - )); - - $response->appendXML($this->_outputDom->documentElement, $this->_device); - - return $this->_outputDom; - } + $dataController->replyEmail($this->_source, $this->_mime, $this->_saveInSent, $this->_replaceMime); } }
View file
kolab-syncroton-2.3.3.tar.gz/lib/ext/Syncroton/Server.php
Changed
@@ -141,10 +141,11 @@ try { $command = new $className($requestBody, $device, $requestParameters); - $command->handle(); - - $response = $command->getResponse(); - + $response = $command->handle(); + + if (!$response) { + $response = $command->getResponse(); + } } catch (Syncroton_Exception_ProvisioningNeeded $sepn) { if ($this->_logger instanceof Zend_Log) $this->_logger->info(__METHOD__ . '::' . __LINE__ . " provisioning needed");
View file
kolab-syncroton.dsc
Changed
@@ -2,7 +2,7 @@ Source: kolab-syncroton Binary: kolab-syncroton Architecture: all -Version: 2.3.3~dev20160229-0~kolab1 +Version: 2.3.3~dev20160307-0~kolab1 Maintainer: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> Uploaders: Paul Klos <kolab@klos2day.nl> Homepage: http://www.kolab.org/
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.