Bug 1662433 Comment 49 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Magnus, apart from the file name change (.js --> .jsm), is there anything else which could prevent enterprise users from importing this resource via MCD autoConfig? Does the long form `Components.utils` work here or they must use `Cu` instead?
```
Components.utils.import("resource:///modules/gloda/log4moz.jsm");
var log = Log4Moz.getConfiguredLogger("MCD");
```

(In reply to marinar from comment #48)
> Thank you very much. 
> Autoconfiguration is working now from local cfg and directly from remote cfg, bypassing cgi call script in the middle.
> 
> Really appreciate your help.

Most welcome, we're here to support you so that your enterprise scenarios will work well. So the .cgi was indeed part of the problem as I hinted in my comment 44.

> Note: Some older code should be removed from .cfg, otherwise Thunderbird can not read configuration file.
>      Components.utils.import("resource:///modules/gloda/log4moz.js");

Marinar, this module still exists, but the file name has changed, it's now *log4moz.js**m***.
Can you please try again with the correct file name and report back?

https://searchfox.org/comm-central/source/mailnews/db/gloda/modules/Log4moz.jsm

>      var log = Log4Moz.getConfiguredLogger("MCD");

This should still work after the file name correction to .jsm, unless if we have another permissions/API problem here. Note that the logger name is case sensitive.

https://searchfox.org/comm-central/rev/5640a40e0d1d800e461050adadc46e29bdbe3982/mailnews/db/gloda/modules/Log4moz.jsm#47-72

(In reply to Thomas D. (:thomas8) from comment #44)
> > lockPref("autoadmin.global_config_url","https://******/thunderbird.cgi");
> 
> Also, I am not sure if the .cgi in between will work, because you're asking Thunderbird to run this file and I'd think it expects javascript files only, as the example in documentation suggests
Magnus, apart from the file name change (.js --> .jsm), is there anything else which could prevent enterprise users from importing this resource via MCD AutoConfig? Does the long form `Components.utils` work here or they must use `Cu` instead?

**Thunderbird.cfg** (AutoConfig file, local or external)
```
Components.utils.import("resource:///modules/gloda/log4moz.jsm");
var log = Log4Moz.getConfiguredLogger("MCD");
```

(In reply to marinar from comment #48)
> Thank you very much. 
> Autoconfiguration is working now from local cfg and directly from remote cfg, bypassing cgi call script in the middle.
> 
> Really appreciate your help.

Most welcome, we're here to support you so that your enterprise scenarios will work well. So the .cgi was indeed part of the problem as I hinted in my comment 44.

> Note: Some older code should be removed from .cfg, otherwise Thunderbird can not read configuration file.
>      Components.utils.import("resource:///modules/gloda/log4moz.js");

Marinar, this module still exists, but the file name has changed, it's now *log4moz.js**m***.
Can you please try again with the correct file name and report back?

https://searchfox.org/comm-central/source/mailnews/db/gloda/modules/Log4moz.jsm

>      var log = Log4Moz.getConfiguredLogger("MCD");

This should still work after the file name correction to .jsm, unless if we have another permissions/API problem here. Note that the logger name is case sensitive.

https://searchfox.org/comm-central/rev/5640a40e0d1d800e461050adadc46e29bdbe3982/mailnews/db/gloda/modules/Log4moz.jsm#47-72

(In reply to Thomas D. (:thomas8) from comment #44)
> > lockPref("autoadmin.global_config_url","https://******/thunderbird.cgi");
> 
> Also, I am not sure if the .cgi in between will work, because you're asking Thunderbird to run this file and I'd think it expects javascript files only, as the example in documentation suggests

Back to Bug 1662433 Comment 49