problem integrating with jabberd2

2 views
Skip to first unread message

JB

unread,
Feb 7, 2008, 5:02:51 PM2/7/08
to py-transports
I'm trying to use PyYIMt (yahoo-transport-0.4) with xmpppy-0.4.1,
though I'm not sure that the problem is transport-specific. Here's
what happens at startup:

[...]
DEBUG: sasl ok Got challenge:realm="jabberd-router",
nonce="jBqCtJcXBUUaJ/5jpbLqZg==", qop="auth, auth-int", charset=utf-8,
algorithm=md5-sess
DEBUG: sasl info pair=>>realm="jabberd-router"<<
DEBUG: sasl info pair=>> nonce="jBqCtJcXBUUaJ/5jpbLqZg=="<<
DEBUG: sasl info pair=>> qop="auth<<
DEBUG: sasl info pair=>> auth-int"<<
DEBUG: component error Failed to authenticate yimtransport
Traceback (most recent call last):
File "/usr/local/lib/python2.5/site-packages/xmpp/client.py", line
313, in auth
while self.SASL.startsasl=='in-process' and self.Process(1): pass
File "/usr/local/lib/python2.5/site-packages/xmpp/dispatcher.py",
line 303, in dispatch
handler['func'](session,stanza)
File "/usr/local/lib/python2.5/site-packages/xmpp/auth.py", line
177, in SASLHandler
key,value=pair.split('=', 1)
ValueError: need more than 1 value to unpack
auth return: None
Could not connect to server, or password mismatch!

It doesn't look like it's getting to the point where it authenticates
with the jabberd2 router. I briefly added a self.DEBUG right before
the 'pair.split' call in question, which is what printed out the
'pair=>>...<<' lines. Looks like some sort of disagreement between the
re.findall call on line 176 of auth.py and the jabberd challenge.

PyYIMt config.xml follows:

<?xml version="1.0" ?>
<pyyimt>
<jid>yahoo.localhost</jid>
<!-- <compjid>yahoo1</compjid> -->
<!-- <confjid>chat.yahoo.localhost</confjid> -->
<!-- <compjid>chat.yahoo1</compjid> -->
<!--<host>vanity.host.example.net</host>-->
<!-- <discoName>Yahoo! Transport</discoName> -->
<spoolFile>/var/jabberd/db/yahoouser</spoolFile>
<pid>/var/jabberd/pid/PyYIMt.pid</pid>
<mainServer>127.0.0.1</mainServer>
<mainServerJID>jabber.localhost</mainServerJID>
<port>5347</port>
<secret>XXXXX</secret>
<saslUsername>yimtransport</saslUsername>
<allowRegister/>
<enableChatrooms/>
<!--<useComponentBinding/>-->
<!--<useRouteWrap/>-->
<!--<admins>
<jid>ro...@montague.net</jid>
<jid>jul...@capulet.com</jid>
</admins>-->
<!--<debugFile>/var/tmp/yahooerror.log</debugFile>-->
<dumpProtocol/>
</pyyimt>

jabberd2 version is v2.1.20. If I need to post any of my jabberd2
config, please let me know what's relevant.

thanks,
Jeff

Norman Rasmussen

unread,
Feb 8, 2008, 3:14:52 AM2/8/08
to py-tra...@googlegroups.com
On Feb 8, 2008 12:02 AM, JB <jb00...@mr-happy.com> wrote:
I'm trying to use PyYIMt (yahoo-transport-0.4) with xmpppy-0.4.1,
though I'm not sure that the problem is transport-specific.
jabberd2 version is v2.1.20.

Apparently jabberd2 now adds spaces into the SASL strings, try this patch:

diff -u ./auth.py ../../xmpppy.pserver/xmpp/auth.py
--- ./auth.py   2008-02-08 10:12:23.000000000 +0200
+++ ../../xmpppy.pserver/xmpp/auth.py   2007-08-28 12:24:49.000000000 +0200
@@ -173,11 +173,11 @@
         chal={}
         data=base64.decodestring(incoming_data)
         self.DEBUG('Got challenge:'+data,'ok')
