How to Set a Default Nextcloud Server URL for Thunderbird Users

As an administrator, you can push your organization's Nextcloud server address to every Thunderbird user. Users then only need to log in with their own Nextcloud account; they do not have to type, or know, the server address.

When the policy is active:

  • The Nextcloud Server URL field on the settings page is filled in and cannot be changed.

  • The notice Managed by your organization is shown below the field.

  • Users still log in with their own Nextcloud credentials.

  • The address stays filled in after a user clicks Disconnect.

The policy uses the add-on ID thunderbird@sendent.com and the setting serverUrl. Choose the method that fits your platform.

Windows and Linux: policies.json

  1. Create a file called policies.json in Thunderbird's distribution folder. Create the folder if it does not exist.

    OS

    Path

    Windows

    C:\Program Files\Mozilla Thunderbird\distribution\policies.json

    Linux (deb/rpm)

    /usr/lib/thunderbird/distribution/policies.json

    Linux (snap)

    /snap/thunderbird/current/distribution/policies.json

  2. Add the following content, and replace https://cloud.example.com with the address of your Nextcloud server:

    {
    "policies": {
    "3rdparty": {
    "Extensions": {
    "thunderbird@sendent.com": {
    "serverUrl": "https://cloud.example.com"
    }
    }
    }
    }
    }
  3. Save the file as UTF-8 and restart Thunderbird completely (close all windows).

If you already have a policies.json, add the 3rdparty section to it instead of creating a second file. Each Thunderbird installation needs its own file.

Install the add-on and set the server URL in one file

You can combine this policy with the policy that installs the add-on (see How to Install Nextcloud for Thunderbird):

{
"policies": {
"ExtensionSettings": {
"thunderbird@sendent.com": {
"installation_mode": "force_installed",
"install_url": "https://addons.thunderbird.net/thunderbird/downloads/latest/nextcloud-for-thunderbird/latest.xpi"
}
},
"3rdparty": {
"Extensions": {
"thunderbird@sendent.com": {
"serverUrl": "https://cloud.example.com"
}
}
}
}
}

Windows: Group Policy (registry)

For domain-joined Windows computers you can set the policy in the registry instead:

  1. Create the registry key:
    HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Mozilla\Thunderbird\3rdparty\Extensions\thunderbird@sendent.com

  2. Add a string value (REG_SZ) named serverUrl with your Nextcloud address as its data, for example https://cloud.example.com.

To roll this out with Group Policy: open the Group Policy Management Console, edit a GPO linked to the right OU, go to Computer Configuration > Preferences > Windows Settings > Registry, and create a registry item with the key and value above.

If both the registry and policies.json contain a policy, the registry policy is used.

macOS: preferences or configuration profile

On macOS, Thunderbird reads policies from the preferences domain org.mozilla.thunderbird. Do not place a policies.json inside Thunderbird.app: macOS blocks changes to the app, and a Thunderbird update would remove the file.

Single Mac (Terminal)

Run these commands, replacing https://cloud.example.com with your Nextcloud address:

sudo defaults write /Library/Preferences/org.mozilla.thunderbird EnterprisePoliciesEnabled -bool TRUE
sudo defaults write /Library/Preferences/org.mozilla.thunderbird 3rdparty '{ Extensions = { "thunderbird@sendent.com" = { serverUrl = "https://cloud.example.com"; }; }; }'

Then quit Thunderbird completely (⌘Q) and open it again.

Managed Macs (MDM)

With an MDM solution such as Jamf, Intune or Kandji, deploy a configuration profile with a custom settings payload for the preference domain org.mozilla.thunderbird containing:

<key>EnterprisePoliciesEnabled</key>
<true/>
<key>3rdparty</key>
<dict>
<key>Extensions</key>
<dict>
<key>thunderbird@sendent.com</key>
<dict>
<key>serverUrl</key>
<string>https://cloud.example.com</string>
</dict>
</dict>
</dict>

Check that the policy works

  1. Restart Thunderbird completely.

  2. Open the add-on's settings page (see How to Connect Nextcloud for Thunderbird to Nextcloud).

  3. The Nextcloud Server URL field shows your address, is greyed out, and has the notice Managed by your organization below it.

Troubleshooting

  • The field is empty or can still be edited. On Windows and Linux, check that policies.json is in the correct distribution folder, is valid JSON (no trailing commas) and is saved as UTF-8. On macOS, check that EnterprisePoliciesEnabled is set to true. Then restart Thunderbird completely. Errors are shown in Tools > Developer Tools > Error Console.

  • A user is already connected to another server. The policy only affects the login form. The user must click Disconnect first; the managed address then appears in the field.

  • Linux Flatpak. The Flatpak version of Thunderbird does not read this distribution folder. Use Thunderbird's AutoConfig instead.


Was this article helpful?