If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Thunderbird Chat and Slack XMPP gateway don't connect

RESOLVED FIXED in Instantbird 42


Chat Core
2 years ago
2 years ago


(Reporter: Michael Fleming, Assigned: aleth)


Instantbird 42
Mac OS X

Firefox Tracking Flags

(Not tracked)



(1 attachment, 4 obsolete attachments)



2 years ago
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 Safari/537.36

Steps to reproduce:

[Perhaps should be "Product: Chat Core"]

1) Make a team with slack.com
2) Enable the XMPP gateway on that team (go to https://TEAMNAME.slack.com/admin/settings#permissions and turn on XMPP under "Gateways"
3) Follow instructions to fill out Thunderbird chat account dialog. Be sure to select "Allow sending the password unencrypted" because this is the only option that appears to use START-TLS on port 5222, which is all Slack XMPP supports (the actual password will definitely not be sent unencrypted, it will only be sent after START-TLS occurs)

Actual results:

Thunderbird chat disconnects after Slack XMPP gateway sends a bind result:

What I believe Slack's XMPP server sends:

<iq xmlns="jabber:client" from="testteam-mikef.xmpp.dev.slack.com" to="newxmpp@testteam-mikef.xmpp.dev.slack.com/Thunderbird" type="result" id="b4633a7d-f172-5349-9e0f-5b85ec6518c4"><zdef1647982679:bind xmlns:zdef1647982679="urn:ietf:params:xml:ns:xmpp-bind"><jid>newxmpp@testteam-mikef.xmpp.dev.slack.com/Thunderbird</jid></zdef1647982679:bind></iq>

What's printed by the Thunderbird debug log before it disconnects:

<iq xmlns="jabber:client" from="testteam-mikef.xmpp.dev.slack.com" to="newxmpp@testteam-mikef.xmpp.dev.slack.com/Thunderbird" type="result" id="b4633a7d-f172-5349-9e0f-5b85ec6518c4">
 <zdef1647982679:bind xmlns="urn:ietf:params:xml:ns:xmpp-bind">
  <jid xmlns="jabber:client">

Expected results:

Successful connection

Note: Reach out to mikef@slack-corp.com if I can help make this work by changing things on Slack's side.


2 years ago
Component: Untriaged → XMPP
OS: Unspecified → Mac OS X
Product: Thunderbird → Chat Core
Version: 38 → 1.5

Comment 1

2 years ago
Here's a test team + user I created for you:

JID: testuser@xmpp-test.xmpp.slack.com
Password: xmpp-test.0BIcuAVperRJ8Y3vg6a8

Try joining MUC "general" on conference.xmpp-test.xmpp.slack.com

Comment 2

2 years ago
Created attachment 8638497 [details] [diff] [review]
WIP using localName instead of qName to query XML nodes

WIP that gets a bit further in the connection process. Now fails later on with "server closed the connection".


2 years ago
Assignee: nobody → aleth

Comment 3

2 years ago
Created attachment 8638508 [details] [diff] [review]
WIP using localName instead of qName to query XML nodes, v2

With this WIP, the account successfully connects, but the server disconnects us immediately afterwards.

There are also "Error: Failed to decode base64 string!" when atob()-decoding the BINVAL image in each roster item.
Attachment #8638497 - Attachment is obsolete: true

Comment 4

2 years ago
Mike responded that the reason for the disconnect is that JS-XMPP sends the iq set for the vcard with <zdef-902553532:vCard xmlns="vcard-temp">, i.e. incorrectly mirroring the namespace used by the server in iq result.
Flags: needinfo?(mikef)

Comment 5

2 years ago
Created attachment 8638694 [details] [diff] [review]
WIP fixing namespace issues, v3

Fixes the namespace on the vcard we send out.

With this patch, it's possible to connect to Slack and stay connected, and join MUCs.

The base64 issue remains unsolved.
Attachment #8638508 - Attachment is obsolete: true


2 years ago
Flags: needinfo?(mikef)

Comment 6

2 years ago
Created attachment 8638746 [details] [diff] [review]
WIP fixing namespace issues and atob parsing, v4

Mozilla's atob() has problems when there is padding (=, ==) in the middle of the base64 string to be parsed, so we have to parse the lines separately and concatenate.

With this WIP, the Slack vcard icons are parsed correctly.
Attachment #8638694 - Attachment is obsolete: true

Comment 7

2 years ago
Created attachment 8638749 [details] [diff] [review]

Putting this up for review.
Attachment #8638746 - Attachment is obsolete: true
Attachment #8638749 - Flags: review?(clokep)


2 years ago
Ever confirmed: true
Comment on attachment 8638749 [details] [diff] [review]

Review of attachment 8638749 [details] [diff] [review]:

It'd be nice to have some test cases for the base64 decoded data. Or at least attach it to this bug.
Attachment #8638749 - Flags: review?(clokep) → review+

Comment 9

2 years ago
url:        https://hg.mozilla.org/comm-central/rev/315831486f3428dbb77170e9cfb6c0f920328ec3
changeset:  315831486f3428dbb77170e9cfb6c0f920328ec3
user:       aleth <aleth@instantbird.org>
date:       Sat Jul 25 01:35:18 2015 +0200
Bug 1186463 - Handle XML namespaces and base64 parsing better to allow connecting to Slack XMPP gateway. r=clokep


2 years ago
Last Resolved: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 1.6

Comment 10

2 years ago
(In reply to Patrick Cloke [:clokep] from comment #8)
> It'd be nice to have some test cases for the base64 decoded data. Or at
> least attach it to this bug.

Sample base64 BINVAL with padding from Slack's XMPP:

We should consider adding tests.
Updating milestone from 1.6 to 42.
Target Milestone: 1.6 → Instantbird 42
You need to log in before you can comment on or make changes to this bug.