-        for pair in re.findall('(\w+=(?:(?:"[^"]+")|(?:[^,]+)))',data):
+        for pair in re.findall('(\w+=(?:"[^"]+")|(?:[^,]+))',data):
             key,value=pair.split('=', 1)
             if value[:1]=='"' and value[-1:]=='"': value=value[1:-1]
             chal[key]=value
-        if chal.has_key('qop') and 'auth' in [x.strip() for x in value.split(',')]:
+        if chal.has_key('qop') and 'auth' in chal['qop'].split(','):
             resp={}
             resp['username']=self.username
             resp['realm']=self._owner.Server


--
- Norman Rasmussen
- Email: nor...@rasmussen.co.za
- Home page: http://norman.rasmussen.co.za/

Norman Rasmussen

unread,
Feb 8, 2008, 3:58:52 AM2/8/08
to py-tra...@googlegroups.com
On Feb 8, 2008 10:14 AM, Norman Rasmussen <nor...@rasmussen.co.za> wrote:
On Feb 8, 2008 12:02 AM, JB <jb00...@mr-happy.com> wrote:
I'm trying to use PyYIMt (yahoo-transport-0.4) with xmpppy-0.4.1,
though I'm not sure that the problem is transport-specific.
jabberd2 version is v2.1.20.

Apparently jabberd2 now adds spaces into the SASL strings, try this patch:

Helps if I test it first, this should work better:

diff -u ../../xmpppy.pserver/xmpp/auth.py ./auth.py
--- ../../xmpppy.pserver/xmpp/auth.py   2007-08-28 12:24:49.000000000 +0200
+++ ./auth.py   2008-02-08 10:57:10.000000000 +0200

@@ -173,11 +173,11 @@
         chal={}
         data=base64.decodestring(incoming_data)
         self.DEBUG('Got challenge:'+data,'ok')
-        for pair in re.findall('(\w+=(?:"[^"]+")|(?:[^,]+))',data):
-            key,value=pair.split('=', 1)
+        for pair in re.findall('(\w+\s*=\s*(?:(?:"[^"]+")|(?:[^,]+)))',data):
+            key,value=[x.strip() for x in pair.split('=', 1)]

             if value[:1]=='"' and value[-1:]=='"': value=value[1:-1]
             chal[key]=value
-        if chal.has_key('qop') and 'auth' in chal['qop'].split(','):
+        if chal.has_key('qop') and 'auth' in [x.strip() for x in chal['qop'].split(',')]:

JB

unread,
Feb 8, 2008, 2:35:33 PM2/8/08
to py-transports
On Feb 8, 3:58 am, "Norman Rasmussen" <nor...@rasmussen.co.za> wrote:
> On Feb 8, 2008 10:14 AM, Norman Rasmussen <nor...@rasmussen.co.za> wrote:
> > Apparently jabberd2 now adds spaces into the SASL strings, try this patch:
> Helps if I test it first, this should work better:

yup, take 2 works perfectly. thank you!

Jeff

Vishal

unread,
Mar 24, 2008, 2:01:58 PM3/24/08
to py-transports
Hello Norman,

Am facing the same issue. Am not able to figure out how to edit the
auth.py with the changes. I make the required changes in xmpppy-0.4.1
auth.py and after that the yahoo transport refuses to load. Would be
highly obliged if you can guide me how to get the changes done. Or if
you can paste the auth.py here i can replace that file on my config.

Thanks a lot

Regards
Vishal

Norman Rasmussen

unread,
Mar 24, 2008, 2:30:08 PM3/24/08
to py-tra...@googlegroups.com

Vishal

unread,
Mar 25, 2008, 4:42:19 AM3/25/08
to py-transports
Hi Norman

Thanks a lot for that. But still not able to get it working. Am on my
wits end on this.

Running jabber on win environment. pymsnt and pyaimt are working fine.

