在Openfire中拒绝来自非名册用户的邮件 [英] Deny messages from non-roster users in Openfire
问题描述
如何仅允许我的名单上的联系人向我发送消息? 是否有任何XEP负责这样做?还是我需要做这个客户端?
How do I only allow contacts who are on my roster list to send me messages? Is there any XEP responsible to do that? Or will I need to do this client-side?
推荐答案
是的,OpenFire支持 XEP -0016:隐私列表(请参见此问题),其中可以根据各种标准来阻止节.
Yes, OpenFire supports XEP-0016: Privacy Lists (see this question), which can be used to block stanzas according to various criteria.
您不能显式阻止不在您的花名册中的联系人节,但是您可以按订阅状态none
进行阻止,这可以或多或少地实现相同的目标.您可以发送如下内容:
You can't explicitly block stanzas for contacts not in your roster, but you can block by subscription status none
, which can more or less accomplish the same goal. You could send something like this:
<iq from='romeo@example.net/orchard' type='set' id='msg3'>
<query xmlns='jabber:iq:privacy'>
<list name='message-sub-example'>
<item type='subscription'
value='none'
action='deny'
order='5'>
<message/>
</item>
</list>
</query>
</iq>
这将创建一个名为message-sub-example
的隐私列表,其中包含一个规则,该规则将阻止来自订阅类型为none
的联系人的任何消息,包括不在名册中的联系人.为了使该列表生效,您需要使其成为活动列表:
This creates a privacy list called message-sub-example
, containing a rule to block any messages from contacts with subscription type none
, including contacts not in the roster. For this list to take effect, you need to make it the active list:
<iq from='romeo@example.net/orchard' type='set' id='active1'>
<query xmlns='jabber:iq:privacy'>
<active name='message-sub-example'/>
</query>
</iq>
这篇关于在Openfire中拒绝来自非名册用户的邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!