tags:

views:

156

answers:

1

cl = xmpp.Client('myserver.com') if not cl.connect(server=('mysefver.com',5223)): raise IOError('cannot connect to server') cl.RegisterHandler('message',messageHandler) cl.auth('[email protected]', 'mypassword', 'statusbot') cl.sendInitPresence()

msgtext = formatToDo(cal, 'text')
message = xmpp.Message('[email protected]',  msgtext) 
message.setAttr('type', 'chat')
cl.send(message)

I get the following error message when I try to run it:

xmpp.protocol.InvalidFrom: (u'invalid-from', '')

Why is this happening :(

+3  A: 

From the XMPP protocol specification:

If the value of the 'from' address does not match the hostname represented by the Receiving Server when opening the TCP connection (or any validated domain thereof, such as a validated subdomain of the Receiving Server's hostname or another validated domain hosted by the Receiving Server), then the Authoritative Server MUST generate an stream error condition and terminate both the XML stream and the underlying TCP connection.

which basically means, that if the sender is not recognized by the xmpp-server, it'll reply with this message. XMPP supplies a registration mechanism: xmpp.features.register

Steen
Boy do I feel stupid :) .
Alterlife