pyyimt directory has xmpp and curphoo subdirectorys. am able to
trigger yahoo.py successfully and also the xmpp and curphoo
initiations..the compiled py files are created. that means jabber is
interacting succefully with pyyimt

mydomain.com is configured to the IP of the server directly.

Following log..it still indicates host-unknown

ThreadProcessXmppTransportConnection: Processing XMPP transport
connection from 202.134.186.109...
202.134.186.109: <?xml version='1.0'?><stream:stream xmlns="http://
jabberd.jabberstudio.org/ns/component/1.0" to="202.134.186.109"
version="1.0" xmlns:stream="http://etherx.jabber.org/streams" >
202.134.186.109: <host-unknown/>


ThreadProcessXmppTransportConnection: Processing XMPP transport
connection from 202.134.186.109...
202.134.186.109: <?xml version='1.0'?><stream:stream xmlns="http://
jabberd.jabberstudio.org/ns/component/1.0" to="mydomain.com"
version="1.0" xmlns:stream="http://etherx.jabber.org/streams" >
202.134.186.109: <host-unknown/>

Also in the config.xml i have tried configuring mydomain.com and the
IP as the server..still the issue remains.

Following is my config.xml:

<?xml version="1.0" ?>
<pyyimt>
<!-- This file contains options to be configured by the server
administrator. -->
<!-- Please read through all the options in this file -->

<!-- The JabberID of the transport -->
<jid>yahoo.mydomain.com</jid>

<!-- The JabberID of the conference room handler. -->
<confjid>chat.yahoo.mydomain.com</confjid>

<!-- The component JID of the transport. Unless you're doing
clustering, leave this alone -->
<!-- <compjid>yahoo1</compjid> -->

<!-- The public IP or DNS name of the machine the transport is
running on -->
<!-- This is used to select the outgoing IP address used to
connect to the Yahoo! network -->
<!-- otherwise known as the vanity address, it's safe to leave it
commented -->
<host>mydomain.com</host>

<!-- The name of the transport in the service discovery list. -->
<discoName>Yahoo Transport</discoName>

<!-- The location of the spool file.. if relative, relative to the
PyYIMt dir. -->
<!-- Include the jid of the transport, if running multiple copies
of the same transport -->
<spoolFile>yahoouser.dbm</spoolFile>

<!-- The location of the PID file, relative to the PyYIMt
directory -->
<!-- Comment out if you do not want a PID file -->
<pid>PyYIMt.pid</pid>

<!-- The IP address or DNS name of the main Jabber server -->
<mainServer>mydomain.com</mainServer>

<!-- The JID of the main Jabber server -->
<mainServerJID>mydomain.com</mainServerJID>

<!-- The TCP port to connect to the Jabber server on (this is the
default for Jabberd2) -->
<port>5347</port>

<!-- The authentication token to use when connecting to the Jabber
server -->
<secret>XXXX</secret>

<!-- SASL username used to bind to Jabber server. -->
<!-- secret, above, is used for sasl password -->
<saslUsername>XXXX</saslUsername>

<!-- Allow users to register with this transport -->
<allowRegister/>

<!-- Allow users to use the Yahoo! chat rooms with this transport
-->
<enableChatrooms/>

<!-- Use external component binding. -->
<!-- This dodges the need to manually configure all jids that talk
to this transport. -->
<!-- Jabberd2 requires saslUsername and useRouteWrap for this to
work. -->
<!-- Wildfire as of 2.6.0 requires just this. -->
<!-- <useComponentBinding/> -->

<!-- Wrap stanzas in <route> stanza. -->
<!-- Jabberd2 requires this for useComponentBinding. -->
<!-- <useRouteWrap/> -->

<!-- You can choose which users you wish to have as
administrators. These users can perform some tasks with Ad-Hoc
commands that others cannot -->
<!--<admins>
<jid>admin@localhost</jid>
</admins>-->

