To fend off xmpp spam, I use xep-0016 privacy list, that allows messages from contacts with mutual subscriptions (plus from muc servers), and denies by default:
<!-- Outgoing Sun 15 Jul 2018 14:19:00 CEST -->
<iq xmlns="jabber:client" type="get" id="1ebf80d8-0997-479a-803f-46eb5e635001" from="egc@average.org/gajim.1ZZTNLAD">
<query xmlns="jabber:iq:privacy" />
</iq>
<!-- Outgoing Sun 15 Jul 2018 14:19:00 CEST -->
<r xmlns="urn:xmpp:sm:3" />
<!-- Incoming Sun 15 Jul 2018 14:19:00 CEST -->
<iq xml:lang='en' to='egc@average.org/gajim.1ZZTNLAD' from='egc@average.org' type='result' id='1ebf80d8-0997-479a-803f-46eb5e635001'>
<query xmlns='jabber:iq:privacy'>
<active name='Antispam'/>
<default name='Antispam'/>
<list name='Antispam'/>
</query>
</iq>
<!-- Incoming Sun 15 Jul 2018 14:19:00 CEST -->
<r xmlns='urn:xmpp:sm:3'/>
<!-- Outgoing Sun 15 Jul 2018 14:19:00 CEST -->
<a xmlns="urn:xmpp:sm:3" h="127" />
<!-- Incoming Sun 15 Jul 2018 14:19:00 CEST -->
<a h='106' xmlns='urn:xmpp:sm:3'/>
<!-- Outgoing Sun 15 Jul 2018 14:19:50 CEST -->
<iq xmlns="jabber:client" type="get" id="37a7c289-1e95-4531-b892-7c46d8bf6f07" from="egc@average.org/gajim.1ZZTNLAD">
<query xmlns="jabber:iq:privacy">
<list name="Antispam" />
</query>
</iq>
<!-- Outgoing Sun 15 Jul 2018 14:19:50 CEST -->
<r xmlns="urn:xmpp:sm:3" />
<!-- Incoming Sun 15 Jul 2018 14:19:50 CEST -->
<iq xml:lang='en' to='egc@average.org/gajim.1ZZTNLAD' from='egc@average.org' type='result' id='37a7c289-1e95-4531-b892-7c46d8bf6f07'>
<query xmlns='jabber:iq:privacy'>
<list name='Antispam'>
<item order='9' action='deny'/>
<item value='both' type='subscription' order='8' action='allow'/>
<item value='conference.average.org' type='jid' order='3' action='allow'/>
<item value='conference.jabber.ru' type='jid' order='2' action='allow'/>
<item value='conference.siacs.eu' type='jid' order='1' action='allow'/>
</list>
</query>
</iq>
This worked as expected in jabberd2 server. But on ejabberd server, it blocks all communication. When I send anything to a contact (with subscription "Both"), I get this error:
[14:04:37] egc: peep
[14:05:08] Your active privacy list has denied the routing of this stanza.
What's wrong?