mguessan / davmail

DavMail POP/IMAP/SMTP/Caldav/Carddav/LDAP Exchange and Office 365 Gateway - Synced with main subversion repository at
http://davmail.sourceforge.net
GNU General Public License v2.0
580 stars 86 forks source link

Can't get O365manual or O365interactive to do anything on my Mac #296

Open pkoning2 opened 1 year ago

pkoning2 commented 1 year ago

I'm trying to use the O365 modes, but on my Mac I can't get any of them to bring up the expected two-factor authentication dialogs. The documentation is not really clear, but I assumed that O365interactive is supposed to pop up a GUI window with my organization's authentication dialog in it. That doesn't happen. So I tried O365manual instead, running davmail from a terminal window as I found mentioned in some webpage: /Applications/DavMail.app/Contents/MacOS/davmail .
That brings up Davmail (I see the dock icon and I can see logs or settings), but again no output appears, there are no messages on the terminal window and when I try to get Apple mail to connect via davmail I just get a failure. I can see some messages in the debug logs but I don't know how to read them or which of the various categories to enable to get what is most relevant.

esabol commented 1 year ago

For a Mac application in /Applications, I would expect to double-click on it in the Finder. Did you try that, @pkoning2 ? If so, did it do anything?

pkoning2 commented 1 year ago

Opening it by double clicking in Finder was the first thing I tried. That also produced no output. I tried the other (run it from a shell) because I read that as a procedure to use in some user's documentation. I think he was talking about a Linux installation, though. If all else fails I could try that, I have a Linux box I could put to work for this task. But running it on my Mac would be more convenient.

esabol commented 1 year ago

Just to be clear, did you download and install Oracle Java on your Mac?

Did you download the latest version of DavMail for macOS, DavMail-MacOSX-6.1.0-3423.app.zip ?

And then you followed the instructions at https://davmail.sourceforge.net/macosxsetup.html and https://davmail.sourceforge.net/gettingstarted.html ?

I just tested it on my Mac, and, after double-clicking on the application, it opened just fine. There should be a yellow icon with a lightning symbol in the Dock. No windows will open, however, so if you're looking for a window to open without you doing anything, it won't do that. If you click on the icon in the Dock, the menu bar should say "DavMail" and you can select "Preferences" from that menu. That shows the same settings shown at https://davmail.sourceforge.net/gettingstarted.html.

Personally, I do my configuration by editing the ~/.davmail.properties file, but I also use DavMail on Linux. If you make changes to that file, you should quit DavMail and re-open it.

pkoning2 commented 1 year ago

I have long had Java installed on my Mac, yes, from Oracle. And I have the latest DavMail, set up as documented.

Perhaps I wasn't clear. It starts just fine. But the way I understand O365Interactive is that it should open some sort of dialog window when my mail client (Apple's standard Mac mail) tries to connect to the mail service I have configured there, using IMAP to localhost:1143. And I do see that in the debug logs. But the Exchange server uses two-part authentication so I was looking for the familiar popup window that runs me through those two parts. That's how I understood "O365Interactive" to work, and in my case nothing happens. Nor can I figure out how to fall back onto "O365Manual".

esabol commented 1 year ago

Sorry, I completely misunderstood your issue. I think you must be encountering an error of some sort (probably in your configuration), and you need to post the relevant lines from ~/Library/Logs/DavMail/davmail.log.

Open DavMail Preferences, switch to the Logging tab. Set the WIRE logging category to DEBUG. Save preferences. Quit the DavMail application. Make sure Mail is open configured using the instructions at https://davmail.sourceforge.net/osximapmailsetup.html. Open DavMail. Force Mail to connect to DavMail. Post relevant contents of ~/Library/Logs/DavMail/davmail.log here, and I hope someone can then diagnose what the problem is.

pkoning2 commented 1 year ago

Ok, I did that, log attached. FWIW, I'm using Mac OS Monterey, 12.6.6, on an M1 Macbook Pro. davmail.log

esabol commented 1 year ago

Looking over your debug log file, I don't see any "smoking gun", so I'm not sure what the problem is. It looks pretty normal to me. I hope @mguessan or someone can help you.

Fwiw, I recommend that you start with O365Manual and get that working before trying O365Interactive. In my experience O365Manual is easier to get working, at least on Linux, and it works in more scenarios (security cards and things like that).

pkoning2 commented 1 year ago

O365manual doesn't do anything either. Here is the log for that one. davmail.log

mguessan commented 1 year ago

@pkoning2 your mail client is trying to connect in SSL mode on a clear text listener => either force your client to disable SSL (if DavMail runs locally this should not be an issue) or setup a client side certificate in DavMail, see https://davmail.sourceforge.net/sslsetup.html

pkoning2 commented 1 year ago

Thanks, that gets me farther. I now see a DavMail popup for the authentication exchange.
Next question: is there a way to modify how DavMail identifies what it is (device identifier, device platform)?

mguessan commented 1 year ago

On the application side, DavMail by default uses a clientId registered by me, you can replace it by a custom clientId registered on your O365 tenant (beware EWS may no longer be available, haven't checked recently) or use Outlook desktop clientId, cf https://github.com/mguessan/davmail/issues/71

On the client side in order to use DavMail you must be able to authenticate properly through a web browser: just try with the link provided by DavMail in O365Manual authentication popup.

If your admins require an Azure certificate or workplace registration your workstation must be Azure joined to make it work. If it doesn't work try from to authenticate on a company provided device.