Way to add mobile sync schema

Achim J. Latz achim+automx at qustodium.net
Sun Sep 16 03:36:10 CEST 2012


Hello list:

Would it be possible to complete/add the ActiveSync/mobilesync schema in 
AutoMX?

I know that distinction has to be made in view.py, and I (never having 
touched Python) figured out that we can change the <response> tag as 
follows (with correct indentation, of course ;-)

if self.__subschema == "mobile":
  NS_Response = ("http://schemas.microsoft.com/exchange/"
                 "autodiscover/mobilesync/responseschema/2006")

What we would need to support ActiveSync is a (simple) response like the 
following one with only two fields whose values we already have, namely:

[[[_auth_identity]]] (lets asume the email address for now)
[[[https://_server/Microsoft-Server-ActiveSync]]] (the http host)


The response should look like this, with the substitions in place:

     <Autodiscover 
xmlns="http://schemas.microsoft.com/exchange/autodiscover/responseschema/2006" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
     <Response 
xmlns="http://schemas.microsoft.com/exchange/autodiscover/mobilesync/responseschema/2006">
     <Culture>en:en</Culture>
     <User>
     <DisplayName>[[[_auth_identity]]]</DisplayName>
     <EMailAddress>[[[_auth_identity]]]</EMailAddress>
     </User>
     <Action>
     <Settings>
     <Server>
     <Type>MobileSync</Type>
     <Url>[[[https://_server/Microsoft-Server-ActiveSync]]</Url>
     <Name>[[[https://_server/Microsoft-Server-ActiveSync]]</Name>
     </Server>
     </Settings>
     </Action>
     </Response>

I tried to hack something together myself in Automx 0.8, along the lines of:

if self.__subschema == "mobile":
   culture = etree.SubElement(response, "Culture")
   culture.text = "en:en"

   user = etree.SubElement(response, "User")

   displayname = etree.SubElement(user, "DisplayName")
   displayname.text = _auth_identity

   emailaddress = etree.SubElement(user, "EmailAddress")
   emailaddress.text = _auth_identity

   action = etree.SubElement(response, "Action")

   settings = etree.SubElement(action, "Settings")

   server = etree.SubElement(settings, "Server")
[..]

but did not get past the <User/> node showing up (empty) in the XML 
tree. The other nodes (e.g Settings etc) are not added...

This would be very helpful, and seems like a low-hanging fruit, 
especially when used in combination with PHP-Push [1] to actually 
implement functionality behind the "/Microsoft-Server-ActiveSync" URL.

Any help/code/diff would be greatly appreciated.

Thank you in advance, Achim


[1] <https://github.com/dupondje/PHP-Push-2>


More information about the automx-users mailing list