Skip to content

Releases: Zimbra/zm-nextcloud-extension

Adding nextcloud_zimlet_zimbra_hostname_override

22 Jan 14:33
Compare
Choose a tag to compare

Troubleshooting saving email/attachments from Zimbra to Nextcloud

In a rare case a partner that had experienced issues upgrading Zimbra Proxy from Zimbra 8 to 10, later on had issues saving emails/attachments from Zimbra to Nextcloud. In addition the partner relies on alias domains.

Every time an attachment or email is stored into Nextcloud, there will be a log line in the Zimbra mailbox log. You can find the relevant logs by running a tail on the log file while trying to save to Nextcloud:

tail -f /opt/zimbra/log/mailbox.log | grep -i nextcloud

An example log would look like this:

2024-01-22 15:15:10,010 INFO  [qtp921760190-146:https://zimbra10.barrydegraaff.nl:8443/service/soap/ModifyDataSourceRequest] [name=admin@barrydegraaff.nl;mid=2;ip=192.168.1.98;port=43892;ua=zclient/10.0.6_GA_4585;soapId=2fbf73d2;] datasource - Updating schedule for data source info@barrydegraaff.tk-noop-nextcloud
2024-01-22 15:15:13,879 INFO  [qtp921760190-144:https://zimbra10.barrydegraaff.nl/service/extension/nextcloud] [] extensions - Refresh token :E8CBrO4Dl4U7YmG0uTSofSIYEPtmRD9MmcWNPkeQjwIsBBlOd77L6v0rM6lNusgCiWRUxJR6 zimbra10.barrydegraaff.nl
2024-01-22 15:15:15,636 INFO  [qtp921760190-143:https://zimbra10.barrydegraaff.nl/service/extension/nextcloud] [] extensions - Refresh token :4XoqkZcggorUVvy768zTzEtTmXAfPdP4qPKfhkTYbKrzPIX7SBdyShoKTixB9Rzr11BT9ONK zimbra10.barrydegraaff.nl
2024-01-22 15:15:15,639 INFO  [qtp921760190-143:https://zimbra10.barrydegraaff.nl/service/extension/nextcloud] [] extensions - PUT action
2024-01-22 15:15:15,641 INFO  [qtp921760190-143:https://zimbra10.barrydegraaff.nl/service/extension/nextcloud] [] extensions - req.getServerName(): zimbra10.barrydegraaff.nl, server.getName():zimbra10.barrydegraaff.nl
2024-01-22 15:15:15,642 INFO  [qtp921760190-143:https://zimbra10.barrydegraaff.nl/service/extension/nextcloud] [] extensions - Local config nextcloud_zimlet_zimbra_hostname_override: 
2024-01-22 15:15:15,642 INFO  [qtp921760190-143:https://zimbra10.barrydegraaff.nl/service/extension/nextcloud] [] extensions - https://zimbra10.barrydegraaff.nl:8443//service/home/~/?auth=co&id=286&part=2&disp=a
2024-01-22 15:15:17,540 INFO  [qtp921760190-145:https://zimbra10.barrydegraaff.nl/service/extension/nextcloud] [] extensions - Refresh token :khsTmeamfVVe2vfzNJyA6S1DSdD9pkvQz2GB1fNK6JVI4Pvo3TrxABi4pehSieQaXTgjWiOS zimbra10.barrydegraaff.nl
2024-01-22 15:15:18,720 INFO  [qtp921760190-144:https://zimbra10.barrydegraaff.nl/service/extension/nextcloud] [] extensions - Refresh token :ql5ReuDIsSME24fL1kkiOyx1TCF85H10lBf5MDtQqmf0Ot8NEqhddffKw52kwg6AgeRd801e zimbra10.barrydegraaff.nl
2024-01-22 15:15:18,722 INFO  [qtp921760190-144:https://zimbra10.barrydegraaff.nl/service/extension/nextcloud] [] extensions - PUT action
2024-01-22 15:15:18,724 INFO  [qtp921760190-144:https://zimbra10.barrydegraaff.nl/service/extension/nextcloud] [] extensions - req.getServerName(): zimbra10.barrydegraaff.nl, server.getName():zimbra10.barrydegraaff.nl
2024-01-22 15:15:18,725 INFO  [qtp921760190-144:https://zimbra10.barrydegraaff.nl/service/extension/nextcloud] [] extensions - Local config nextcloud_zimlet_zimbra_hostname_override: 
2024-01-22 15:15:18,725 INFO  [qtp921760190-144:https://zimbra10.barrydegraaff.nl/service/extension/nextcloud] [] extensions - https://zimbra10.barrydegraaff.nl:8443/service/home/~/?auth=co&id=286&disp=a
2024-01-22 15:15:18,870 INFO  [qtp921760190-144:https://zimbra10.barrydegraaff.nl/service/extension/nextcloud] [] extensions - https://zimbra10.barrydegraaff.nl:8443//service/home/~/?auth=co&id=286&part=2&disp=a

If you look closely you will see that the URL to the items to be stored in Nextcloud are shown in the log. In this case:

Normally the mailbox server will not have issues connecting to port 8443 or having that // instead of /. However the setting of zimbraPublicServiceHostname, zimbraPublicServicePort and zimbraPublicServiceProtocol should be set correctly:

zmprov mcf zimbraPublicServiceProtocol https
zmprov mcf zimbraPublicServicePort 443
zmprov mcf zimbraPublicServiceHostname your.zimbra.example.com
zmmailboxdctl restart

You can validate your configuration using curl command:

curl -v --cookie "ZM_AUTH_TOKEN=0_0..put cookie value here.a313b" "https://zimbra10.barrydegraaff.nl:8443//service/home/~/?auth=co&id=286&part=2&disp=a" -o my.pdf
head my.pdf

You can get the ZM_AUTH_TOKEN via the browsers developer console:

If you are unable to configure Zimbra in such a way that the Nextcloud extension can fetch the email/attachments you can override the zimbraPublicServiceHostname by setting the nextcloud_zimlet_zimbra_hostname_override local config. Open the file /opt/zimbra/conf/localconfig.xml and add the following:

  <key name="nextcloud_zimlet_zimbra_hostname_override">
    <value>https://workingZimbraDomain.example.com</value>
  </key>

You can include the port number as well if needed. After adding the local config, restart mailbox using zmmailboxdctl restart.

Bugfix release 10.0.6

30 Nov 12:37
Compare
Choose a tag to compare
- Implement authentication via AuthUtil.getAuthTokenFromHttpReq

- Fix printing of exception messages
- Remove setDefaultHostnameVerifier

Adding Nextcloud Talk

15 Jul 05:16
d28bbe4
Compare
Choose a tag to compare
9.0.0.p26

Adding Nextcloud Talk

initial version

27 Jun 06:58
227330f
Compare
Choose a tag to compare
Bugfix/zcs 9728 (#1)

* ZCS-9728 Creating nextcloud package

* ZCS-9728 Creating nextcloud package

* ZCS-9728 Fixing compilation issue

* ZCS-9728 Fix build issues