我正在尝试使用sendxmpp从Linux机器上的shell发送Google Hangout消息。为此,我安装了最新的sendxmpp(1.24)。
除了身份验证失败之外,一切看起来都不错。 这是我使用的命令:
echo "GTalk Test" | sendxmpp -v -t receiver.username
这是输出:
sendxmpp: config: 'password' => '[sender.pass]'
sendxmpp: config: 'component' => 'gmail.com'
sendxmpp: config: 'jserver' => 'talk.google.com'
sendxmpp: config: 'username' => '[sender.username]'
sendxmpp: ssl_verify: 1
sendxmpp: tls_ca_path:
sendxmpp: Connect: 1
Use of uninitialized value in string eq at /usr/bin/sendxmpp line 518.
Error 'AuthSend': [?]
sendxmpp: Disconnect
我已将用户名和密码复制粘贴到gmail-login界面,以确保没有拼写错误。
我还打开了“不太安全的应用”设置(https://www.google.com/settings/security/lesssecureapps)
此外,在此页面上:https://security.google.com/settings/security/activity?pli=1&p gmail告诉我一个未知设备已尝试登录并阻止它这样做。我告诉它它是我,所以它不必担心它,因为我这样做,在屏幕上不再出现任何其他尝试。
我还手动向两个帐户发送消息(成功),以确保它不会在该级别上被阻止。
当我打开调试(-d)时,这是输出的(最后一部分):
XMPP::Conn: AuthSASL: shiney new auth
XML::Stream: Send: (<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'>[hash]</auth>)
XMPP::Conn: AuthSASL: haven't authed yet... let's wait.
XMPP::Conn: Process: timeout(1)
XML::Stream: Read: buff(<failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><not-authorized/></failure>)
XML::Stream: Read: buff(</stream:stream>)
XML::Stream: Read: buff()
XML::Stream: Read: ERROR
Use of uninitialized value in string eq at /usr/bin/sendxmpp line 518.
Error 'AuthSend': [?]
XML::Stream: Send: (</stream:stream>)
XML::Stream: SetCallBacks: tag(node) func(CODE(0x29855b8))
XMPP::Conn: Disconnect: bye bye
sendxmpp: Disconnect
我也尝试将@ gmail.com添加到我的用户名(只是为了尝试),但这也会导致失败(虽然略有不同:<invalid-authzid/>
)
所以,我知道它成功连接,我知道它正在使用正确的帐户,但我仍然得到身份验证失败。我还能尝试什么?
答案 0 :(得分:1)
我在Ubuntu 14.04下遇到了类似的问题,并按照this page中的解释使用此命令解决了这个问题:
echo "message to send" | sendxmpp -t -u from_user -o gmail.com to_user
非常重要的是,from_user
和to_user
是在没有@ gmail.com
答案 1 :(得分:0)
最后,解决它的是设置一个新密码:S 也许这只是在更改所有其他安全设置后需要的内容?