priyadi / roundcube-converse.js-xmpp-plugin

XMPP plugin for Roundcube Webmail based on converse.js
48 stars 18 forks source link

A few fixes #4

Closed CyBeRoni closed 11 years ago

CyBeRoni commented 11 years ago

Hi, I made a few fixes to the plugin to make it work for me.

aacunha commented 11 years ago

I still with the same problem, with ejabberd:

PHP Notice: No JID returned for acunha in /var/www/roundcubemail-0.9.2/plugins/converse/converse.php on line 110, referer:

and with openfire: [Mon Sep 09 10:35:50 2013] [error] [client 10.12.255.242] PHP Notice: XMPP Login failed for acunha in /var/www/roundcubemail-0.9.2/plugins/converse/converse.php on line 97, referer: http://10.0.4.29/mail/

(I setup the openfire to use the same ldap of roundcube), I can login with this user on admin page of openfire.

CyBeRoni commented 11 years ago

I don't know about the first case, but the second (openfire) appears to not be authenticating successfully; that error quite specifically shows up in case a 'success' is not returned in response to authentication.

Perhaps try removing or explicitly setting the {$this->hostname} bit on line 23? It may be that the domain name is wrong for your situation and causing this error.

silvergo commented 11 years ago

I use dovecot backend. I discovered there is a specific option: auth_append_host If true, sends the bare JID as authzid.

http://code.google.com/p/prosody-modules/wiki/mod_auth_dovecot

So I'd change line 23 (back) too: return base64_encode("\0{$this->username}\0{$this->password}"); Make some tries with this option.

aacunha commented 11 years ago

Follow the ejabberd log:

[root@yoda ~]# tail -fn100 /var/log/ejabberd/ejabberd.log | grep acunha I(<0.1413.0>:ejabberd_c2s:640) : ({socket_state,ejabberd_http_bind,{http_bind,<0.1412.0>,{{127,0,0,1},59700}},ejabberd_http_bind}) Accepted authentication for acunha by ejabberd_auth_ldap

2013/9/9 silvergo notifications@github.com

I use dovecot backend. I discovered there is a specific option: auth_append_host If true, sends the bare JID as authzid.

http://code.google.com/p/prosody-modules/wiki/mod_auth_dovecot http://code.google.com/p/prosody-modules/wiki/mod_auth_dovecot

So I'd change line 23 (back) too: return base64_encode("\0{$this->username}\0{$this->password}"); Make some tries with this option.

— Reply to this email directly or view it on GitHubhttps://github.com/priyadi/roundcube-converse.js-xmpp-plugin/pull/4#issuecomment-24078183 .

Att André Cunha Analista de Tecnologia da Informação

aacunha commented 11 years ago

Can you send to me your config.inc.php?

2013/9/9 Marco Wessel notifications@github.com

I don't know about the first case, but the second (openfire) appears to not be authenticating successfully; that error quite specifically shows up in case a 'success' is not returned in response to authentication.

Perhaps try removing or explicitly setting the {$this->hostname} bit on line 23? It may be that the domain name is wrong for your situation and causing this error.

— Reply to this email directly or view it on GitHubhttps://github.com/priyadi/roundcube-converse.js-xmpp-plugin/pull/4#issuecomment-24076378 .

Att André Cunha Analista de Tecnologia da Informação

CyBeRoni commented 11 years ago

It's quite simple, all my users have the same domain name. You might look at 'converse_xmpp_hostname' in your own config for the openfire case.


<?php
// important variables in the following anonymous functions:
// $args['host'] : IMAP hostname
// $args['user'] : IMAP username
// $args['pass'] : IMAP password

// Hostname of BOSH endpoint, used for prebinding only (called by PHP),
// this must be an absolute URL
$rcmail_config['converse_xmpp_bosh_prebind_url']= function($args) {
    return 'https://webmail.mediamatic.nl:8443/http-bind/';
};

// Hostname of BOSH endpoint, used by web browsers (called by Javascript code),
// this can be a relative URL
$rcmail_config['converse_xmpp_bosh_url']= function($args) {
    return '/http-bind/';
};

// Hostname portion of XMPP username (bare JID), example: "example.net"
$rcmail_config['converse_xmpp_hostname']= function($args) {
    return 'mediamatic.nl';
    # return preg_replace('/^.*@/', '', $args['user'];
    # return $args['host'];
};