<!-- The file to log to. Leave this disabled for stdout only -->
<debugFile>error.log</debugFile>

<!-- Show the raw data being sent and received from the xmpp and
yahoo servers -->
<dumpProtocol/>

</pyyimt>

Kinldy help me out

Vishal

Norman Rasmussen

unread,
Mar 25, 2008, 6:22:03 AM3/25/08
to py-tra...@googlegroups.com
Either disable saslUsername or enable useComponentBinding and useRouteWrap.

Vishal

unread,
Mar 25, 2008, 8:32:34 AM3/25/08
to py-transports
Hello Norman,

Hats off..You are a genious!!!!..It works like a charm. Appreciate
your help on this.

Vishal

unread,
Apr 6, 2008, 12:06:31 PM4/6/08
to py-transports
Hello Norman,

Any chance of getting a Gtalk transport done on python? That would be
great as it would allow jabber to coummunicate to Gtalk.

Regards
Vishal

Norman Rasmussen

unread,
Apr 7, 2008, 6:10:44 AM4/7/08
to py-tra...@googlegroups.com
On Sun, Apr 6, 2008 at 6:06 PM, Vishal <sms...@gmail.com> wrote:
> Any chance of getting a Gtalk transport done on python? That would be
> great as it would allow jabber to coummunicate to Gtalk.

You want an xmpp/jabber transport. There are already two threads on
this list referring to the idea. There's an xmpp transport written in
perl which you could use.

http://groups.google.com/group/py-transports/browse_thread/thread/58e0bb688fefe470
http://groups.google.com/group/py-transports/browse_thread/thread/fcc950cae279879b

Vishal

unread,
Apr 25, 2008, 7:54:11 AM4/25/08
to py-transports
Hi Norman

Thanks for the inputs. Tried that. Cant seem to get it working at all.
checked your threads on that also. a python based transport would be
really handy.

Would request one more favour. Am trying to connect to icq via pyaim-
t-0.5. user is able to register properly and get the following spool
file

- <xdb>
- <aimtrans xdbns="aimtrans:data">
<logon id="437984829" pass="XXXX" />
</aimtrans>
</xdb>

That means the user is getting registered on the network. But somehow
that doesnt work. I mean the user cant see his icq buddies nor can he
chat. Even after registration on the local jabber sever the user is
shown offline.

Kindly do help me out.

Regards
Vishal

On Apr 7, 3:10 pm, "Norman Rasmussen" <nor...@rasmussen.co.za> wrote:
> On Sun, Apr 6, 2008 at 6:06 PM, Vishal <sms...@gmail.com> wrote:
> >  Any chance of getting a Gtalk transport done on python? That would be
> >  great as it would allow jabber to coummunicate to Gtalk.
>
> You want an xmpp/jabber transport.  There are already two threads on
> this list referring to the idea.  There's an xmpp transport written in
> perl which you could use.
>
> http://groups.google.com/group/py-transports/browse_thread/thread/58e...http://groups.google.com/group/py-transports/browse_thread/thread/fcc...

Norman Rasmussen

unread,
Apr 25, 2008, 8:00:23 AM4/25/08
to py-tra...@googlegroups.com
On Fri, Apr 25, 2008 at 1:54 PM, Vishal <sms...@gmail.com> wrote:
Thanks for the inputs. Tried that. Cant seem to get it working at all.
checked your threads on that also. a python based transport would be
really handy.

yep it would, but there's little motivation for anyone to start one, because of the two existing ones. 
 
Would request one more favour. Am trying to connect to icq via pyaim-
t-0.5. user is able to register properly and get the following spool
file

I think you should start a new thread about this topic, undoubtedly people that can assist won't notice otherwise.

Vishal

unread,
Apr 25, 2008, 9:37:44 AM4/25/08
to py-transports
Hi Norman

Thanks for your inputs. It seems both of them have issues and people
are not able to get it working.

Thanks once again for your inputs.

Regards
Vishal
Reply all
Reply to author
Forward
0 new messages