Summary | ActiveSync :: Extend the Autodiscover feature to return also valid answers to MS Outlook queries |
Queue | Horde Framework Packages |
Queue Version | Git develop |
Type | Enhancement |
State | Resolved |
Priority | 1. Low |
Owners | mrubinsk (at) horde (dot) org |
Requester | torben (at) dannhauer (dot) info |
Created | 11/04/2012 (4640 days ago) |
Due | |
Updated | 11/16/2012 (4628 days ago) |
Assigned | |
Resolved | 11/16/2012 (4628 days ago) |
Milestone | |
Patch | Yes |
I'll test Outlook 2013 at home this evening, but I strongly assume
this feature is finally implemented.
Regarding Outlook 2013:
My last impression was, that Outlook 2013 performs to independent queries:
the autodiscover for Imap & Co followed by the autodiscover for activesync.
In my opinion Microsoft should have sorted their autodiscover attempts
from the most capable protocol (activesync: email, contacs and
calenders) to the least capable protocol (imap: only email) to
establish the "best" connection the server/client can achieve. But it
doesn't.
So the question is if horde should address this MS bug and should
return for Outlook 2013 only activesync repsonses? I'm not sure. But
that could be adressed once horde supports EAS 14.
Anyway, the autodiscover for outlook works great, so I'm looking
forward to see it integrated into the next release.
Torben
that outlook makes. The idea was to catch the mobilesync request
made by Outlook and reject it, but I now see that the request from
Outlook for mobilesync looks like any other mobilesync request. I'll
have to check the useragent, which I was hoping to avoid since
future versions of Outlook can have different values for this.
all. It's up to the client to know if the server supports the version
number required by the client. Outlook should detect this and refuse
to use EAS. This is what I'll implment, you'll have to let me know if
this works, since I don't have an Outlook client to use to test.
some broken android clients don't send the XML payload at all. So, we
default to the assuming a mobilesync *request* schema.
schema, so within this block, it does not make sense to check for a
mobilesync schema as done in lines 140:144. -> what was the
intention of the line? In my opinion we must drop that lines,
because the comparison in line 140 is always true and thus the
function returns a failure response.
that outlook makes. The idea was to catch the mobilesync request made
by Outlook and reject it, but I now see that the request from Outlook
for mobilesync looks like any other mobilesync request. I'll have to
check the useragent, which I was hoping to avoid since future versions
of Outlook can have different values for this.
the failure response has always the response schema for a
mobilesync, so RCA seems not to unterstand that an error occured.
the _buildFailureResponse(..) function should use the correct
response schema in line 216 to allow Outlook & RCA to unterstand
that the error code is the response to teir query.
http://lists.horde.org/archives/commits/2012-November/017210.html
http://lists.horde.org/archives/commits/2012-November/017212.html
The respond schema is now detected correctly for both, Outlook and RCA.
Regarding teh logic fix: Maybe I'm missing the point, but for me it
does make still no sense.
My observation was, that outlook 2013 performs two independet
autodiscover steps: It tries to discover a mobilesync setting, and it
tries to discover a conventional Outlook setting as Outlook 2010 and
Outlook 2007 do.
Some suggestions for Autodiscover.php:
- Line 113 and 136 check both for empty repsonse schema. this could
be done directly after entering the _buildResponseString(..) function
to make the rest of the function easier to read.
- Line 135 opens a conditionalblock for the "autodiscover/outlook"
schema, so within this block, it does not make sense to check for a
mobilesync schema as done in lines 140:144. -> what was the intention
of the line? In my opinion we must drop that lines, because the
comparison in line 140 is always true and thus the function returns a
failure response.
Bye the way:
the failure response has always the response schema for a mobilesync,
so RCA seems not to unterstand that an error occured. the
_buildFailureResponse(..) function should use the correct response
schema in line 216 to allow Outlook & RCA to unterstand that the error
code is the response to teir query.
Torben
http://lists.horde.org/archives/commits/2012-November/017210.html
http://lists.horde.org/archives/commits/2012-November/017212.html
around line 130, you test the responseschema to be empty.
This is not correct: for every autodiscover query the accetable
response schema is delivered. Thus this variable should always be set,
otherwise our parsing of the request is wrong.
Indeed, as I tested with outlook 2010 and also with the Microsoft
"Remote Connectivity Analyzer" ( Connectivity Tests for Microsoft
Office Outlook ), I discovered that with the RCA, the response schema
is empty, because the string has different positions in Outlook and in
RCA. This was new for me and was not adressed yet.
In my opinion we have to apply two changes to Autodiscover.php to get
it working:
1. refactor line 130:135 to avoid
"!empty($properties['response_schema'])" - which should never be
emtpy.. As I said, I have no clue about the reason of this if-clause
at lines 130:135
2. Make the repsonse schema more robust. It is not sufficient to
extract values at certain place, but we have to parse for
ACCEPTABLERESPONSESCHEMA to get the right value.
Please find below the request data send by RCA and by Outlook to get
an idea how to fetch the response schema. this depub output is done by
print:r() and thus represents the array structure
------------------------
values send by RCA:
[0] => Array
(
[tag] => AUTODISCOVER
[type] => open
[level] => 1
[attributes] => Array
(
[XMLNS:XSD] => http://www.w3.org/2001/XMLSchema
[XMLNS:XSI] => http://www.w3.org/2001/XMLSchema-instance
[XMLNS] =>
http://schemas.microsoft.com/exchange/autodiscover/outlook/requestschema/2006
)
[value] =>
)
[1] => Array
(
[tag] => REQUEST
[type] => open
[level] => 2
[value] =>
)
[2] => Array
(
[tag] => EMAILADDRESS
[type] => complete
[level] => 3
[value] => test2013@dannhauer.de
)
[3] => Array
(
[tag] => REQUEST
[value] =>
[type] => cdata
[level] => 2
)
[4] => Array
(
[tag] => ACCEPTABLERESPONSESCHEMA
[type] => complete
[level] => 3
[value] =>
http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a
)
[5] => Array
(
[tag] => REQUEST
[value] =>
[type] => cdata
[level] => 2
)
[6] => Array
(
[tag] => REQUEST
[type] => close
[level] => 2
)
[7] => Array
(
[tag] => AUTODISCOVER
[value] =>
[type] => cdata
[level] => 1
)
[8] => Array
(
[tag] => AUTODISCOVER
[type] => close
[level] => 1
)
---------------------
values send by Outlook:
[0] => Array
(
[tag] => AUTODISCOVER
[type] => open
[level] => 1
[attributes] => Array
(
[XMLNS] =>
http://schemas.microsoft.com/exchange/autodiscover/outlook/requestschema/2006
)
)
[1] => Array
(
[tag] => REQUEST
[type] => open
[level] => 2
)
[2] => Array
(
[tag] => EMAILADDRESS
[type] => complete
[level] => 3
[value] => test2013@dannhauer.de
)
[3] => Array
(
[tag] => ACCEPTABLERESPONSESCHEMA
[type] => complete
[level] => 3
[value] =>
http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a
)
[4] => Array
(
[tag] => REQUEST
[type] => close
[level] => 2
)
[5] => Array
(
[tag] => AUTODISCOVER
[type] => close
[level] => 1
)
Thanks Torben
Anyway you can test the current Git code in your setup?
if (!empty($results['raw_xml'])) {
should be
if (empty($results['raw_xml'])) {
in my opinion. otherwise it wouldn't call buildResponse( if raw_xml is empty..
Torben
teh details in the settings tab.
I have some errors, it is currently not working but I assume it is my
fault, so I'll dive into it tomorrow evening.
Torben
- What is the intent of Audodiscover.php lines 130:135 ?
- How are the params of the outlook autodiscover set? Only via the
hook or also via the actviesync configuration tab ? Just curious...
Torben
Anyway you can test the current Git code in your setup?
Of course I will test, but it may take some days, I'm not sure I can
squeeze it in today. I'll give you feedback till end of week at latest.
Torben
Assigned to Michael Rubinsky
Anyway you can test the current Git code in your setup?
commit ba5b5d15d04bb3d490b5c3c5c3a522879b4ad730
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date: Wed Nov 14 16:36:03 2012 -0500
Support sending Autodiscover responses for Outlook configuration.
Part of
Request: 11639.../lib/Horde/ActiveSync/Request/Autodiscover.php | 100
++++++++++++++++----
1 files changed, 81 insertions(+), 19 deletions(-)
http://git.horde.org/horde-git/-/commit/ba5b5d15d04bb3d490b5c3c5c3a522879b4ad730
commit df58e64aed4f1b600748fe3452d0363a753ba949
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date: Wed Nov 14 14:49:23 2012 -0500
Add hooks for modifying autodiscover data and overriding the XML.
Part of
Request: 11639.../lib/Horde/ActiveSync/Request/Autodiscover.php | 23 ++++++++++----
.../Core/lib/Horde/Core/ActiveSync/Driver.php | 30 +++++++++++++------
horde/config/hooks.php.dist | 31
+++++++++++++++++++-
3 files changed, 67 insertions(+), 17 deletions(-)
http://git.horde.org/horde-git/-/commit/df58e64aed4f1b600748fe3452d0363a753ba949
make sense, but not for the current implemntation status
Maybe you are right, step by step, first lets add the Outlook
autodiscover support, later on the ActiveSync/Outlook support.
The first is regarding IMAP/POP/SMTP, the second for ActiveSync.
In my opinion, Outlook 2013 should ignore the
exchange/autodiscover/outlook query and should answer for the
exchange/autodiscover/mobilesync query.
Outlook 2013. Rather, once this is supported we should send a response
based on the highest configured EAS version to support. For now, we
should do the opposite; ignore the mobilesync request and only respond
to the outlook request.
Cheers for letting me know. I'll keep watching for updates and give feedback.
Regards,
Steve
G'day Torben,
my Funambol experience is quite bad, so I will never use funambol again.
No, with Outlook 2010 there is now way to use Horde's ActiveSync
capabilities. You would need a newer version of Outlook (2013) and
Horde EAS implementation (14).
Torben
Thanks for the update, very helpful.
So there is no way currently for Horde with its Activesync Mobile
ability to communicate with Outlook 2010 - Funambol doesn't work in my
experience with Windows 8.
I would gladly help, however my expertise are quite limited. I have a
background only in network administration. So unfortunately I cannot
help. But I would be glad to help out in any other way, for example
testing, etc.
Regards,
Steve
Syncing Email, Calendar, Contacts?
Top job though mate, thumbs up from Aus.
true exchange (which horde does NOT) and of course IMAP and POP. This
modification adds autodiscover for Outlook to use IMAP if available,
otherwise POP.
In addition, Outlook 2013 supports native "Exchange ActiveSync" (EAS)
connections, it is able to act as an active sync client like a
smortphone does. This includes email, contancts, calendars and tasks.
The autodiscover service of Outlook 2013 is performed in two stages:
it queries the existing mobilesync response schema to get an EAS
setup. Additionaly it queries the classical exchange schema I proposed
in this ticket to autodiscover the SMTP/POP/IMAP setup.
Native ActiveSync usage of Outlook 2013 works regarding the
autodiscover feature, but unfortunately Outlook requieres EAS version
14.x, and horde only provides version 12.1. This is the show stopper
for Outtlook 2013+Horde currently.
According to micheal they requiere round about 40 hours to implement
EAS version 14.
I'm willing to spend a part of the necessary hours to Horde LLC. Maybe
you are one of these to spend the other hours.. :)
By the way: tine2.0 has oldready implemented a update to work with
Outlook 2013 ( currently not released, only in their GIT repo), so it
should also be possible for Horde
Best wishes,
Torben
Syncing Email, Calendar, Contacts?
Top job though mate, thumbs up from Aus.
The first is regarding IMAP/POP/SMTP, the second for ActiveSync.
In my opinion, Outlook 2013 should ignore the
exchange/autodiscover/outlook query and should answer for the
exchange/autodiscover/mobilesync query.
this is the query debug output of the two Outlook requests:
[12-Nov-2012 19:05:27] _buildResponseString properties as struct: Array
(
[display_name] =>
[email] => test@osgvisual.org
[url] => https://www.dannhauer.de/Microsoft-Server-ActiveSync
[culture] => en:en
[request_schema] =>
http://schemas.microsoft.com/exchange/autodiscover/outlook/requestschema/2006
[response_schema] =>
http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a
)
[12-Nov-2012 19:05:27] _buildResponseString user_agent: Microsoft
Office/15.0 (Windows NT 6.1; Microsoft Outlook 15.0.4128; Pro)
[12-Nov-2012 19:05:28] _buildResponseString properties as struct: Array
(
[display_name] =>
[email] => test@osgvisual.org
[url] => https://www.dannhauer.de/Microsoft-Server-ActiveSync
[culture] => en:en
[request_schema] =>
http://schemas.microsoft.com/exchange/autodiscover/mobilesync/requestschema/2006
[response_schema] =>
http://schemas.microsoft.com/exchange/autodiscover/mobilesync/responseschema/2006
)
[12-Nov-2012 19:05:28] _buildResponseString user_agent: Microsoft.Outlook.15
New Attachment: Autodiscover.php.diff
Thanks,
Torben
submission protocol.
I will create diffs this evening and attach it as soon as possible.
Priority ⇒ 1. Low
Version ⇒ Git develop
Priority ⇒ 3. High
State ⇒ New
Patch ⇒ Yes
Milestone ⇒
Summary ⇒ ActiveSync :: Extend the Autodiscover feature to return also valid answers to MS Outlook queries
Type ⇒ Enhancement
Queue ⇒ Horde Framework Packages
performed by Microsoft Outlook Mail clients.
Mail clients like Outlook 2010 and older should auto discover there
IMAP/SMTP settings, Outlook 2013 clients could be handled seperately
to allow ActiveSync connections once EAS Protocoll 14.1 or above is
implemented in Horde.
This Ticket relies an the implementation submitted in Horde Ticket
11637 (http://bugs.horde.org/ticket/11637) to be able to analyze he
request schema.
Please edit Horde/ActiveSync/Request/Autodiscover.php and enhance the
function "_buildResponseString($properties)" to:
protected function _buildResponseString($properties)
{
if (stripos($properties['request_schema'],
'autodiscover/mobilesync') !== false) {
return '<?xml version="1.0" encoding="utf-8"?>
<Autodiscover
xmlns="http://schemas.microsoft.com/exchange/autodiscover/responseschema/2006">
<Response
xmlns="http://schemas.microsoft.com/exchange/autodiscover/mobilesync/responseschema/2006">
<Culture>' . $properties['culture'] . '</Culture>
<User>
<DisplayName>' . $properties['display_name'] .
'</DisplayName>
<EMailAddress>' . $properties['email'] . '</EMailAddress>
</User>
<Action>
<Settings>
<Server>
<Type>MobileSync</Type>
<Url>' . $properties['url'] . '</Url>
<Name>' . $properties['url'] . '</Name>
</Server>
</Settings>
</Action>
</Response>
</Autodiscover>';
}
else if (stripos($properties['request_schema'],
'autodiscover/outlook') !== false) {
//// MS Outlook 2013 (Outlook 15) : Output data for ActiveSync
//if(preg_match("Microsoft[\.|\s]Outlook[\.|\s]15",
$_SERVER['HTTP_USER_AGENT'])) {
// Todo: currently not supported by horde because
Outlook 2013 ActiveSync requires EAS Protocol 14.1 or above
//}
// Any other MS Outlook version: Output data for IMAP
if (stripos( $_SERVER['HTTP_USER_AGENT'], 'Outlook') !== false) {
return '<Autodiscover
xmlns="http://schemas.microsoft.com/exchange/autodiscover/responseschema/2006">
<Response xmlns="' . $properties['response_schema'] . '">
<User>
<DisplayName>' . $properties['display_name'] .
'</DisplayName>
</User>
<Account>
<AccountType>email</AccountType>
<Action>settings</Action>
<Protocol>
<Type>IMAP</Type>
<Server>my-horde.tld</Server>
<Port>993</Port>
<LoginName>' . $properties['email'] . '</LoginName>
<DomainRequired>off</DomainRequired>
<SPA>off</SPA>
<SSL>on</SSL>
<AuthRequired>on</AuthRequired>
</Protocol>
<Protocol>
<Type>POP3</Type>
<Server>my-horde.tld</Server>
<Port>110</Port>
<LoginName>' . $properties['email'] . '</LoginName>
<DomainRequired>off</DomainRequired>
<SPA>off</SPA>
<SSL>on</SSL>
<AuthRequired>on</AuthRequired>
</Protocol>
<Protocol>
<Type>SMTP</Type>
<Server>my-horde.tld</Server>
<Port>465</Port>
<LoginName>' . $properties['email'] . '</LoginName>
<DomainRequired>off</DomainRequired>
<SPA>off</SPA>
<SSL>on</SSL>
<AuthRequired>on</AuthRequired>
<UsePOPAuth>on</UsePOPAuth>
</Protocol>
</Account>
</Response>
</Autodiscover>';
}
}
else return(_buildFailureResponse($properties['email'],
"Invalid autodiscover schema")); // Fallback
}
Please be aware that this example has hardcoded values in the outlook
response. It should be configurable in the Administration/ActiveSync
prefs.
The following aspects should be configurable:
* Which protocol types should be configured for autodetection (IMAP,
POP3, SMTP
* The server for each protocol type
* The Port for each protocol type
* If SSL is active for each protocol type
* If SMTP requires Pop-auth
This example with hardcode values is tested and works with MS Outlook 2010.
The ActiveSync profile for MS Outlook 2013 cannot be testet because
Horde needs to implement EAS protocol 14 to allow MS Outlook 2013 to
be used as ActiveSync client.
Many Thanks,
Torben Dannhauer