Menu

#415 How to reconfigure Davmail after address change, (2FA - Apache exception)terractive,for 2FA

v6.0.1
open
None
5
2024-01-25
2023-11-20
No

Hello.
I've been using davmail for several year (probably one of the lasts TB user in my big company).
I don't understand a lot of things neither in the davmail gateway, nor in networks in general.
The infrastructure has been changed in the company : my mail addresse was changed (lets say f.a@bc1.net to f.a@bc2.com). We use 2FA, and my PKI identifier was changed to.
In the former infrastructure, Davmail et TB worked fine. Sometimes I had to identify with WinAuth instead of PKI.
I used :
- davmail64 bits 6.0.1-3390
- Java 1.8.0 -291 (and modified davmail64.ini containing :
vm.location=C:\Program Files\Java\jre1.8.0_291\bin\server\jvm.dll
- system : Windows 10.0.19045
- TB was v. 115
- .davmail.properties is copied below.

The structure changed the 13rd of november 2023.
Now I can get my mails only with Outlook.
- I changed as less as I could
- I get a APACHE exception before davmail asks me for my e-mail password

**Here is davmail.log contains : **
2023-11-15 23:44:53,879 DEBUG [main] davmail.DavGateway - Start DavMail in GUI mode
2023-11-15 23:44:53,953 DEBUG [main] davmail - OS Name: Windows 10 Java version: 1.8.0_321 64 System tray supported
2023-11-15 23:44:53,953 INFO [main] davmail - O365Interactive is not compatible with SWT, do not try to create SWT tray
2023-11-15 23:44:54,005 INFO [main] davmail - DavMail Gateway 6.0.0-3375 listening on SMTP port 1025 POP port 1110 IMAP port 1143 CALDAV port 1080 LDAP port 1389
2023-11-15 23:44:54,162 DEBUG [CheckRelease] davmail.http.HttpClientAdapter - GET http://davmail.sourceforge.net/version.txt
2023-11-15 23:45:04,221 DEBUG [CheckRelease] davmail - Unable to get released version
2023-11-15 23:56:29,243 INFO [AWT-EventQueue-0] davmail - DavMail Gateway 6.0.0-3375 listening on SMTP port 1025 POP port 1110 IMAP port 1143 CALDAV port 1080 LDAP port 1389
2023-11-15 23:56:29,244 DEBUG [CheckRelease] davmail.http.HttpClientAdapter - GET http://davmail.sourceforge.net/version.txt
2023-11-15 23:56:37,780 DEBUG [davmail.pop.PopServer] davmail - Connection from /127.0.0.1 on port 1110
2023-11-15 23:56:37,782 INFO [davmail.pop.PopServer] davmail.connection - CONNECT - 127.0.0.1:65100
2023-11-15 23:56:39,258 DEBUG [CheckRelease] davmail - Unable to get released version
2023-11-15 23:56:48,043 ERROR [PopConnection-65100] davmail.exchange.ExchangeSession - Connect exception: org.apache.http.conn.ConnectTimeoutException Connect to 193.56.47.8:8080 [/193.56.47.8] failed: connect timed out
2023-11-15 23:56:48,044 ERROR [PopConnection-65100] davmail - DavMail configuration exception:
Connect exception: org.apache.http.conn.ConnectTimeoutException Connect to 193.56.47.8:8080 [/193.56.47.8] failed: connect timed out
davmail.exception.DavMailException: DavMail configuration exception:
Connect exception: org.apache.http.conn.ConnectTimeoutException Connect to 193.56.47.8:8080 [/193.56.47.8] failed: connect timed out
at davmail.exchange.ExchangeSessionFactory.handleNetworkDown(ExchangeSessionFactory.java:345)
at davmail.exchange.ExchangeSessionFactory.checkConfig(ExchangeSessionFactory.java:322)
at davmail.pop.PopConnection.run(PopConnection.java:98)
2023-11-15 23:56:48,047 DEBUG [PopConnection-65100] davmail - > -ERR DavMail configuration exception: Connect exception: org.apache.http.conn.ConnectTimeoutException Connect to 193.56.47.8:8080 [/193.56.47.8] failed: connect timed out
2023-11-15 23:56:48,047 INFO [PopConnection-65100] davmail.connection - DISCONNECT - 127.0.0.1:65100
2023-11-17 20:55:56,156 INFO [davmail.pop.PopServer] davmail.connection - DISCONNECT - 127.0.0.1:65100
2023-11-17 20:55:56,181 INFO [AWT-EventQueue-0] davmail - DavMail gateway stopped

**Here is my .davmail.properties : **
davmail.ssl.keystoreType=JKS
davmail.ssl.keystorePass=
davmail.proxyPassword=
davmail.oauth.tenantId=
davmail.oauth.clientId=
davmail.enableKerberos=false
davmail.smtpPort=1025
davmail.folderSizeLimit=
davmail.forceActiveSyncUpdate=false
davmail.imapAutoExpunge=true
davmail.useSystemProxies=false
davmail.proxyUser=
davmail.caldavEditNotifications=false
davmail.ssl.nosecuresmtp=false
davmail.caldavPastDelay=90
davmail.ssl.keyPass=
log4j.logger.httpclient.wire=DEBUG
davmail.noProxyFor=
log4j.logger.org.apache.commons.httpclient=DEBUG
davmail.server=false
davmail.popMarkReadOnRetr=false
davmail.ssl.nosecureimap=false
davmail.disableTrayActivitySwitch=false
davmail.caldavAutoSchedule=false
davmail.enableProxy=true
davmail.proxyPort=8080
davmail.logFileSize=
davmail.oauth.f.a@bc1.net.refreshToken={AES}olKP+uJU7H0lHESD18EBnIKkBwvAcmOT0eoHzbN0CH2Jv/c1myQlKb6+4xVhOEx6edklhCtiJ6vqR6ezR77pDgwTlZaT0ajMrTAYV/b1ZaMRQfGhIJeWjO+1lXgdijdSudVy3oZ5NAzfmO/nkD72LKQM8H5qBmnoiykF3Kp6U0OkxFJJOkHr58trdNsjIggWwfm83dcQfKAcdB8n2x+gDdbJnrKkfkdF82dV/nrDq5BVr8qenc9ubXz6S8HSOb15SEbM9SDfjrnr3wO3XOhVnCPMGDnfKi9eAC50PeIAi6IY0w0t01ACJNreHZ/5H15kWfLV2rKPLhw/e7NS+YW4zl9ypItsz5c/dW6i8bvYBeflho4lKWs9eoFxbfsz5iFno6x7tlwBHNFp3uayIUNkUBcr95DB0iFEra4gxNadJMoWg2qhnXtKiAtPtF5xFtLTlU8/cvkrH6AieGkymmbWuNOCHiQwXQ/eOfGZN3huvO1bqsrRqzMM/LIQEDUikiIu7gAC/1xoI3CyQ5sFJKCTWP4j8JvOzwB4vEjmS3qsExqbgfBeiNPkMhy92RsxdkvaFehMNuVPFSle0KsD4RCwGjNtkj8RDU2oHjgbLdXl7mt0rosdP/VUfQXADmIuLzgJEm01Zq4GyUka39MDaxP5IMaq9oHnjVXfz1iR1+4cHmZovJk72Zg4EvMrj6fQcfXqZqThkgPc7lIWNLVlwHnbTP4637iUKF/+nNmQaueeusWIN8jsEwoharFPm6OtOtRnYn+BjIdutsn5LlQ4K1kcK2GQdl8XtVolkj9uyT8cRw+/v3gk/bH6NuV7y4yFNVTSipyIKkk/R7ukIgcn1wJZoDXQcLBHU06+gqKZ4QezLrkoyeLdr283KRHhEm5rjUq0Zr7902/GziqAV1hWFemgDZmxCrIfGe3aHYWg5zqOzTRXzQ7cxL68cCVpY8UAZZMPBw9YUefG0E0MpG7r/3weHilmGuysxqp3l+NNqFmCjJprU+i7JeeJoxKgr046hSeU9mcg8lKmN+zCW1gUzSvQ8/bJkIplIVrUzRvWTvVUVm4RdvMJX0WjmQwxY6uudliEhqFbb77xfx9/id0cg6udPg/QMBMP6RM9lKgmyiHHxQTDXgqtz2P4t/V6P5HMa2UluA8J2ugIdgxyNOyOewrfjRBGzY3WSTaQU4ZwJ56MlaQc4BCFXUXeXuT/Qu7KUW0SWntxxsHvKHnL83Mavzeixw==
davmail.mode=O365Interactive
davmail.smtpSaveInSent=true
davmail.bindAddress=
davmail.ssl.nosecurepop=false
davmail.ssl.pkcs11Library=C:\Windows\System32\cardos11_64.dll
log4j.rootLogger=DEBUG
davmail.ssl.keystoreFile=
log4j.logger.davmail=DEBUG
davmail.clientSoTimeout=
davmail.ssl.clientKeystoreType=PKCS11
davmail.ssl.clientKeystorePass=
davmail.imapPort=1143
davmail.ssl.pkcs11Config=
davmail.url=https://outlook.office365.com/EWS/Exchange.asmx
log4j.logger.org.apache.http.conn.ssl=DEBUG
davmail.sentKeepDelay=90
davmail.ssl.nosecureldap=false
davmail.imapAlwaysApproxMsgSize=false
davmail.ssl.nosecurecaldav=false
davmail.popPort=1110
davmail.defaultDomain=
davmail.showStartupBanner=true
davmail.proxyHost=193.56.47.8
davmail.ldapPort=1389
davmail.disableGuiNotifications=false
davmail.server.certificate.hash=99:3C:A7:74:5A:E1:86:00:A2:CA:20:40:E3:B3:D9:EF:E8:69:3B:03
log4j.logger.org.apache.http.wire=DEBUG
davmail.imapIdleDelay=
davmail.allowRemote=false
davmail.disableUpdateCheck=false
log4j.logger.org.apache.http=DEBUG
davmail.caldavPort=1080
davmail.enableKeepAlive=false
davmail.ssl.clientKeystoreFile=
davmail.logFilePath=
davmail.carddavReadPhoto=true
davmail.keepDelay=30
davmail.oauth.redirectUri=
davmail.caldavAlarmSound=

Could you please help me reconfiguring davmail ?
Could you please explain (or show me a link to the explainations) of all the davmail parameters
(or at least those that are mandatory)
Where does the davmail.server.certificate.hash come from ?
Should I change it ? With which data ?

Thank you in advance.
Frédéric

Discussion

  • Frédéric ANDREANI

    Hello,
    Could you rename the title of this ticket #415
    "How to reconfigure Davmail after address change (2FA - Apache exception)" ?

    I realise I copied the former .davmail.properties.
    The one I (try to) use now is attached to this post.

    I've installer Java JRE 1.8.1-391 and DAVmail 6.2.0-3464.
    It doesn't seem to have effect : still have
    ERROR [PopConnection-63888] davmail.exchange.ExchangeSession - Connect exception: org.apache.http.conn.ConnectTimeoutException Connect to 193.56.47.8:8080 [/193.56.47.8] failed: connect timed out

    2023-11-23 19:30:14,906 DEBUG [main] davmail.DavGateway - Start DavMail in GUI mode
    2023-11-23 19:30:14,957 DEBUG [main] davmail - OS Name: Windows 10 Java version: 1.8.0_391 64 System tray supported
    2023-11-23 19:30:14,957 INFO [main] davmail - O365Interactive is not compatible with SWT, do not try to create SWT tray
    2023-11-23 19:30:14,989 INFO [main] davmail - DavMail Gateway 6.2.0-3464 listening on SMTP port 18025 POP port 18110 IMAP port 18143 CALDAV port 18080 LDAP port 18389
    2023-11-23 19:30:15,111 DEBUG [CheckRelease] davmail.http.HttpClientAdapter - GET https://davmail.sourceforge.net/version.txt
    2023-11-23 19:30:25,160 DEBUG [CheckRelease] davmail - Unable to get released version
    2023-11-23 19:30:32,299 DEBUG [davmail.pop.PopServer] davmail - Connection from /127.0.0.1 on port 18110
    2023-11-23 19:30:32,303 INFO [davmail.pop.PopServer] davmail.connection - CONNECT - 127.0.0.1:63888
    2023-11-23 19:30:35,926 DEBUG [davmail.pop.PopServer] davmail - Connection from /127.0.0.1 on port 18110
    2023-11-23 19:30:35,927 INFO [davmail.pop.PopServer] davmail.connection - CONNECT - 127.0.0.1:63893
    2023-11-23 19:30:42,619 ERROR [PopConnection-63888] davmail.exchange.ExchangeSession - Connect exception: org.apache.http.conn.ConnectTimeoutException Connect to 193.56.47.8:8080 [/193.56.47.8] failed: connect timed out
    2023-11-23 19:30:42,620 ERROR [PopConnection-63888] davmail - DavMail configuration exception:
    Connect exception: org.apache.http.conn.ConnectTimeoutException Connect to 193.56.47.8:8080 [/193.56.47.8] failed: connect timed out
    davmail.exception.DavMailException: DavMail configuration exception:
    Connect exception: org.apache.http.conn.ConnectTimeoutException Connect to 193.56.47.8:8080 [/193.56.47.8] failed: connect timed out
    at davmail.exchange.ExchangeSessionFactory.handleNetworkDown(ExchangeSessionFactory.java:347)
    at davmail.exchange.ExchangeSessionFactory.checkConfig(ExchangeSessionFactory.java:324)
    at davmail.pop.PopConnection.run(PopConnection.java:98)

    Thank you tu help me.

    fredrevel

     
  • Frédéric ANDREANI

        I find odd that calling davmail.http.HttpClientAdapter - GET https://davmail.sourceforge.net/version.txt returns davmail - Unable to get released version as writing "http://davmail.sourceforge.net/version.txt" in a navigator gets "6.2.0-3464"
    
     
  • Frédéric ANDREANI

    Reading davmail.log, jst after launching it,
    I find odd that calling davmail.http.HttpClientAdapter - GET https://davmail.sourceforge.net/version.txt
    returns davmail - Unable to get released version
    whereas writing "http://davmail.sourceforge.net/version.txt" in a navigator
    returns "6.2.0-3464"

    I have a colleague who did not change yet the company configuration.
    Davmail works fine although it seems that we have the same installed software versions and .davmail.properties.
    Launching Davmail traces are (in 3 seconds)
    DEBUG [CheckRelease] davmail.http.HttpClientAdapter - GET
    https://davmail.sourceforge.net/version.txt
    DEBUG [CheckRelease] davmail.http.DavGatewaySSLSocketFactory - createSocket davmail.sourceforge.net 443
    DEBUG [CheckRelease] davmail.DavGateway - DavMail released version: 6.2.0-3464

    For me :
    Launching Davmail traces are (in 10 seconds)
    DEBUG [CheckRelease] davmail.http.HttpClientAdapter - GET
    https://davmail.sourceforge.net/version.txt
    DEBUG [CheckRelease] davmail.DavGateway - DavMail released version: 6.2.0-3464

    The second line "DEBUG [CheckRelease] davmail.http.DavGatewaySSLSocketFactory - createSocket davmail.sourceforge.net 443" is missing.

    I see traces for my colleague : davmail.http.DavGatewaySSLSocketFactory is called several times, and must work !

    Could you please help debugging my configuration ?
    What should I start with ?

    Thank you

     
  • Frédéric ANDREANI

    I changed davmail config to get more traces (all levels for httpClient traces.
    Now I have DEBUG [CheckRelease] traces as follows :
    davmail.http.HttpClientAdapter - GET https://davmail.sourceforge.net/version.txt
    org.apache.http.client.protocol.RequestAddCookies - CookieSpec selected: default
    org.apache.http.client.protocol.RequestAuthCache - Auth cache not set in the context
    org.apache.http.impl.conn.BasicHttpClientConnectionManager - Get connection for route {tls}->http://193.56.47.8:8080->https://davmail.sourceforge.net:443
    org.apache.http.impl.conn.DefaultManagedHttpClientConnection - http-outgoing-0: set socket timeout to 0
    org.apache.http.impl.execchain.MainClientExec - Opening connection {tls}->http://193.56.47.8:8080->https://davmail.sourceforge.net:443
    org.apache.http.impl.conn.DefaultHttpClientConnectionOperator - Connecting to /193.56.47.8:8080
    org.apache.http.impl.conn.DefaultManagedHttpClientConnection - http-outgoing-0: Shutdown connection
    org.apache.http.impl.execchain.MainClientExec - Connection discarded
    org.apache.http.impl.conn.BasicHttpClientConnectionManager - Releasing connection [Not bound]
    davmail - Unable to get released version

    What should I do to correct... what ?

     
  • Frédéric ANDREANI

    Hello,
    I've been given half of a solution which allows connecting to my mailbox but only out of the office network. This is not enough yet, but I can synchronize at home ;-)
    I had to use the following settings in davmail.properties :
    davmail.enableProxy=false
    davmail.enableEws=true
    davmail.oauth.clientId=d3590ed6-52b3-4102-aeff-aad2292ab01c
    davmail.oauth.redirectUri=urn:ietf:wg:oauth:2.0:oob

    I don't what these settings stand for, specially the last 3 ones.
    Specially, I don't see enableEws inside the davmail configuration MMI, which means that we can't fix it with the conf MMI.
    I post my davmail properties, If ever it interests someone...

     

    Last edit: Frédéric ANDREANI 2024-01-26

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.