lhost / sendxmpp

perl-script to send xmpp (jabber), similar to what mail(1) does for mail.
63 stars 22 forks source link

Wrong server name used when `--jserver` given #6

Closed cweiske closed 9 years ago

cweiske commented 10 years ago

I've got an account cweiske@company.com, the XMPP server is running on xmpp.company.com. The XMPP SRV record for company.com links to xmpp.company.com.

Now when specifying --jserver=xmpp.company.com, this host name is not only used to connect to, but also as xmpp target server. I get the following error:

Request:

<?xml version='1.0'?>
<stream:stream version='1.0' xmlns:stream='http://etherx.jabber.org/streams' 
 xmlns='jabber:client'
 to='xmpp.company.com'
 from='cyberdyne'
 xml:lang='en' >

Response:

<stream:error>
  <host-unknown xmlns='urn:ietf:params:xml:ns:xmpp-streams'/>
  <text xmlns='urn:ietf:params:xml:ns:xmpp-streams'>
    This server does not serve xmpp.company.com
  </text>
</stream:error>

The xmpp.company.com hostname should only be used for connecting, not as general xmpp server hostname.

This is with sendxmpp 1.22-1 (ubuntu) and libnet-xmpp-perl 1.02-3.

julbrs commented 10 years ago

Same issue here with sendxmpp 1.22 & 1.23

lhost commented 9 years ago

Please try the latest version of sendxmpp and rewrite config file to new format. Example here: http://blog.hostname.sk/2014/09/13/sendxmpp-release-v1-24/

uvok commented 8 years ago

Please reopen?

my config file says

username: me@myhost
jserver: localhost
password: mypassword

where myhost is the external server name, but I connect via localhost

sendxmpp says

sendxmpp: config: 'jserver' => 'localhost'
sendxmpp: config: 'username' => 'me@myhost'
sendxmpp: config: 'password' => 'mypassword'
sendxmpp: ssl_verify: 1
sendxmpp: tls_ca_path: 
Could not connect to 'localhost' on port 5222: HASH(0xaf6e38)

But my prosody server says

Sep 25 22:13:28 c2s1710100  info    Client connected
Sep 25 22:13:28 c2s1710100  info    c2s stream for <127.0.0.1> closed: This server does not serve localhost
Sep 25 22:13:28 c2s1710100  info    Client disconnected: connection closed

So although I specified the host in my username, it seems to replace it with the jserver

edit:

error occurs at

XML::Stream::Connect(/usr/share/perl5/XML/Stream.pm:1013):
1013:       return $self->OpenStream("newconnection",$timeout);
 DB<55>
Sep 25 22:55:05 c2s154d2c0  info    c2s stream for <127.0.0.1> closed: This server does not serve localhost
Sep 25 22:55:05 c2s154d2c0  info    Client disconnected: connection closed
lhost commented 8 years ago

Please, try the following config and try again:

username: me@localhost jserver: myhost password: mypassword

lhost commented 8 years ago

Please, try the following config and try again:

username: me jserver: localhost component: myhost password: mypassword

uvok commented 8 years ago

@lhost Thanks, that works