lieser / dkim_verifier

DKIM Verifier Extension for Mozilla Thunderbird
MIT License
213 stars 36 forks source link

Expose settings toggles to about:config #267

Closed klou closed 3 years ago

klou commented 3 years ago

Is it possible to expose and make settings configurable via about:config?

Then I could change some defaults for systemwide deployment (I'd like to enable reading Authentication-Results headers by default).

lieser commented 3 years ago

Unfortunately it is no longer really intended that add-on get direct access (and use) about:config.

But the add-on currently has code in it to migrate the setting from older version (< 4.0.0), which did use about:config for its settings. If the add-on will get newly installed, and has not yet settings in the new storage, you could try to misuse this migration code.

For the the ARH reading, you would need to create a Boolean setting with the name extensions.dkim_verifier.arh.read and value true.

For testing, not that uninstalling the add-on, and then restarting Thunderbird should clear the used storage (storage.local).

And do I understand you correctly that you would like to deploy the add-on in e.g. a company?

I know Firefox can now be configured via a policy file (https://support.mozilla.org/en-US/products/firefox-enterprise/policies-customization-enterprise/policies-overview-enterprise), and support for it can be added in add-ons (https://extensionworkshop.com/documentation/enterprise/adding-policy-support-to-your-extension/).

I do not know if this is also supported in Thunderbird, but would that maybe something useful for you (or others)? Thought I do not know when I would find some time to implement support for it (if supported by Thunderbird at all).

klou commented 3 years ago

Thank you for the info and the workaround.

I already use both policies.json and also Thunderbird Autoconfig. Unfortunately I couldn't get it to work when setting the Preference directly (though extensions.* should be working) in policies.json.

However, it worked when I added pref("extensions.dkim_verifier.arh.read", true); to my autoconfig file.

I'll probably make this defaultPref, though I really want to figure out why it wouldn't work in the policy file.

Side note: I really appreciate your work on this addon. DKIM/SPF info should really be part of vanilla TB.

klou commented 3 years ago

Sample policies.json for deploying with some company-related restrictions. I disable update checks and deploy the XPI to the local file system.

{
  "policies": {
    "DisableAppUpdate": true,
    "DisableTelemetry": true,
    "ExtensionUpdate": false,
    "ExtensionSettings": {
      "*": {
        "__comment1__": "Default setting for all non-specified Extensions",
        "blocked_install_message": "This extension is explicitly disallowed.",
        "install_sources": ["about:addons","https://addons.thunderbird.net/","file:///C:/Program%20Files/Mozilla%20Thunderbird/distribution/extensions/"],
        "installation_mode": "allowed",
        "updates_disabled": false
      },
      "dkim_verifier@pl": {
        "__comment1__": "DKIM Verifier",
        "installation_mode": "normal_installed",
        "install_url": "file:///C:/Program%20Files/Mozilla%20Thunderbird/distribution/extensions/dkim_verifier@pl.xpi",
        "updates_disabled": true
      }
    },
    "Preferences": {
        "extensions.dkim_verifier.arh.read": {
        "Value": true,
        "Status": "locked"
      }

    }
  }
}

Now that I look at it, the locked setting may be causing some issues.

klou commented 3 years ago

Two issues with my policies.json:

  1. My "install_sources" key is not quite right, but it doesn't cause it to fail.
  2. Thunderbird's support for the Preferences object lags behind Firefox, so TB uses the "Preferences (deprecated)" type, which is far more restrictive and doesn't support extensions.*.

So need to set the preference with autoconfig, and it works.

lieser commented 3 years ago

Thanks for the example policies.

Note that I decided to track proper support for policies in a separated issue (#268), which you way want to subscribe too.

Do you still have any questions about the workaround, or can this be closed?

klou commented 3 years ago

Thanks for all the info. I'm good with this workaround.

And RE: adding Policies to Thunderbird -- while it would be welcome, it's also a moving target in terms of supported features. I compared policies-schema.json from both Thunderbird and Firefox to see the differences.

I think that https://github.com/jobisoft merged the most recent change into Policies -- managing extension updates. But the status of Preferences (deprecated) objects shows that it's hit or miss ...