How do I use router-filter (to block MSN subscription requests)?

Asked by Adam J Richardson

I'm using Jabberd2 v2.2.8 on Ubuntu Server 10.04. I'm the only user.

I'm getting a lot of subscription requests from MSN. They are spam (or spim?). I want to block them. I found the router-filter.xml file. It looks ideal for this purpose.

This is my current attempt at a rule to block MSN subscription requests:

<rule from="*%hotmail.com[at]msn.my.domain.tld" to="*" what="subscription='none'" error="not-acceptable" log="yes"/>

(Please replace "[at]" in the above with the actual "at" symbol. Launchpad seems to scrub it.)

I don't really know what goes in 'what', beyond an "XPath like query". I don't know what the 'error' should be either: "not-acceptable", "forbidden", or something else?

Can someone direct me to some documentation explaining router-filter or modify my rule?

Thanks for any help.

Question information

Language:
English Edit question
Status:
Solved
For:
Jabberd Edit question
Assignee:
No assignee Edit question
Solved by:
Tomasz Sterna
Solved:
Last query:
Last reply:
Revision history for this message
Tomasz Sterna (smoku) said :
#1

"XPath like query" is exactly what it says. You may read about XPath here: http://xmpp.org/rfcs/rfc3920.html#rfc.section.4.7.3
The list of XMPP errors is in RFC: http://xmpp.org/rfcs/rfc3920.html#rfc.section.4.7.3

Revision history for this message
Tomasz Sterna (smoku) said :
#2

"XPath like query" is exactly what it says. You may read about XPath here: http://www.w3schools.com/XPath/xpath_syntax.asp
The list of XMPP errors is in RFC: http://xmpp.org/rfcs/rfc3920.html#rfc.section.4.7.3

Revision history for this message
Adam J Richardson (fatman-crackmonkey) said :
#3

Hi Tomasz,

Thanks for the reply. I know what XPath is, but what document am I parsing with it?

Regards,
Adam J Richardson

Revision history for this message
Best Tomasz Sterna (smoku) said :
#4

Oh sorry. This is so obvious to me, that I forgot to mention.
The "document" parsed is XMPP stanza. You may read more on stanzas in... RFC :D
http://xmpp.org/rfcs/rfc3921.html#stanzas

I think the query you're looking for is: what="presence?type=subscribe"

Revision history for this message
Adam J Richardson (fatman-crackmonkey) said :
#5

That looks like the one I need! Thanks.

Revision history for this message
Adam J Richardson (fatman-crackmonkey) said :
#6

Thanks Tomasz Sterna, that solved my question.