Summary | ActiveSync AutoProvision - User name / email address option for AutoDiscovery not honoured |
Queue | Synchronization |
Queue Version | Git master |
Type | Bug |
State | Resolved |
Priority | 1. Low |
Owners | mrubinsk (at) horde (dot) org |
Requester | horde (at) agotnes (dot) com |
Created | 11/03/2012 (4627 days ago) |
Due | |
Updated | 11/06/2012 (4624 days ago) |
Assigned | 11/05/2012 (4625 days ago) |
Resolved | 11/06/2012 (4624 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | No |
State ⇒ Resolved
Most clients will work correctly, even those that don't properly
request Autodiscovery. Those that don't work, will simply have to
manually enter account details on the device.
in /usr/share/php/Horde/ActiveSync/Request/Autodiscover.php on line 40
afterwards...
released with the next Horde/Horde release.
commit fc9e244516f45495ebad57cfd55f86ee355eafe2
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date: Tue Nov 6 16:56:55 2012 -0500
Bug: 11635Yet Another fix for broken ActiveSync clients.Some android clients not only incorrectly send the email address
as the username in an Authorization header, but they also completely
fail to send the XML Autodiscover request. Try to recover from this
by getting the email from the Authorization header and hope for the best.
Note, these same clients will incorrectly auto populate the username
field with the email address.
.../lib/Horde/ActiveSync/Request/Autodiscover.php | 23 ++++++++++++++++---
1 files changed, 19 insertions(+), 4 deletions(-)
http://git.horde.org/horde-git/-/commit/fc9e244516f45495ebad57cfd55f86ee355eafe2
I applied a couple of the patches you made overnight manually against
2.0.2 which I'm running;
http://git.horde.org/horde-git/-/commit/0e7e68077813b44f2a52bf673a992187992e38c6
Firstly I found that the log entry added simply did not appear,
leading me to believe the code wasn't executed. See the last small
patch for more on that;
Once I made the small change in the last patch below
I had to remove the log entry here as the _logger object doesn't seem
initialised. You might have done so in another patch I missed, once
the log statement was commented out things went quite well :) Error
below;
PHP Fatal error: Call to a member function debug() on a non-object in
/usr/share/php/Horde/ActiveSync/Request/Autodiscover.php on line 40
http://git.horde.org/horde-git/-/commit/2276673c168f530bb734830a8a15ec7923a9a0ea
This one I applied and am now running with
I also found a couple of error messages from of all things Ingo when
auto-provisioning. I get these when logging in to Imp, but as I don't
use Ingo much I've yet to dig into these and fix them. I thought it
odd to get Ingo messages when AS was kicking in and thought it might
be that autodiscover wasn't picked up - so what I found was that in my
rpc.php in the web directory it still matched using strpos, not
stripos for auto discovery;
line 36 in rpc.php changed;
(stripos($_SERVER['REQUEST_URI'], 'autodiscover/autodiscover.xml')
!== false)) {
(add 'i')
And with this I now get auto-provisoning going for iOS6.0.1!
I see this is patched in;
http://git.horde.org/commit.php/?rt=horde-git&commit=a86c01f0a9aafc49fd14215174bc5676b305df3b
already, but obviously not yet released as I just ran the upgrade of
all components :)
So I've now got a manually hacked version which works and only need
the relevant fixes (incl I guess a logging init somewhere) released
going before AutoProv is fully going :)
Hope my early morning notes makes sense :)
commit 2276673c168f530bb734830a8a15ec7923a9a0ea
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date: Tue Nov 6 14:16:10 2012 -0500
Ensure we use the correct username for broken clients.
Some clients evidently use the full email address when building the
Authorization header for Autoconfigure requests.
Potentially a fix for
Bug: 11635framework/ActiveSync/lib/Horde/ActiveSync.php | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
http://git.horde.org/horde-git/-/commit/2276673c168f530bb734830a8a15ec7923a9a0ea
/usr/share/php/Horde/ActiveSync :)
Will review tomorrow :)
something from the install!
I ran a few grep commands and can't find anything like;
Horde_Core_ActiveSync_Driver::getUsernameFromEmail()
or
Horde_ActiveSync_Request_Autodiscover::handle()
The latter I looked for using ;
grep -r -i autodiscover *
And found;
config/conf.php:$conf['activesync']['autodiscovery'] = 'user';
config/conf.xml: <configheader>Autodiscovery</configheader>
config/conf.xml: <configenum name="autodiscovery" desc="Some
devices attempt to use an
config/conf.xml: Autodiscovery service to configure the device's
account using only the
config/conf.xml: alias on your webserver to point
/autodiscover/autodiscover.xml to
config/conf.bak.php:$conf['activesync']['autodiscovery'] = 'hook';
rpc.php: (strpos($_SERVER['REQUEST_URI'],
'autodiscover/autodiscover.xml') !== false)) {
Can you confirm which Horde files these methods should be in and I'll
review and try to re-install the package maybe?
The trick is - AS works ok for me now for email using a couple of iOS
6.0.1 devices - can't be missing that much?
indicating it connects to the autodiscover address and is redirected
to rpc.php. Happy to provide traces, but see my other response...
http://bugs.horde.org/ticket/11624
In that I get a 501 returned. I tried the manual hacks suggested in
this bug with partial success insofar as the 501 became a 200 but I
still didn't complete the autoprovision - I'm probably missing
something :)
requests as described in the wiki?
If so, will need a log and/or wiretrace to see why it's failing for you.
State ⇒ Feedback
fine for me. You will have to track this down yourself.
The code that is responsible for returning the username given an email
address is in Horde_Core_ActiveSync_Driver::getUsernameFromEmail().
You can clearly see the code that returns only the mailbox portion of
the email address. It is called from
Horde_ActiveSync_Request_Autodiscover::handle().
State ⇒ Assigned
http://bugs.horde.org/ticket/11624
In that I get a 501 returned. I tried the manual hacks suggested in
this bug with partial success insofar as the 501 became a 200 but I
still didn't complete the autoprovision - I'm probably missing
something :)
Enough bug hunting for one day for me :)
imp/config/hooks.php using the preauthenticate function leads to a
successful login to Dovecot (2 successful ones, in fact).
So assuming a fix is made to strip out the @domain.com part - we get
an IMAP session ok.
Now, however, I get no errors in the Horde log files nor does the
Provisioning work - it still requests me to manually enter details.
Ideas welcome :)
Priority ⇒ 2. Medium
Type ⇒ Bug
Summary ⇒ ActiveSync AutoProvision - User name / email address option for AutoDiscovery not honoured
Queue ⇒ Synchronization
Milestone ⇒
Patch ⇒ No
State ⇒ Unconfirmed
$conf['activesync']['autodiscovery'] = 'user';
When using AutoDiscovery from an iOS6 device I get these login entries
from Dovecot indicating this option isn't honoured;
Nov 3 10:00:03 skadi dovecot: imap-login: Disconnected (auth failed,
2 attempts in 13 secs): user=<horde@agotnes.com>
I had a quick look around the sourcecode for where the stripping code
is but couldn't find it :)
Happy to test if provided a diff.