[Standards] forwarding stanzas when to=/from= values are absent

Kurt Zeilenga kurt.zeilenga at isode.com
Tue Nov 25 02:35:02 UTC 2014


> On Nov 24, 2014, at 4:40 PM, Graham King <graham at gkgk.org> wrote:
> 
> Is a message without to/from permitted, or possible?

Certainly some stanzas can have both or one of to/from absent.  XEP 297 can be used to forward any stanza, and in a wide range of contexts.  The requirements apply to all forwarding cases, not just client to client user-driven forwarding.

In IQ delegation that we support, our server forwards IQs generated by clients to another entity.  These IQs can have both to=/from= absent.   XEP 297 doesn’t say anything about how to identify the original sender and receiver.  While the receiver, the server, can be deduced by the receiver of the forwarded stanza, the from= cannot be.  So what we do is add both to=/form= attributes to the forwarded stanza when absent.  This removes ambiguity.

In the client to client forwarding case, the client receiving the forwarded stanza can generally derive the original sender/receiver that stanza by looking at the to/from of the stanza the forwarded stanza is delivered in.   But what if the sender of the stanza carrying the forwarded stanza was not the original sender and its server not the original receiver?   That is, maybe this sender was forwarding a forwarded stanza.    This doesn’t seem precluded by RFC 297.  The XEP doesn’t say anything about forwarding of forwarding stanzas, so it’s hard to know what an implementor should do either to forward a forwarded stanza or deal with a stanza which might be forwarded in such a manner.  Seems the second forwarder can do it two ways (forward the forwarded, forward the stanza carrying the forwarded), both seem consistent with the XEP (and consistent with the email analogy the XEP makes).   Which approach one takes probably depends on the details of the use case (just as in email).

Anyways, I’d prefer to require forwarders to always provide to/from attributes.

A related question, if a forwarder wants to forward a stanza but not disclose either the to=/from= address to the receiving entity, what should it do?

— Kurt


> I think the rules
> here http://xmpp.org/rfcs/rfc6120.html#stanzas-attributes would prevent it:
> 
> To: "A stanza with a specific intended recipient (e.g., a conversation
> partner, a remote service, the server itself, even another resource
> associated with the user's bare JID) MUST possess a 'to' attribute whose
> value is an XMPP address."
> 
> From: "When a server receives an XML stanza from a connected client, the
> server MUST add a 'from' attribute to the stanza"
> 
> Best regards,
> Graham
> 
> On 14-11-24 03:44 PM, Kurt Zeilenga wrote:
>> While XEP 297 states the following requirement:
>> 
>>  * The original sender and receiver should be identified.
>> 
>> It is not clear how this requirement is fulfilled when one wants to
>> forward the stanza:
>> <message><body>Hello</body></message>
>> 
>> how is the sender and receiver to be identified (when known to the
>> forwarding entity)?   Add to=/from=attributes with values implied when
>> absent?




More information about the Standards mailing list