// Username portion of XMPP username (bare JID), example: "user"
// if this contains @, this will only take the part before @,
// and the part after @ will replace the hostname definition above.
$rcmail_config['converse_xmpp_username']= function($args) {
    return $args['user'];
};

// XMPP password
$rcmail_config['converse_xmpp_password']= function($args) {
    return $args['pass'];
};
CyBeRoni commented 11 years ago

Try with above patch; my test ejabberd with no real setup other than enabling bosh accepts me this way.

aacunha commented 11 years ago

My config is the same like. Follow my config.inc.php:

<?php // important variables in the following anonymous functions: // $args['host'] : IMAP hostname // $args['user'] : IMAP username // $args['pass'] : IMAP password

// Hostname of BOSH endpoint, used for prebinding only (called by PHP), // this must be an absolute URL $rcmail_config['converse_xmpp_bosh_prebind_url']= function($args) { return 'http://127.0.0.1/http-bind/';

return sprintf('http://%s/http-bind', $_SERVER['HTTP_HOST']);

    # return sprintf('http://%s/http-bind', $args['host']);

};

// Hostname of BOSH endpoint, used by web browsers (called by Javascript code), // this can be a relative URL $rcmail_config['converse_xmpp_bosh_url']= function($args) { return '/http-bind/'; };

// Hostname portion of XMPP username (bare JID), example: "example.net" $rcmail_config['converse_xmpp_hostname']= function($args) { return 'iff.edu.br';

return preg_replace('/^.*@/', '', $args['user'];

    # return $args['host'];

};

// Username portion of XMPP username (bare JID), example: "user" // if this contains @, this will only take the part before @, // and the part after @ will replace the hostname definition above. $rcmail_config['converse_xmpp_username']= function($args) { return $args['user'];

return preg_replace('/@.*$/', '', $args['user']);

};

// XMPP password $rcmail_config['converse_xmpp_password']= function($args) { return $args['pass']; };

I`m using the last patch, and the converse plugin pass the authentication on ejabberd, but dont start the session. In the pidgin i can connect.

2013/9/9 Marco Wessel notifications@github.com

Try with above patch; my test ejabberd with no real setup other than enabling bosh accepts me this way.

— Reply to this email directly or view it on GitHubhttps://github.com/priyadi/roundcube-converse.js-xmpp-plugin/pull/4#issuecomment-24117388 .

Att André Cunha Analista de Tecnologia da Informação

aacunha commented 11 years ago

What is the roundcube version you use?

Regards, André

2013/9/10 André Cunha aacunha@gmail.com

My config is the same like. Follow my config.inc.php:

<?php // important variables in the following anonymous functions: // $args['host'] : IMAP hostname // $args['user'] : IMAP username // $args['pass'] : IMAP password

// Hostname of BOSH endpoint, used for prebinding only (called by PHP), // this must be an absolute URL $rcmail_config['converse_xmpp_bosh_prebind_url']= function($args) { return 'http://127.0.0.1/http-bind/';

return sprintf('http://%s/http-bind', $_SERVER['HTTP_HOST']);

    # return sprintf('http://%s/http-bind', $args['host']);

};

// Hostname of BOSH endpoint, used by web browsers (called by Javascript code), // this can be a relative URL $rcmail_config['converse_xmpp_bosh_url']= function($args) { return '/http-bind/'; };

// Hostname portion of XMPP username (bare JID), example: "example.net" $rcmail_config['converse_xmpp_hostname']= function($args) { return 'iff.edu.br';

return preg_replace('/^.*@/', '', $args['user'];

    # return $args['host'];

};

// Username portion of XMPP username (bare JID), example: "user" // if this contains @, this will only take the part before @, // and the part after @ will replace the hostname definition above. $rcmail_config['converse_xmpp_username']= function($args) { return $args['user'];

return preg_replace('/@.*$/', '', $args['user']);

};

// XMPP password $rcmail_config['converse_xmpp_password']= function($args) { return $args['pass']; };

I`m using the last patch, and the converse plugin pass the authentication on ejabberd, but dont start the session. In the pidgin i can connect.

2013/9/9 Marco Wessel notifications@github.com

Try with above patch; my test ejabberd with no real setup other than enabling bosh accepts me this way.

— Reply to this email directly or view it on GitHubhttps://github.com/priyadi/roundcube-converse.js-xmpp-plugin/pull/4#issuecomment-24117388 .

Att André Cunha Analista de Tecnologia da Informação

Att André Cunha Analista de Tecnologia da Informação

aacunha commented 11 years ago

