Question

I read somewhere a while ago that one can configure external jabber components (XEP-0114) to send XMPP stanza's on behalf on any user. For instance say i have a component bind to (component.localhost) and i want it to send a message stanza with "from" attribute set to "user@localhost".

I am trying to achieve this with ejabberd. Won't be surprised if I will have to hack down ejabberd src to get this working (if at all possible).

Was it helpful?

Solution

If you are using ejabberd, you can use the {service_check_from, false} option in your service definition to disable the verification on the "from" attribute.

Keep in mind, though, that XEP 0114 requires that the "host" part of the JIDs match the name of the component.

See the corresponding section of ejabberd documentation for all the gory details.

OTHER TIPS

Technically, you have to actually write the component, but this can easily be done. You have first to confugre ejabberd so that it accepts connections on a specific for your component, with a given componet JID and a password. The default configuration file has several examples, for gateways for example.

Once this is done, connect an XMPP library/client with this component's credential and you should be good to go! The only constraint is that you send valid XML.

Your component will typically only be allowed to send stanzas appearing to be from *@component.domain.com, rather than @.domain.com. This is a security feature.

If you want this functionality, you may have to write a server plugin rather than an external component.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top