My ejabberd version is 19.08.
With enabled mod_block_strangers
error stanzas haven't been received.
Sending message to outside recipient (not local jabber) Example of out stanza with mod_block_strangers=on
<message to="615970@676373647364.com" id="aad7a">
<subject>test</subject>
<body>test</body>
<nick xmlns="http://jabber.org/protocol/nick">bot</nick>
</message>
XMPP isn't local. There is no error stanza. Should be, because this domain doesn't exist.
Example of out stanza with mod_block_strangers=off
<message type="chat" to="615970@676373647364.com" id="aadaa">
<body>test</body>
<active xmlns="http://jabber.org/protocol/chatstates"/>
<request xmlns="urn:xmpp:receipts"/>
<nick xmlns="http://jabber.org/protocol/nick">bot</nick>
</message>
<message from="615970@676373647364.com" type="error" xml:lang="ru" to="bot@*" id="aadaa">
<active xmlns="http://jabber.org/protocol/chatstates"/>
<request xmlns="urn:xmpp:receipts"/>
<nick xmlns="http://jabber.org/protocol/nick">bot</nick>
<error type="cancel" code="404">
<remote-server-not-found xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
<text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" xml:lang="en">DNS lookup failed: non-existing domain</text>
</error>
<body>test</body>
</message>
On the local xmpp's no such problem. Everything is okay. I think, it's because allow_local_users, that by default is 'true'. Example of stanza with local domain:
<message to="549725985745@localdomain" id="aadea">
<subject>test</subject>
<body>test</body>
<nick xmlns="http://jabber.org/protocol/nick">bot</nick>
</message>
<message from="549725985745@localdomain" type="error" xml:lang="ru" to="bot@localdomain/Psi+" id="aadea">
<nick xmlns="http://jabber.org/protocol/nick">bot</nick>
<error type="cancel" code="503">
<service-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
</error>
<body>test</body>
<subject>test</subject>
</message>
So if mod_block_strangers is enabled, we don't receive error stanza and error code from out server. Like, error msg is banning with message together.
Edit: updated to ejabberd 20.04. The same situation, no effect.