Failing to configure autodiscover

I fail to configure autodiscover.

The goal is to have Outlook 365 users and other autoconfigure-aware devices connect to kopano without having to do special config (Q1: is this for Outlook 365 possible, or do I always need the KOE installed for EAS?)

The official mail addresses of my users are first.last@domain.com, the login is flast.

The two most important settings in /etc/z-push/autodiscover.conf.php are

    define('USE_FULLEMAIL_FOR_LOGIN', false);
    define('AUTODISCOVER_LOGIN_TYPE', AUTODISCOVER_LOGIN_F_NO_DOT_LAST);

Having set up autoconfigure on my Kopano server and connecting to https://server/autodiscover/autodiscover.xml requests a users login name (HTTP Basic authentication).

When I enter my email address there (the client does not know anything else), autodiscover tries to contact the Kopano backend using the local part of the e-mail adress (first.last), but does not further process and cut down the login name to the required flast. For that reason, the Kopano backend blocks access to Autodiscover immediatly.

The code responsible is:

    private function getLogin() {
        if (!isset($_SERVER['PHP_AUTH_PW'], $_SERVER['PHP_AUTH_USER'])) {
            throw new AuthenticationRequiredException("Access denied. No username or password provided.");
        }
        list($username,) = Utils::SplitDomainUser($_SERVER['PHP_AUTH_USER']);
        if(! USE_FULLEMAIL_FOR_LOGIN) {
            $username = Utils::GetLocalPartFromEmail($username);
        }
/*
HERE NEEDS TO BE THE CONVERSION FROM FIRST.LAST to FLAST, BUT IT'S MISSING
*/

        $backend = ZPush::GetBackend();
        if ($backend->Logon($username, "", $_SERVER['PHP_AUTH_PW']) == false) {
            ZLog::Write(LOGLEVEL_ERROR, sprintf("ZPushAutodiscover->getLogin(): Login failed for user '%s' from IP %s.", $username, $_SERVER["REMOTE_ADDR"]));
            throw new AuthenticationRequiredException("Access denied. Username or password incorrect.");
        }
    }

Or do I miss something? The conversion routine

    private function login($backend, $incomingXml) {

seens never to be called …

Please give me some advice. Thank you.

Hi itserv,

login() is called in DoAutodiscover function.

getLogin() you’re referring is only used in GET requests which are not usually issued by clients. It’s there e.g. for testing autodiscover in browser.

Did you check the autodiscover.log for errors?

Manfred

@itserv said in Failing to configure autodiscover:

The goal is to have Outlook 365 users and other autoconfigure-aware devices connect to kopano without having to do special config (Q1: is this for Outlook 365 possible, or do I always need the KOE installed for EAS?)

What exactly do you mean by Outlook 365?
Outlook with an EAS account will sync with Z-Push/Kopano without KOE as well, but some functionality won’t be available (see https://kb.kopano.io/display/WIKI/Setting+up+the+Kopano+OL+Extension and https://documentation.kopano.io/kopano_changelog/koe.html what it provides).

Manfred

Ah, you mean this is a test-only GET-problem? So I’m absolutely fine with it, and that explains why I seem to get further when I actually try to connect a device.

I wrote Outlook 365, but ment Outlook which is part of Office 365. And yes, of course I checked the logs, and found something worrying:

05/10/2018 08:42:41 [24583] [DEBUG] [#unknown] -------- Start ZPushAutodiscover
05/10/2018 08:42:41 [24583] [ INFO] [#unknown] Z-Push version='2.4.4+0-0'
05/10/2018 08:42:41 [24583] [FATAL] [#unknown] FatalException: Request for a responseschema that is not supported (only mobilesync is supported): http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a - code: 0 - file: /usr/share/z-push/autodiscover/autodiscover.php:177
05/10/2018 08:42:41 [24583] [FATAL] [#unknown] Exception: (FatalException) - Request for a responseschema that is not supported (only mobilesync is supported): http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a
05/10/2018 08:42:41 [24583] [ERROR] [#unknown] Unable to complete autodiscover because of ZPushException. Error: Request for a responseschema that is not supported (only mobilesync is supported): http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a
05/10/2018 08:42:41 [24583] [DEBUG] [#unknown] ZPushAutodiscover->sendResponse() sending response...
05/10/2018 08:42:41 [24583] [DEBUG] [#unknown] ZPushAutodiscover->sendResponse() response sent.
05/10/2018 08:42:41 [24583] [DEBUG] [#unknown] -------- End ZPushAutodiscover

The point that worries me is Request for a responseschema that is not supported. If I get the message right, Oulook from Office 365 tries to autodiscover with a schema that is not provided by autodiscover, which means to me that I cannot use autodiscover to connect such an Outlook.

Using 9folders Nine as a client, I get further - but fail at other places (still troubleshooting this)

@itserv said in Failing to configure autodiscover:

Oulook from Office 365 tries to autodiscover with a schema that is not provided by autodiscover

Yes, it has been reported in the past that “Click to run Outlook” and “Outlook from Office 365” don’t do the correct discovery call.

Great.
Microsoft. Again.

They seem to do a lot of stupid errors.

OK, in that case I can stop my hunt,. Thank you.