Subject: [xmpp] Client handling of stanzas with no 'from' attribute

From: Matthew Wild <[email-masked]>
Date: Wed, 16 Dec 2009 17:03:50 +0000

Hi,

This issue seems pretty clear-cut to me, but there seems to be some
dispute over the specs, which I'm hoping we can resolve.

The short backstory is that some of Prosody's users also use Process
One's "OneTeam" client for the iPhone, but they are finding that they
can't view avatars, either their own or of their contacts (thread:
http://www.process-one.net/en/forum/viewthread/275/ ).

It resulted in Prosody being blamed for the bug, and accused of not
being XMPP compliant:
http://www.process-one.net/en/forum/viewreply/1050/

This is apparently because it doesn't stamp the 'from' attribute on
stanzas that are handled by the server on behalf of a user, such as,
say... requesting one's own vcard.

OneTeam not handling these stanzas has previously been filed as a bug
here, which was argued against:
https://support.process-one.net/browse/OTIP-135

The relevant part of the specifications appears to be 3920bis-04,
section 9.1.2.1 point 3 (
http://tools.ietf.org/html/draft-ietf-xmpp-3920bis-04#section-9.1.2.1
) which says quite clearly (in my opinion):

When the server generates a stanza from the server for delivery
       to the client on behalf of the account of the connected client
       (e.g., in the context of data storage services provided by the
       server on behalf of the client), the stanza MUST either (a) not
       include a 'from' attribute or (b) include a 'from' attribute
       whose value is the account's bare JID (<localpart@domain>).

Prosody opts for (a). Am I the one going mad here? :)

Second opinions appreciated,
Matthew

---

From: Nicolas Vérité <[email-masked]>
Date: Wed, 16 Dec 2009 18:19:29 +0100

(Let alone the way Maranda is aggressive, but Matt you could have
contacted us directly to resolve that issue between us silently)

Your are pointing to the RFCbis, which is not accepted yet.

In the RFC3920, accepted and widely deployed:

==

When a server receives an XML stanza within the context of an
authenticated stream qualified by the 'jabber:client' namespace, it
MUST do one of the following:

   1. validate that the value of the 'from' attribute provided by the
client is that of a connected resource for the associated entity
   2. add a 'from' address to the stanza whose value is the bare JID
(<node@domain>) or the full JID (<node@domain/resource>) determined by
the server for the connected resource that generated the stanza (see
Determination of Addresses (Determination of Addresses))

[...]

When a server generates a stanza from the server itself for delivery
to a connected client (e.g., in the context of data storage services
provided by the server on behalf of the client), the stanza MUST
either (1) not include a 'from' attribute or (2) include a 'from'
attribute whose value is the account's bare JID (<node@domain>) or
client's full JID (<node@domain/resource>). A server MUST NOT send to
the client a stanza without a 'from' attribute if the stanza was not
generated by the server itself.

[...]

When a client receives a stanza that does not include a 'from'
attribute, it MUST assume that the stanza is from the server to which
the client is connected.

==

Whatever, this is fixed in the code, and will be sent to the AppStore,
and this will be available... who knows when?

On Wed, Dec 16, 2009 at 18:03, Matthew Wild <[email-masked]> wrote:
> _______________________________________________
> xmpp mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/xmpp
>

-- 
Nicolas Vérité - ProcessOne
http://process-one.net
Mobile: +33 6 20 88 63 04

---

From: Matthew Wild <[email-masked]>
Date: Wed, 16 Dec 2009 17:32:29 +0000

> contacted us directly to resolve that issue between us silently)

Hmm, why silently? The more opinions the better, we clearly disagree
and between that thread and the bug report, P1 made clear its stance.
This is an open protocol and open software, let's develop and improve
it, openly :)

> In the RFC3920, accepted and widely deployed:

<snip>

> attribute, it MUST assume that the stanza is from the server to which

Ok, so your point is... it says exactly the same. So I guess you're
saying you agree with my interpretation of the specs, and that what
Prosody is doing is valid XMPP?

> and this will be available... who knows when?

Excellent news, thanks.

Matthew

---

From: Peter Saint-Andre <[email-masked]>
Date: Wed, 16 Dec 2009 20:23:12 -0700

On 12/16/09 10:32 AM, Matthew Wild wrote:
> Ok, so your point is... it says exactly the same.

As far as I can see there's no material difference between RFC 3920 and
draft-ietf-xmpp-3920bis on this point. If you think that's wrong, please
let me know.

Peter

-- 
Peter Saint-Andre
https://stpeter.im/