We need to implement SendMail:
authorMichael J. Rubinsky <mrubinsk@horde.org>
Fri, 9 Apr 2010 22:50:34 +0000 (18:50 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Fri, 9 Apr 2010 22:50:34 +0000 (18:50 -0400)
Seems that some clients automatically call SendMail when creating a new appointment with attendees and send
them a meeting invitation. Implement the request class, but the driver currently discards the email rec'd. Need
to figure out what to do with this...

framework/ActiveSync/lib/Horde/ActiveSync.php
framework/ActiveSync/lib/Horde/ActiveSync/Driver/Base.php
framework/ActiveSync/lib/Horde/ActiveSync/Request/SendMail.php [new file with mode: 0644]

index 06a682a..d4f1acc 100644 (file)
@@ -553,21 +553,6 @@ class Horde_ActiveSync
      * @param $protocolversion
      * @return unknown_type
      */
-    public function handleSendMail($protocolversion)
-    {
-        // All that happens here is that we receive an rfc822 message on stdin
-        // and just forward it to the backend. We provide no output except for
-        // an OK http reply
-        $rfc822 = $this->readStream();
-
-        return $this->_driver->SendMail($rfc822);
-    }
-
-    /**
-     *
-     * @param $protocolversion
-     * @return unknown_type
-     */
     public function handleSmartForward($protocolversion)
     {
         // SmartForward is a normal 'send' except that you should attach the
index 173077c..1a545b6 100644 (file)
@@ -423,6 +423,8 @@ abstract class Horde_ActiveSync_Driver_Base
     }
 
     /**
+     * @TODO
+     * 
      * @param $rfc822
      * @param $forward
      * @param $reply
diff --git a/framework/ActiveSync/lib/Horde/ActiveSync/Request/SendMail.php b/framework/ActiveSync/lib/Horde/ActiveSync/Request/SendMail.php
new file mode 100644 (file)
index 0000000..a2f34f3
--- /dev/null
@@ -0,0 +1,34 @@
+<?php
+/**
+ * ActiveSync Handler for SendMail requests
+ *
+ * Copyright 2009 - 2010 The Horde Project (http://www.horde.org)
+ *
+ * @author Michael J. Rubinsky <mrubinsk@horde.org>
+ * @package Horde_ActiveSync
+ */
+/**
+ * Zarafa Deutschland GmbH, www.zarafaserver.de
+ * This file is distributed under GPL v2.
+ * Consult LICENSE file for details
+ */
+class Horde_ActiveSync_Request_SendMail extends Horde_ActiveSync_Request_Base
+{
+
+    /**
+     *
+     * @param $protocolversion
+     * @return unknown_type
+     */
+    public function handle(Horde_ActiveSync $activeSync, $devId)
+    {
+        $this->_logger->info('[' . $devId . '] Handling SendMail command.');
+        
+        // All that happens here is that we receive an rfc822 message on stdin
+        // and just forward it to the backend. We provide no output except for
+        // an OK http reply
+        $rfc822 = $this->_request->getBody();
+
+        return $this->_driver->SendMail($rfc822);
+    }
+}
\ No newline at end of file