![让 Thunderbird 在 Kubuntu 18.04 中与 DavMail 配合使用](https://linux22.com/image/1007487/%E8%AE%A9%20Thunderbird%20%E5%9C%A8%20Kubuntu%2018.04%20%E4%B8%AD%E4%B8%8E%20DavMail%20%E9%85%8D%E5%90%88%E4%BD%BF%E7%94%A8.png)
我安装了 Kubuntu 18.04。我试图让 Thunderbird 与 DavMail 一起工作。
我收到此错误:
2018-05-05 13:16:15,487 DEBUG [CaldavConnection-36714] httpclient.wire.header - >> "GET /EWS/Exchange.asmx HTTP/1.1[\r][\n]"
2018-05-05 13:16:15,487 DEBUG [CaldavConnection-36714] org.apache.commons.httpclient.HttpConnection - enter HttpConnection.print(String)
2018-05-05 13:16:15,488 DEBUG [CaldavConnection-36714] org.apache.commons.httpclient.HttpConnection - enter HttpConnection.write(byte[])
2018-05-05 13:16:15,488 DEBUG [CaldavConnection-36714] org.apache.commons.httpclient.HttpConnection - enter HttpConnection.write(byte[], int, int)
2018-05-05 13:16:15,488 DEBUG [CaldavConnection-36714] org.apache.commons.httpclient.HttpMethodBase - enter HttpMethodBase.writeRequestHeaders(HttpState,HttpConnection)
2018-05-05 13:16:15,488 DEBUG [CaldavConnection-36714] org.apache.commons.httpclient.HttpMethodBase - enter HttpMethodBase.addRequestHeaders(HttpState, HttpConnection)
2018-05-05 13:16:15,488 DEBUG [CaldavConnection-36714] org.apache.commons.httpclient.HttpMethodBase - enter HttpMethodBase.addUserAgentRequestHeaders(HttpState, HttpConnection)
2018-05-05 13:16:15,488 DEBUG [CaldavConnection-36714] org.apache.commons.httpclient.HttpMethodBase - enter HttpMethodBase.addHostRequestHeader(HttpState, HttpConnection)
2018-05-05 13:16:15,488 DEBUG [CaldavConnection-36714] org.apache.commons.httpclient.HttpMethodBase - Adding Host request header
2018-05-05 13:16:15,488 DEBUG [CaldavConnection-36714] org.apache.commons.httpclient.HttpMethodBase - enter HttpMethodBase.addCookieRequestHeader(HttpState, HttpConnection)
2018-05-05 13:16:15,488 DEBUG [CaldavConnection-36714] org.apache.commons.httpclient.HttpState - enter HttpState.getCookies()
2018-05-05 13:16:15,488 DEBUG [CaldavConnection-36714] org.apache.commons.httpclient.cookie.CookieSpec - enter CookieSpecBase.match(String, int, String, boolean, Cookie[])
2018-05-05 13:16:15,488 DEBUG [CaldavConnection-36714] org.apache.commons.httpclient.HttpMethodBase - enter HttpMethodBase.addProxyConnectionHeader(HttpState, HttpConnection)
2018-05-05 13:16:15,488 DEBUG [CaldavConnection-36714] httpclient.wire.header - >> "User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0)[\r][\n]"
2018-05-05 13:16:15,488 DEBUG [CaldavConnection-36714] org.apache.commons.httpclient.HttpConnection - enter HttpConnection.print(String)
2018-05-05 13:16:15,488 DEBUG [CaldavConnection-36714] org.apache.commons.httpclient.HttpConnection - enter HttpConnection.write(byte[])
2018-05-05 13:16:15,488 DEBUG [CaldavConnection-36714] org.apache.commons.httpclient.HttpConnection - enter HttpConnection.write(byte[], int, int)
2018-05-05 13:16:15,488 DEBUG [CaldavConnection-36714] httpclient.wire.header - >> "Host: outlook.office365.com[\r][\n]"
2018-05-05 13:16:15,488 DEBUG [CaldavConnection-36714] org.apache.commons.httpclient.HttpConnection - enter HttpConnection.print(String)
2018-05-05 13:16:15,488 DEBUG [CaldavConnection-36714] org.apache.commons.httpclient.HttpConnection - enter HttpConnection.write(byte[])
2018-05-05 13:16:15,488 DEBUG [CaldavConnection-36714] org.apache.commons.httpclient.HttpConnection - enter HttpConnection.write(byte[], int, int)
2018-05-05 13:16:15,488 DEBUG [CaldavConnection-36714] org.apache.commons.httpclient.HttpConnection - enter HttpConnection.writeLine()
2018-05-05 13:16:15,489 DEBUG [CaldavConnection-36714] org.apache.commons.httpclient.HttpConnection - enter HttpConnection.write(byte[])
2018-05-05 13:16:15,489 DEBUG [CaldavConnection-36714] org.apache.commons.httpclient.HttpConnection - enter HttpConnection.write(byte[], int, int)
2018-05-05 13:16:15,489 DEBUG [CaldavConnection-36714] httpclient.wire.header - >> "[\r][\n]"
2018-05-05 13:16:15,489 DEBUG [CaldavConnection-36714] org.apache.commons.httpclient.HttpConnection - enter HttpConnection.flushRequestOutputStream()
2018-05-05 13:16:15,727 DEBUG [CaldavConnection-36714] org.apache.commons.httpclient.HttpMethodDirector - Closing the connection.
2018-05-05 13:16:15,727 DEBUG [CaldavConnection-36714] org.apache.commons.httpclient.HttpConnection - enter HttpConnection.close()
2018-05-05 13:16:15,728 DEBUG [CaldavConnection-36714] org.apache.commons.httpclient.HttpConnection - enter HttpConnection.closeSockedAndStreams()
2018-05-05 13:16:15,728 DEBUG [CaldavConnection-36714] org.apache.commons.httpclient.HttpConnection - Exception caught when closing output
javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
**************
cat .davmail.properties
#DavMail settings
#Sat May 05 13:15:37 SAST 2018
davmail.carddavReadPhoto=true
davmail.clientSoTimeout=
davmail.popPort=1110
davmail.disableUpdateCheck=false
davmail.enableProxy=false
davmail.logFileSize=
davmail.ssl.clientKeystorePass=changeit
davmail.ssl.nosecurecaldav=false
davmail.imapAlwaysApproxMsgSize=false
log4j.logger.org.apache.commons.httpclient=DEBUG
davmail.imapPort=1143
davmail.ssl.keystoreType=
davmail.enableKerberos=false
davmail.noProxyFor=
davmail.ssl.clientKeystoreFile=/etc/ssl/certs/java/cacerts
davmail.proxyPassword=
davmail.caldavAlarmSound=
davmail.useSystemProxies=true
davmail.ssl.nosecureldap=false
davmail.folderSizeLimit=
davmail.ssl.nosecurepop=false
davmail.smtpPort=1025
davmail.sentKeepDelay=90
davmail.disableGuiNotifications=false
davmail.imapAutoExpunge=true
davmail.allowRemote=false
davmail.enableKeepAlive=false
davmail.proxyUser=
davmail.defaultDomain=
davmail.bindAddress=
davmail.imapIdleDelay=
davmail.ssl.keystorePass=
davmail.server.certificate.hash=
davmail.caldavPort=1080
davmail.ssl.pkcs11Config=
davmail.showStartupBanner=true
davmail.ssl.clientKeystoreType=
davmail.smtpSaveInSent=true
davmail.keepDelay=30
davmail.ssl.keystoreFile=
davmail.url=https\://outlook.office365.com/EWS/Exchange.asmx
davmail.caldavEditNotifications=false
davmail.enableEws=true
davmail.logFilePath=/var/log/davmail.log
davmail.forceActiveSyncUpdate=false
davmail.caldavPastDelay=90
davmail.proxyHost=
davmail.ssl.keyPass=
davmail.ldapPort=1389
davmail.server=false
davmail.caldavAutoSchedule=true
davmail.popMarkReadOnRetr=false
davmail.proxyPort=
davmail.ssl.nosecuresmtp=false
log4j.logger.httpclient.wire=DEBUG
davmail.ssl.pkcs11Library=
log4j.rootLogger=DEBUG
davmail.ssl.nosecureimap=false
log4j.logger.davmail=DEBUG
From forum I read - it seems to be related to the keystore - /etc/ssl/certs/java/cacerts
SO I tried:
1) sudo update-ca-certificates -f
2) sudo /var/lib/dpkg/info/ca-certificates-java.postinst configure
3) openssl s_client -connect outlook.office365.com:443 < /dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > public.crt
4) sudo /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/keytool -import -alias outlook.office365.com -keystore /etc/ssl/certs/java/cacerts -file public.crt
Output: keytool error: java.lang.Exception: Certificate not imported, alias <outlook.office365.com> already exists
所以我迷路了。
答案1
最后,我找到了解决方法,复制并替换这些目录
/usr/lib/jvm/java-8-openjdk-amd64/jre
/usr/share/davmail/
从另一台工作机器 Ubuntu 18.04 到 Kubuntu 18.04,删除所有 java 并安装 openjdk-8-jre