Way to add mobile sync schema

Achim J. Latz achim+automx at qustodium.net
Sun Sep 16 04:48:48 CEST 2012

OK, I got as far as generating a valid reply that can be used by my iOS 
5 phone. Now if somebody could make the content of the fields dynamic, 
probably in __service, with a new configuration section in automx.conf?

The code with a hard-coded response looks like this:

if self.__subschema == "mobile":
     NS_Response = ("http://schemas.microsoft.com/exchange/"

     # Maybe we need more information here?
     NS_Response = ("http://schemas.microsoft.com/exchange/"

root = etree.Element("Autodiscover", xmlns=NS_AutoDiscover)
response = etree.SubElement(root, "Response", xmlns=NS_Response)

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 = "Full User Name" #or emailaddress
         emailaddress = etree.SubElement(user, "EmailAddress")
         emailaddress.text = "user at domain.tld"
	#elem[service + "_auth_identity"]
         action = etree.SubElement(response, "Action")
         settings = etree.SubElement(action, "Settings")
         server = etree.SubElement(settings, "Server")
         servertype = etree.SubElement(server, "Type")
         servertype.text = "MobileSync"
         serverurl = etree.SubElement(server, "Url")
         serverurl.text = 
         servername = etree.SubElement(server, "Name")
         servername.text = 
         self.__xml = root

More information about the automx-users mailing list