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

davmail.exchange.ExchangeSession -- all network interfaces down or host unreachable #279

Closed tps800 closed 1 year ago

tps800 commented 1 year ago

davmail can login to https://<exchange>/owa, but then fails on ews: ews endpoint not available at https://<exchange>/ews/exchange.asmx: Calling https://<exchange>/owa in a browser displays instantly this servers login. As davmail can, I can then login. But the server does not redirect to ews, but to https://<exchange>/owa/#path=/mail. davmail seems to look for https://<exchange>/ews/exchange.asmx and fails, because this is not available any more -- seems Microsoft made true what had been announced for long: turning down ews-support within exchange.

This problem occurred after installing the latest maintenance fixes from Microsoft on the exchange server today.

2023-04-05 19:37:14,700 DEBUG [CaldavConnection-7882] davmail.http.HttpClientAdapter  - Add cookie [version: 0][name: cadataSig][value: MCxxZlN2gb0klYD3/R0y5ArlANDSyNE37MRRtrKMlD8=][domain: <exchange-server>][path: /][expiry: null]
2023-04-05 19:37:14,701 DEBUG [CaldavConnection-7882] davmail.http.HttpClientAdapter  - Redirect https://<exchange-server>/owa/auth.owa to https://<exchange-server>/owa/
2023-04-05 19:37:14,734 DEBUG [CaldavConnection-7882] davmail.http.DavGatewaySSLSocketFactory  - createSocket <exchange-server> 443
2023-04-05 19:37:14,964 DEBUG [CaldavConnection-7882] davmail.http.HttpClientAdapter  - Add cookie [version: 0][name: ClientId][value: BBBA12F61AC94D4496A9AB3AF0F91017][domain: <exchange-server>][path: /][expiry: Fri Apr 05 19:37:14 CEST 2024]
2023-04-05 19:37:14,966 DEBUG [CaldavConnection-7882] davmail.http.HttpClientAdapter  - Add cookie [version: 0][name: UC][value: c3dd6480975647acb6177d9907188c9d][domain: <exchange-server>][path: /][expiry: null]
2023-04-05 19:37:14,966 DEBUG [CaldavConnection-7882] davmail.http.HttpClientAdapter  - Add cookie [version: 0][name: X-OWA-CANARY][value: UruqOwNUXUGsC1gqQ5ZT-SA7NmX8NdsIBtxANCDaUtHOym6XtOT6kg-uJcLDCXHpnmkUz5Cwq1c.][domain: <exchange-server>][path: /][expiry: null]
2023-04-05 19:37:14,967 DEBUG [CaldavConnection-7882] davmail.http.HttpClientAdapter  - Add cookie [version: 0][name: X-BackEndCookie][value: S-1-5-21-2371448200-2626132239-2341880065-2205=u56Lnp2ejJqBysaax8yZzJ7Sm8qaytLLx8ec0sbNz5rSnJ7OmpvIns3NmZrPgYHNz83M0s/K0s/Kq87IxczIxc7L][domain: <exchange-server>][path: /owa][expiry: Fri May 05 19:37:14 CEST 2023]
2023-04-05 19:37:15,002 DEBUG [CaldavConnection-7882] davmail.exchange.ExchangeSession  - Successfully authenticated to https://<exchange-server>/owa/
2023-04-05 19:37:20,009 DEBUG [CaldavConnection-7882] davmail.http.HttpClientAdapter  - Add cookie [version: 0][name: X-BackEndCookie][value: S-1-5-21-2371448200-2626132239-2341880065-2205=u56Lnp2ejJqBysaax8yZzJ7Sm8qaytLLx8ec0sbNz5rSnJ7OmpvIns3NmZrPgYHNz83M0s/K0s/Kq87IxczIxc3PgZ2ZjNGWkYuajZGBzw==][domain: <exchange-server>][path: /ews][expiry: Fri May 05 19:37:20 CEST 2023]
2023-04-05 19:37:20,033 WARN  [CaldavConnection-7882] davmail.exchange.ExchangeSession  - All network interfaces down or host unreachable !
2023-04-05 19:37:20,034 DEBUG [CaldavConnection-7882] davmail.exchange.ExchangeSession  - java.io.IOException: Ews endpoint not available at https://<exchange-server>/ews/exchange.asmx status 500
java.io.IOException: Ews endpoint not available at https://<exchange-server>/ews/exchange.asmx status 500
    at davmail.exchange.ews.EwsExchangeSession.checkEndPointUrl(EwsExchangeSession.java:230)
    at davmail.exchange.ews.EwsExchangeSession.buildSessionInfo(EwsExchangeSession.java:237)
    at davmail.exchange.ews.EwsExchangeSession.<init>(EwsExchangeSession.java:186)
    at davmail.exchange.ExchangeSessionFactory.getInstance(ExchangeSessionFactory.java:201)
    at davmail.exchange.ExchangeSessionFactory.getInstance(ExchangeSessionFactory.java:97)
    at davmail.caldav.CaldavConnection.run(CaldavConnection.java:178)
2023-04-05 19:37:20,034 WARN  [CaldavConnection-7882] davmail  - All network interfaces down or host unreachable !
2023-04-05 19:37:21,036 DEBUG [CaldavConnection-7882] davmail  - > HTTP/1.1 503 Service Unavailable
2023-04-05 19:37:21,036 DEBUG [CaldavConnection-7882] davmail  - > Server: DavMail Gateway 6.1.0-3422
2023-04-05 19:37:21,036 DEBUG [CaldavConnection-7882] davmail  - > DAV: 1, calendar-access, calendar-auto-schedule, calendarserver-private-events, addressbook
2023-04-05 19:37:21,037 DEBUG [CaldavConnection-7882] davmail  - > Date: Wed, 05 Apr 2023 17:37:21 +0000
2023-04-05 19:37:21,037 DEBUG [CaldavConnection-7882] davmail  - > Expires: Wed, 05 Apr 2023 17:37:21 +0000
2023-04-05 19:37:21,037 DEBUG [CaldavConnection-7882] davmail  - > Cache-Control: private, max-age=0
2023-04-05 19:37:21,038 DEBUG [CaldavConnection-7882] davmail  - > Content-Type: text/plain;charset=UTF-8
2023-04-05 19:37:21,038 DEBUG [CaldavConnection-7882] davmail  - > Connection: close
2023-04-05 19:37:21,039 DEBUG [CaldavConnection-7882] davmail  - > Content-Length: 49
2023-04-05 19:37:21,041 DEBUG [CaldavConnection-7882] davmail  - > 
2023-04-05 19:37:21,041 DEBUG [CaldavConnection-7882] davmail.caldav.CaldavConnection  - > All network interfaces down or host unreachable !
2023-04-05 19:37:21,044 INFO  [CaldavConnection-7882] davmail.connection  - DISCONNECT - 127.0.0.1:7882 

davmails message that "All network interfaces down or host unreachable!" seems false. The host is reachable and its network interfaces are up, but davmail does not find ews-pages on this host.

Fetching mail using davmail fails at the time being.

esabol commented 1 year ago

Status 500 means that the web server at that URL is not operating correctly. Are you sure that URL is correct? Maybe case matters? My davmail.url is set to https://outlook.office365.com/EWS/Exchange.asmx, for example. See also issue #273 for other configuration tips.

tps800 commented 1 year ago

Problem solved: they upgraded and applied fixes. Afterwards ews did not start any more and they did not notice. They are working on it now.