ejabberd - Comments for "Message packet rejected if to attribute contains Resource" https://www.ejabberd.im/node/3302 en clarification https://www.ejabberd.im/node/3302#comment-53813 <p>Thanks for the comment.</p> <p>The original samples I posted did have the "/" the wrong way.<br /> This mistake does not occur in my code and occured only becuase I mistyped the sample during my post.<br /> If you look at the clarrify samples (where I copied and pasted the XML directly) you will notice that the JID is formatted correctly.</p> <p>so I am still at a loss as to the source of the problem.</p> <p>Casey</p> Thu, 04 Dec 2008 13:52:23 +0000 BCaseyHanks comment 53813 at https://www.ejabberd.im All works correctly for me! https://www.ejabberd.im/node/3302#comment-53809 <p>I use ejabberd trunk SVN, and two Tkabber 0.12.0 clients. All works correctly here.</p> <div class="quote-msg"> <div class="quote-author"><em>BCaseyHanks</em> wrote:</div> <p>The following message is not being delivered by the server:<br /> <div class="codeblock"><code>&lt;message id=&quot;JN_26&quot; from=&quot;chanks@v-doc-imchat.infoassure.local&quot; to=&quot;btroxell@v-doc-imchat.infoassure.local&quot;&gt;&lt;x jid=&quot;room1@conference.v-doc-imchat.infoassure.local&quot; xmlns=&quot;jabber:x:conference&quot; /&gt;&lt;/message&gt;</code></div> </p></div> <p>chanks sends:</p> <div class="codeblock"><code>&lt;message id=&quot;JN_26&quot; from=&quot;chanks@v-doc-imchat.infoassure.local&quot; <br />to=&quot;btroxell@v-doc-imchat.infoassure.local&quot;&gt;<br />&lt;x jid=&quot;room1@conference.v-doc-imchat.infoassure.local&quot; xmlns=&quot;jabber:x:conference&quot; /&gt;<br />&lt;/message&gt;</code></div> <p>btroxell receives:</p> <div class="codeblock"><code>&lt;message from=&#039;chanks@v-doc-imchat.infoassure.local/N2K&#039;<br /> id=&#039;JN_26&#039;<br /> xml:lang=&#039;es&#039;<br /> to=&#039;btroxell@v-doc-imchat.infoassure.local&#039;&gt;<br />&nbsp; &lt;x xmlns=&#039;jabber:x:conference&#039;<br /> jid=&#039;room1@conference.v-doc-imchat.infoassure.local&#039;/&gt;<br />&lt;/message&gt;</code></div> <div class="quote-msg"> <div class="quote-author"><em>BCaseyHanks</em> wrote:</div> <p>The following message is also not being delivered:<br /> <div class="codeblock"><code>&lt;message id=&quot;JN_27&quot; to=&quot;btroxell@v-doc-imchat.infoassure.local&quot; type=&quot;chat&quot; from=&quot;chanks@v-doc-imchat.infoassure.local/N2K&quot;&gt;&lt;thread&gt;5a72cf4a-cd21-46fa-bc0f-b0ea927bae73&lt;/thread&gt;&lt;body&gt;ping&lt;/body&gt;&lt;/message&gt;</code></div> </p></div> <p>chanks sends:</p> <div class="codeblock"><code>&lt;message id=&quot;JN_27&quot; to=&quot;btroxell@v-doc-imchat.infoassure.local&quot; type=&quot;chat&quot; <br />from=&quot;chanks@v-doc-imchat.infoassure.local/N2K&quot;&gt;<br />&lt;thread&gt;5a72cf4a-cd21-46fa-bc0f-b0ea927bae73&lt;/thread&gt;&lt;body&gt;ping&lt;/body&gt;&lt;/message&gt;</code></div> <p>btroxell receives:</p> <div class="codeblock"><code>&lt;message from=&#039;chanks@v-doc-imchat.infoassure.local/N2K&#039;<br /> id=&#039;JN_27&#039;<br /> xml:lang=&#039;es&#039;<br /> type=&#039;chat&#039;<br /> to=&#039;btroxell@v-doc-imchat.infoassure.local&#039;&gt;<br />&nbsp; &lt;thread&gt;5a72cf4a-cd21-46fa-bc0f-b0ea927bae73&lt;/thread&gt;<br />&nbsp; &lt;body&gt;ping&lt;/body&gt;<br />&lt;/message&gt;</code></div> <div class="quote-msg"> <div class="quote-author"><em>BCaseyHanks</em> wrote:</div> <p>The following message IS being delivered:<br /> <div class="codeblock"><code>&lt;message id=&quot;JN_17&quot; to=&quot;chanks@v-doc-imchat.infoassure.local/N2K&quot; type=&quot;chat&quot; from=&quot;btroxell@v-doc-imchat.infoassure.local/N2K&quot;&gt;&lt;thread&gt;4b758a5d-b2ee-492a-9480-0e8d53aea307&lt;/thread&gt;&lt;body&gt;ping&lt;/body&gt;&lt;/message&gt;</code></div> </p></div> <p>chanks sends:</p> <div class="codeblock"><code>&lt;message id=&quot;JN_17&quot; to=&quot;chanks@v-doc-imchat.infoassure.local/N2K&quot; type=&quot;chat&quot; <br />from=&quot;btroxell@v-doc-imchat.infoassure.local/N2K&quot;&gt;<br />&lt;thread&gt;4b758a5d-b2ee-492a-9480-0e8d53aea307&lt;/thread&gt;&lt;body&gt;ping&lt;/body&gt;&lt;/message&gt;</code></div> <p>chanks receives:</p> <div class="codeblock"><code>&lt;message from=&#039;chanks@v-doc-imchat.infoassure.local/N2K&#039;<br /> id=&#039;JN_17&#039;<br /> xml:lang=&#039;es&#039;<br /> type=&#039;chat&#039;<br /> to=&#039;chanks@v-doc-imchat.infoassure.local/N2K&#039;&gt;<br />&nbsp; &lt;thread&gt;4b758a5d-b2ee-492a-9480-0e8d53aea307&lt;/thread&gt;<br />&nbsp; &lt;body&gt;ping&lt;/body&gt;<br />&lt;/message&gt;</code></div> <div class="quote-msg"> <div class="quote-author"><em>BCaseyHanks</em> wrote:</div> <p>The following message result in an error:<br /> <div class="codeblock"><code>&lt;message id=&quot;JN_24&quot; from=&quot;btroxell@v-doc-imchat.infoassure.local&quot; to=&quot;chanks@v-doc-imchat.infoassure.local\n2k&quot;&gt;&lt;x jid=&quot;room1@conference.v-doc-imchat.infoassure.local&quot; xmlns=&quot;jabber:x:conference&quot; /&gt;&lt;/message&gt;</code></div> </p></div> <p>That stanza has the To JID wrongly formed, as I explained before.</p> Thu, 04 Dec 2008 11:57:51 +0000 mfoss comment 53809 at https://www.ejabberd.im user@server/resource https://www.ejabberd.im/node/3302#comment-53808 <p>You made here a very simple mistake :)</p> <div class="quote-msg"> <div class="quote-author"><em>BCaseyHanks</em> wrote:</div> <div class="codeblock"><code>&lt;message id=&quot;JN_23&quot; from=&quot;source@server\custom&quot; to=&quot;destination@server\spark&quot;&gt;&lt;x jid=&quot;room1@server&quot; xmlns=&quot;jabber:x:conference&quot; /&gt;&lt;/message&gt;</code></div> </div> <p>In that XMPP stanza, the destination JID is user "destination" and server "server\spark". The separator for resource is /, not \. So you didn't build your destination JID correctly.</p> <p><noindex><a href="http://xmpp.org/rfcs/rfc3920.html#addressing" rel="nofollow" >XMPP-Core: Addressing Scheme</a></noindex></p> <pre>jid = [ node "@" ] domain [ "/" resource ]</pre><p> The sender JID is of course also wrong: "source@server\custom". However, ejabberd did not complain to you because ejabberd just throws the attribute "FROM" to the trash to avoid malicious users to fake their identity. I found this behaviour in <noindex><a href="http://xmpp.org/internet-drafts/draft-saintandre-rfc3920bis-08.html#stanzas-attributes-from-c2s" rel="nofollow" >XMPP-IM-bis: 9.1.2.1. Client-to-Server Streams</a></noindex>:</p> <div class="quote-msg"> <div class="quote-author">Quote:</div> <p>2. When the server receives an XML stanza from a client and the stanza includes a 'from' attribute, the server MUST either (a) [...] or (b) override the provided 'from' attribute by adding a 'from' attribute as specified under Rule #1.</p></div> Thu, 04 Dec 2008 11:36:24 +0000 mfoss comment 53808 at https://www.ejabberd.im clarification https://www.ejabberd.im/node/3302#comment-53804 <p>Suppose the following two clients are logged on:<br /> 1) IM custom (logged in as chanks@v-doc-imchat.infoassure.local\N2K)<br /> 2) IM custom (logged in as btroxell@v-doc-imchat.infoassure.local\N2K)</p> <p>The following message is not being delivered by the server:</p> <div class="codeblock"><code>&lt;message id=&quot;JN_26&quot; from=&quot;chanks@v-doc-imchat.infoassure.local&quot; to=&quot;btroxell@v-doc-imchat.infoassure.local&quot;&gt;&lt;x jid=&quot;room1@conference.v-doc-imchat.infoassure.local&quot; xmlns=&quot;jabber:x:conference&quot; /&gt;&lt;/message&gt;</code></div> <p>The following message is also not being delivered:</p> <div class="codeblock"><code>&lt;message id=&quot;JN_27&quot; to=&quot;btroxell@v-doc-imchat.infoassure.local&quot; type=&quot;chat&quot; from=&quot;chanks@v-doc-imchat.infoassure.local/N2K&quot;&gt;&lt;thread&gt;5a72cf4a-cd21-46fa-bc0f-b0ea927bae73&lt;/thread&gt;&lt;body&gt;ping&lt;/body&gt;&lt;/message&gt;</code></div> <p>The following message IS being delivered:</p> <div class="codeblock"><code>&lt;message id=&quot;JN_17&quot; to=&quot;chanks@v-doc-imchat.infoassure.local/N2K&quot; type=&quot;chat&quot; from=&quot;btroxell@v-doc-imchat.infoassure.local/N2K&quot;&gt;&lt;thread&gt;4b758a5d-b2ee-492a-9480-0e8d53aea307&lt;/thread&gt;&lt;body&gt;ping&lt;/body&gt;&lt;/message&gt;</code></div> <p>The following message result in an error:</p> <div class="codeblock"><code>&lt;message id=&quot;JN_24&quot; from=&quot;btroxell@v-doc-imchat.infoassure.local&quot; to=&quot;chanks@v-doc-imchat.infoassure.local\n2k&quot;&gt;&lt;x jid=&quot;room1@conference.v-doc-imchat.infoassure.local&quot; xmlns=&quot;jabber:x:conference&quot; /&gt;&lt;/message&gt;</code></div> <p>Message that comes back with error:</p> <div class="codeblock"><code>&lt;message from=&#039;chanks@v-doc-imchat.infoassure.local\n2k&#039; to=&#039;btroxell@v-doc-imchat.infoassure.local/N2K&#039; type=&#039;error&#039; id=&#039;JN_24&#039;&gt;&lt;x jid=&#039;room1@conference.v-doc-imchat.infoassure.local&#039; xmlns=&#039;jabber:x:conference&#039;/&gt;&lt;error code=&#039;404&#039; type=&#039;cancel&#039;&gt;&lt;remote-server-not-found xmlns=&#039;urn:ietf:params:xml:ns:xmpp-stanzas&#039;/&gt;&lt;/error&gt;&lt;/message&gt;</code></div> <p>Thus for my client</p> <p>Message packets without an x element are only delivered if the 'to' incluces the Resource<br /> Message packets with an x element generate an error if the 'to' includes the Resource<br /> Message packets with an x element seem to do nothing if the 'to' is a Bare JID</p> <p>Thanks,</p> <p>Casey</p> Wed, 03 Dec 2008 20:51:43 +0000 BCaseyHanks comment 53804 at https://www.ejabberd.im