Thunderbird Nextcloud



Manage Nextcloud using the helper script¶

  1. Thunderbird Nextcloud Kontakte
  2. Thunderbird Nextcloud Calendar

Login to Nextcloud, go to Contacts and click on “Settings” icon at the bottom-left corner and click on “More settings” icon and choose Copy Link. In order to synchronize your contacts with Thunderbird, you have to download the SOGo Connector Addon. Download the newest.xpi-File and install it in Thunderbird via Tools Addons. As an added bonus, if you configure the add-on to do bi-directional syncing, any contact you add to that Thunderbird address book will automatically sync with Google Contacts. That's a win-win for.

Nextcloud can be set up (parameter -i) and removed (parameter -p) with the helper script included with mailcow. In order to install Nextcloud simply navigate to your mailcow-dockerized root folder and run the helper script as follows:

./helper-scripts/nextcloud.sh -i

In case you have forgotten the password (e.g. for admin) and can't request a new one via the password reset link on the login screen calling the helper script with -r as parameter allows you to set a new password. Only use this option if your Nextcloud isn't configured to use mailcow for authentication as described in the next section.

Configure Nextcloud to use mailcow for authentication¶

The following describes how set up authentication via mailcow using the OAuth2 protocol. We will only assume that you have already set up Nextcloud at cloud.example.com and that your mailcow is running at mail.example.com. It does not matter if your Nextcloud is running on a different server, you can still use mailcow for authentication.

1. Log into mailcow as administrator.

2. Scroll down to OAuth2 Apps and click the Add button. Specify the redirect URI as https://cloud.example.com/index.php/apps/sociallogin/custom_oauth2/Mailcow and click Add. Save the client ID and secret for later.

Info

Some installations, including those setup using the helper script of mailcow, need to remove index.php/ from the URL to get a successful redirect: https://cloud.example.com/apps/sociallogin/custom_oauth2/Mailcow

3. Log into Nextcloud as administrator.

Thunderbird nextcloud kontakte

4. Click the button in the top right corner and select Apps. Click the search button in the toolbar, search for the Social Login plugin and click Download and enable next to it.

5. Click the button in the top right corner and select Settings. Scroll down to the Administration section on the left and click Social login.

6. Uncheck the following items:

  • 'Disable auto create new users'
  • 'Allow users to connect social logins with their accounts'
  • 'Do not prune not available user groups on login'
  • 'Automatically create groups if they do not exists'
  • 'Restrict login for users without mapped groups'

7. Check the following items:

  • 'Prevent creating an account if the email address exists in another account'
  • 'Update user profile every login'
  • 'Disable notify admins about new users'

Click the Save button.

8. Scroll down to Custom OAuth2 and click the + button.9. Configure the parameters as follows:

  • Internal name: Mailcow
  • Title: Mailcow
  • API Base URL: https://mail.example.com
  • Authorize URL: https://mail.example.com/oauth/authorize
  • Token URL: https://mail.example.com/oauth/token
  • Profile URL: https://mail.example.com/oauth/profile
  • Logout URL: (leave blank)
  • Client ID: (what you obtained in step 1)
  • Client Secret: (what you obtained in step 1)
  • Scope: profile

Click the Save button at the very bottom of the page.

If you have previously used Nextcloud with mailcow authentication via user_external/IMAP, you need to perform some additional steps to link your existing user accounts with OAuth2.

1. Click the button in the top right corner and select Apps. Scroll down to the External user authentication app and click Remove next to it.2. Run the following queries in your Nextcloud database (if you set up Nextcloud using mailcow's script, you can run source mailcow.conf && docker-compose exec mysql-mailcow mysql -u$DBUSER -p$DBPASS $DBNAME):

If you have previously used Nextcloud without mailcow authentication, but with the same usernames as mailcow, you can also link your existing user accounts with OAuth2.

1. Run the following queries in your Nextcloud database (if you set up Nextcloud using mailcow's script, you can run source mailcow.conf && docker-compose exec mysql-mailcow mysql -u$DBUSER -p$DBPASS $DBNAME):

Update¶

The Nextcloud instance can be updated easily with the web update mechanism. In the case of larger updates, there may be further changes to be made after the update. After the Nextcloud instance has been checked, problems are shown. This can be e.g. missing indices in the DB or similar.It shows which commands have to be executed, these have to be placed in the php-fpm-mailcow container.

As an an example run the following command to add the missing indices.docker exec -it -u www-data $(docker ps -f name=php-fpm-mailcow -q) bash -c 'php /web/nextcloud/occ db:add-missing-indices'

Debugging & Troubleshooting¶

It may happen that you cannot reach the Nextcloud instance from your network. This may be due to the fact that the entry of your subnet in the array 'trusted_proxies' is missing. You can make changes in the Nextcloud config.php in data/web/nextcloud/config/*.

Thunderbird Nextcloud

After the changes have been made, the nginx container must be restarted.docker-compose restart nginx-mailcow Visual studio code cmake.

Nextcloud is a PHP-based server software to access, share and protect your files, calendars, contacts, communication & more at home and in your enterprise.

DAVx⁵ is integrated with the Nextcloud app for Android. You can use it to set up DAVx⁵ without having to enter a base URL:

  1. Install the Nextcloud app for Android.
  2. Open the Settings of the Nextcloud app.
  3. DAVx⁵ will open with Nextcloud Login Flow.
  4. Continue DAVx⁵ setup as usual (see below).

DAVx⁵ settings

Thunderbird Nextcloud Kontakte

Base URL:/remote.php/dav (for instance: https://example.com/nextcloud/remote.php/dav)

Contact group method: groups are per-contact categories (other methods are supported on server side, but the Contacts Nextcloud app only uses CATEGORIES at the moment)

Thunderbird Nextcloud Calendar

User name and password: Nextcloud account password or device-specific password. If you're using two-factor authentication, you have to generate and use a device-specific password for DAVx⁵.