Hello there,

it's been a long time since the last time I bothered you. Today, I have a great news for you (or maybe just for me, but, anyway...) : I solved my problem.
My solution is maybe a bit "dirty", but it works !
Here it is :
sogo-integrator/chrome/content/messenger/folders-update.js line 40 adding :

available = (xmlRequest.status != 404);
//if not available, it's maybe just not initialized.
if(!available){
var prompts = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
      .getService(Components.interfaces.nsIPromptService);
  var username = {value: sogoConfig['username']};
  var password = {value: ""};
  var check = {value: false};
  //Prompt the sogo username and password.
var result = prompts.promptUsernameAndPassword(window, "Initialisation", "Vos identifiant et mot de passe", username, password, null, check);
  if(result){
var params = "userName=" + username.value + "&password=" + password.value;

    //Send a connect request
    xmlRequest.open("POST", "https://domain.com/SOGo/connect";, true);

xmlRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xmlRequest.setRequestHeader("Content-length", params.length);
    xmlRequest.setRequestHeader("Connection", "close");
    xmlRequest.send(params);

    //Set the "right" username
    setSOGoUserName(input.value);
    this.baseURL = sogoBaseURL();

    //Retry connection
    xmlRequest.open("OPTIONS", this.baseURL + this.type, false);
    xmlRequest.send("");
    available = (xmlRequest.status != 404);
  }
}

Also, I needed the setSOGoUserName function so in sogo-integrator/chrome/content/sogo-config.js line 26
function setSOGoUserName(newName){
  sogoConfig['username'] = newName;
  //Also need to reinitialise the baseURL
  sogoConfig['baseURL'] = null;
}

And finally suppress the overlay of the dialog in sogo-integrator/chrome.manifest line 13 :

overlay chrome://global/content/commonDialog.xul chrome://sogo-integrator/content/global/common-dialog-overlay.xul

That way, the first time, if the person who is connecting will be prompted his login and password, and he isn't stuck anymore.
By the way, the other users are also unlocked.

Thanks for your help, and I hope this may be people in such a situations.

Greetings

Yvan


Le 04/04/2011 08:30 AM, Stephen Ingram a écrit :
On Fri, Apr 1, 2011 at 12:19 AM, Yvan LE BOUFFANT
<[email protected]>  wrote:
On 03/31/2011 09:29 PM, Stephen Ingram wrote:
Can you please tell me what IMAP server you are using? Are you
authenticating the IMAP server from LDAP also?

Steve
I'm not in charge of the Mail server, but I know that LDAP is not connected
to it (because of some security and availability reasons). In SOGo server
configuration, there is the (very useful) option SOGoForceIMAPLoginWithEmail
which works well, and I looked for such an option in the Integrator, but I
didn't find it. Maybe there is a method to prompt the SOGo username only the
first time ? Or, to set it in the preferences ?
Our setup we've been testing here uses common directory for IMAP and
SOGo authentication. As such, we can use SASL to obtain the
information we need using binds and directory searches. It sounds like
your mailstore (IMAP) is completely separated so you can't do that.
Also, I was in a similar situation to you, but in reverse. I wanted to
use uid for mail store and email address for SOGo. For that, I used
the file defaults/preferences/site.js in the sogo-integrator directory
and included the line:

pref("sogo-integrator.identification.use_email_address", true);

You might look into the file this is referring to
(chrome/content/sogo-config.js) and try to adjust it to fit your
requrements. Your problem is going to be more difficult to solve
though as it's not as easy for SOGo to deduce the uid.

Steve

--
[email protected]
https://inverse.ca/sogo/lists

Reply via email to