lhost / sendxmpp

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

Could not connect to '192.168.8.254' on port 5222: HASH(0x15c3190) #20

Closed Hrabosh136 closed 6 years ago

Hrabosh136 commented 8 years ago

Hi all, Im trying to install sendxmpp to be able to send automated messages using my own server (Prosody) on 192.168.8.254. The server is up and I can send messages between accounts Im logging to from Android app and Kopete.

Unfortunately, If Im trying to send something using sendxmpp, Im getting following errors: GentooOnPhenomII hrabosh # echo zprava | sendxmpp -v -o Hrabosh@192.168.8.254 sendxmpp: config: 'password' => 'password' sendxmpp: config: 'username' => 'debug' sendxmpp: config: 'jserver' => '192.168.8.254' sendxmpp: config: 'component' => '192.168.8.254' sendxmpp: ssl_verify: 1 sendxmpp: tls_capath: Use of uninitialized value within @ in lc at /usr/lib64/perl5/vendor_perl/5.20.2/XML/Stream/Parser.pm line 71. Could not connect to '192.168.8.254' on port 5222: HASH(0x15c3190)

Im seeing "this server does not serve hrabosh@192.168.8.254" messages.

Any clue whats wrong?

lhost commented 8 years ago

I don't know how to configure Prosody, but maybe you set some VirtualHost name to you server and add IP 192.168.8.254 to your DNS.

https://prosody.im/doc/configure#adding_a_host

echo zprava | strace -s 4096 sendxmpp -v -o Hrabosh@192.168.8.254

lyn1337 commented 7 years ago

Getting this, also using prosody:

sendxmpp -v -n sendxmpp: config: 'port' => '5222' sendxmpp: config: 'jserver' => '31337.one' sendxmpp: config: 'username' => 'root' sendxmpp: config: 'password' => 'wJzy2tssdd3Lk8QUyE' Use of uninitialized value $val in concatenation (.) or string at /usr/bin/sendxmpp line 195. sendxmpp: config: 'component' => '' sendxmpp: ssl_verify: 0 sendxmpp: tls_ca_path: Use of uninitialized value in numeric eq (==) at /usr/share/perl5/XML/Stream.pm line 631. Could not connect to '31337.one' on port 5222:

WesleyAffonso commented 7 years ago

Hi, I'm also having the same problem "Could not connect to 'xxxxx' on port 5222:"

I tried using SendXMPP v1.24 on OpenSuse and v1.23 on Ubuntu and got the same result.

The xmpp server is up and I can send messages between accounts Im logging to from Android app and pidgin.

See the debug below:

$ echo "Test" | sendxmpp -v -d --tls -f /tmp/sendxmpprc -s "destination@domain"

sendxmpp: config: 'port' => '5222' sendxmpp: config: 'password' => 'password' Use of uninitialized value $val in concatenation (.) or string at /usr/bin/sendxmpp line 195. sendxmpp: config: 'component' => '' sendxmpp: config: 'jserver' => 'domain' sendxmpp: config: 'username' => 'sender@domain' XML::Stream: new: hostname = (ubuntu) XML::Stream: SetCallBacks: tag(node) func(CODE(0x1ddc8b0)) XMPP::Conn: xmppCallbackInit: start XMPP::Conn: SetCallBacks: tag(message) func(CODE(0x1ddc5b0)) XMPP::Conn: SetCallBacks: tag(presence) func(CODE(0x1e49000)) XMPP::Conn: SetCallBacks: tag(iq) func(CODE(0x1d12618)) XMPP::Conn: SetPresenceCallBacks: type(subscribe) func(CODE(0x1d4d060)) XMPP::Conn: SetPresenceCallBacks: type(unsubscribe) func(CODE(0xe72818)) XMPP::Conn: SetPresenceCallBacks: type(unsubscribed) func(CODE(0x1ddc490)) XMPP::Conn: SetPresenceCallBacks: type(subscribed) func(CODE(0x1e388e0)) XMPP::Conn: SetDirectXPathCallBacks: xpath(/[@xmlns="urn:ietf:params:xml:ns:xmpp-tls"]) func(CODE(0x1e37cc8)) XMPP::Conn: SetDirectXPathCallBacks: xpath(/[@xmlns="urn:ietf:params:xml:ns:xmpp-sasl"]) func(CODE(0xe72920)) XMPP::Conn: xmppCallbackInit: stop sendxmpp: ssl_verify: 1 sendxmpp: tls_ca_path: XMPP::Conn: Connect: host(domain:5222) namespace(jabber:client) XMPP::Conn: Connect: timeout(10) XML::Stream: Connect: type(tcpip) XML::Stream: Connect: Got a connection XML::Stream: Send: (<?xml version='1.0'?>) XML::Stream: Read: buff(<?xml version='1.0'?></stream:error></stream:stream>) XML::Stream: _handle_root: sid(newconnection) sax(XML::Stream::Parser=HASH(0xe72cc8)) tag(stream:stream) att( to ubuntu xmlns:stream http://etherx.jabber.org/streams xmlns jabber:client xml:lang en id 13899445154980803279 from domain version 1.0 ) XML::Stream: Node: _handle_element: sid(newconnection) sax(XML::Stream::Parser=HASH(0xe72cc8)) tag(stream:error) att( ) XML::Stream: Node: _handle_element: check( -1 ) XML::Stream: Node: _handle_element: sid(newconnection) sax(XML::Stream::Parser=HASH(0xe72cc8)) tag(host-unknown) att( xmlns urn:ietf:params:xml:ns:xmpp-streams ) XML::Stream: Node: _handle_element: check( 0 ) XML::Stream: Node: _handle_close: sid(newconnection) sax(XML::Stream::Parser=HASH(0xe72cc8)) tag(host-unknown) XML::Stream: Node: _handle_close: check( 1 ) XML::Stream: Node: _handle_close: check2( 0 ) XML::Stream: Node: _handle_close: sid(newconnection) sax(XML::Stream::Parser=HASH(0xe72cc8)) tag(stream:error) XML::Stream: Node: _handle_close: check( 0 ) XML::Stream: Node: _handle_close: check2( -1 ) XML::Stream: Node: _handle_close: sid(newconnection) sax(XML::Stream::Parser=HASH(0xe72cc8)) tag(stream:stream) XML::Stream: Node: _handle_close: check( -1 ) XML::Stream: Node: _handle_close: rootTag(stream:stream) tag(stream:stream) Could not connect to 'domain' on port 5222:

Please, can you help me?

lyn1337 commented 7 years ago

@WesleyAffonso Did you give the -n option a try? e.g. echo "Test" | sendxmpp -t -n -f /tmp/sendxmpprc -s "destination@domain"

WesleyAffonso commented 7 years ago

Hi @lyn1337, Thank you for your answer, but I including the -n option the result is the same.

The sendxmpp worked correctly until two weeks ago.

I'm testing sendxmpp through two XMPP servers yax.im or xmpp.jp. The xmpp servers are up and I can send messages between accounts Im logging to from Android app and pidgin.

Please, any other ideas?

micha137 commented 6 years ago

The --tls is the solution. The server requires TLS.

Hrabosh136 commented 6 years ago

It works. Command is: echo "Message..." | sendxmpp -t hrabosh@192.168.8.254 .. instead of what I was trying initially (first post).

WesleyAffonso commented 6 years ago

Hi All,

For the solution of my case:

Thank you all ( @lyn1337 @micha137 @Hrabosh136 ) for your help!