Hey!

I`m testing with openfire. Now i can connect, but i still "offline" on session page on openfire. With the jappix4roundcube clients can open session. captura de tela de 2013-09-10 11 47 13

Regards, André

2013/9/10 André Cunha aacunha@gmail.com

What is the roundcube version you use?

Regards, André

2013/9/10 André Cunha aacunha@gmail.com

My config is the same like. Follow my config.inc.php:

<?php // important variables in the following anonymous functions: // $args['host'] : IMAP hostname // $args['user'] : IMAP username // $args['pass'] : IMAP password

// Hostname of BOSH endpoint, used for prebinding only (called by PHP), // this must be an absolute URL $rcmail_config['converse_xmpp_bosh_prebind_url']= function($args) { return 'http://127.0.0.1/http-bind/';

return sprintf('http://%s/http-bind', $_SERVER['HTTP_HOST']);

    # return sprintf('http://%s/http-bind', $args['host']);

};

// Hostname of BOSH endpoint, used by web browsers (called by Javascript code), // this can be a relative URL $rcmail_config['converse_xmpp_bosh_url']= function($args) { return '/http-bind/'; };

// Hostname portion of XMPP username (bare JID), example: "example.net" $rcmail_config['converse_xmpp_hostname']= function($args) { return 'iff.edu.br';

return preg_replace('/^.*@/', '', $args['user'];

    # return $args['host'];

};

// Username portion of XMPP username (bare JID), example: "user" // if this contains @, this will only take the part before @, // and the part after @ will replace the hostname definition above. $rcmail_config['converse_xmpp_username']= function($args) { return $args['user'];

return preg_replace('/@.*$/', '', $args['user']);

};

// XMPP password $rcmail_config['converse_xmpp_password']= function($args) { return $args['pass']; };

I`m using the last patch, and the converse plugin pass the authentication on ejabberd, but dont start the session. In the pidgin i can connect.

2013/9/9 Marco Wessel notifications@github.com

Try with above patch; my test ejabberd with no real setup other than enabling bosh accepts me this way.

— Reply to this email directly or view it on GitHubhttps://github.com/priyadi/roundcube-converse.js-xmpp-plugin/pull/4#issuecomment-24117388 .

Att André Cunha Analista de Tecnologia da Informação

Att André Cunha Analista de Tecnologia da Informação

Att André Cunha Analista de Tecnologia da Informação

aacunha commented 11 years ago

I see this error on openfire logs:

2013.09.10 12:22:37 org.jivesoftware.openfire.http.HttpBindServlet - Client provided invalid session: 2938f624. [200.143.198.114]

2013/9/10 André Cunha aacunha@gmail.com

Hey!

I`m testing with openfire. Now i can connect, but i still "offline" on session page on openfire. With the jappix4roundcube clients can open session.

Regards, André

2013/9/10 André Cunha aacunha@gmail.com

What is the roundcube version you use?

Regards, André

2013/9/10 André Cunha aacunha@gmail.com

My config is the same like. Follow my config.inc.php:

<?php // important variables in the following anonymous functions: // $args['host'] : IMAP hostname // $args['user'] : IMAP username // $args['pass'] : IMAP password

// Hostname of BOSH endpoint, used for prebinding only (called by PHP), // this must be an absolute URL $rcmail_config['converse_xmpp_bosh_prebind_url']= function($args) { return 'http://127.0.0.1/http-bind/';

return sprintf('http://%s/http-bind', $_SERVER['HTTP_HOST']);

    # return sprintf('http://%s/http-bind', $args['host']);

};

// Hostname of BOSH endpoint, used by web browsers (called by Javascript code), // this can be a relative URL $rcmail_config['converse_xmpp_bosh_url']= function($args) { return '/http-bind/'; };

// Hostname portion of XMPP username (bare JID), example: "example.net" $rcmail_config['converse_xmpp_hostname']= function($args) { return 'iff.edu.br';

return preg_replace('/^.*@/', '', $args['user'];

    # return $args['host'];

};

// Username portion of XMPP username (bare JID), example: "user" // if this contains @, this will only take the part before @, // and the part after @ will replace the hostname definition above. $rcmail_config['converse_xmpp_username']= function($args) { return $args['user'];

return preg_replace('/@.*$/', '', $args['user']);

};

// XMPP password $rcmail_config['converse_xmpp_password']= function($args) { return $args['pass']; };

I`m using the last patch, and the converse plugin pass the authentication on ejabberd, but dont start the session. In the pidgin i can connect.

