[Bug 261893] mail/davmail: Fails to run: java.lang.ClassNotFoundException: davmail.exchange.auth.O365InteractiveAuthenticator

From: <bugzilla-noreply_at_freebsd.org>
Date: Mon, 18 Jul 2022 17:02:05 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=261893

Bill Paul <noisetube@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |noisetube@gmail.com

--- Comment #5 from Bill Paul <noisetube@gmail.com> ---
The original submitter did not follow up, but I will.

There are actually a couple of different Davmail builds for various platforms:

- Windows
- MacOS
- Linux
- Platform-independent

You would think this would not be necessary given that it's written in Java,
and Java is supposed to be a "write once, run anywhere" language. Part of the
reason they did this is so that they could have platform-specific archives
(self-extracting EXE for windows, .deb for Linux), but there's a little more to
it than that.

In order for the O365Interactive authentication method to work, it needs to
open a browser window that accesses the Office365 login page (and, possibly,
the single sign-on and/or 2FA page for a user's organization) so that the user
can interactively enter their credentials and get an OAuth2 token.

The problem is that the way in which the interactive window is opened and the
way the info from it is exchanged with Davmail is apparently platform-specific.
The Windows, MacOS and Linux builds know how to do it for their respective
platforms, but since there isn't a platform-independent way to do it, the
platform-independent build just doesn't include the support for this feature.

Unfortunately, since FreeBSD uses the platform-independent version, that means
you can't use the O365Interactive authentication method.

Apparently this limitation in the platform-independent build is not well
documented (otherwise this bug wouldn't have been filed).

You would think whatever works for Linux would also work for FreeBSD, but I'm
not sure if it's possible to adapt the port so that it uses the Linux
distribution instead.

What I suggest as a workaround is to use the O365Manual mechanism instead. With
this method, a small pop-up window will appear, prompting you to open a link in
your browser to access the Office 365 login page, and once you successfully
enter your credentials, you have to manually cut & paste the resulting URL back
into the pop-up dialog and click "Send." This is a little more clumsy than the
O365Interactive scheme, but ultimately it has the same results.

-- 
You are receiving this mail because:
You are the assignee for the bug.