2013/9/9 Marco Wessel notifications@github.com

Try with above patch; my test ejabberd with no real setup other than enabling bosh accepts me this way.

— Reply to this email directly or view it on GitHubhttps://github.com/priyadi/roundcube-converse.js-xmpp-plugin/pull/4#issuecomment-24117388 .

Att André Cunha Analista de Tecnologia da Informação

Att André Cunha Analista de Tecnologia da Informação

Att André Cunha Analista de Tecnologia da Informação

Att André Cunha Analista de Tecnologia da Informação

aacunha commented 11 years ago

Works with this configuration:

// Hostname of BOSH endpoint, used for prebinding only (called by PHP), // this must be an absolute URL $rcmail_config['converse_xmpp_bosh_prebind_url']= function($args) { return 'http://200.143.198.114:5280/http-bind/';

return sprintf('http://%s/http-bind', $_SERVER['HTTP_HOST']);

    # return sprintf('http://%s/http-bind', $args['host']);

};

// Hostname of BOSH endpoint, used by web browsers (called by Javascript code), // this can be a relative URL $rcmail_config['converse_xmpp_bosh_url']= function($args) { return 'http://200.143.198.114:5280/http-bind/'; };

Thanks!

2013/9/10 André Cunha aacunha@gmail.com

I see this error on openfire logs:

2013.09.10 12:22:37 org.jivesoftware.openfire.http.HttpBindServlet - Client provided invalid session: 2938f624. [200.143.198.114]

2013/9/10 André Cunha aacunha@gmail.com

Hey!

I`m testing with openfire. Now i can connect, but i still "offline" on session page on openfire. With the jappix4roundcube clients can open session.

Regards, André

2013/9/10 André Cunha aacunha@gmail.com

What is the roundcube version you use?

Regards, André

2013/9/10 André Cunha aacunha@gmail.com

My config is the same like. Follow my config.inc.php:

<?php // important variables in the following anonymous functions: // $args['host'] : IMAP hostname // $args['user'] : IMAP username // $args['pass'] : IMAP password

// Hostname of BOSH endpoint, used for prebinding only (called by PHP), // this must be an absolute URL $rcmail_config['converse_xmpp_bosh_prebind_url']= function($args) { return 'http://127.0.0.1/http-bind/';

return sprintf('http://%s/http-bind', $_SERVER['HTTP_HOST']);

    # return sprintf('http://%s/http-bind', $args['host']);

};

// Hostname of BOSH endpoint, used by web browsers (called by Javascript code), // this can be a relative URL $rcmail_config['converse_xmpp_bosh_url']= function($args) { return '/http-bind/'; };

// Hostname portion of XMPP username (bare JID), example: "example.net" $rcmail_config['converse_xmpp_hostname']= function($args) { return 'iff.edu.br';

return preg_replace('/^.*@/', '', $args['user'];

    # return $args['host'];

};

// Username portion of XMPP username (bare JID), example: "user" // if this contains @, this will only take the part before @, // and the part after @ will replace the hostname definition above. $rcmail_config['converse_xmpp_username']= function($args) { return $args['user'];

return preg_replace('/@.*$/', '', $args['user']);

};

// XMPP password $rcmail_config['converse_xmpp_password']= function($args) { return $args['pass']; };

I`m using the last patch, and the converse plugin pass the authentication on ejabberd, but dont start the session. In the pidgin i can connect.

2013/9/9 Marco Wessel notifications@github.com

Try with above patch; my test ejabberd with no real setup other than enabling bosh accepts me this way.

— Reply to this email directly or view it on GitHubhttps://github.com/priyadi/roundcube-converse.js-xmpp-plugin/pull/4#issuecomment-24117388 .

Att André Cunha Analista de Tecnologia da Informação

Att André Cunha Analista de Tecnologia da Informação

Att André Cunha Analista de Tecnologia da Informação

Att André Cunha Analista de Tecnologia da Informação

Att André Cunha Analista de Tecnologia da Informação

CyBeRoni commented 11 years ago

Oh, that sounds like you weren't proxying the BOSH url properly.

priyadi commented 11 years ago

Hi, sorry for keeping you guys waiting for so long. I'll review this pull request as soon as possible.

brunohulk commented 10 years ago

@aacunha Hi, Are you brazilian right? Can you help me to configure converse on Roundcube? If you can, please give me your personal contact or add me My contacts are in iborges.com

Tks a lot man!