Internet Engineering Task Force (IETF) R. George Request for Comments: 6132 B. Leiba Category: Standards Track Huawei Technologies ISSN: 2070-1721 July 2011
Internet Engineering Task Force (IETF) R. George Request for Comments: 6132 B. Leiba Category: Standards Track Huawei Technologies ISSN: 2070-1721 July 2011
Sieve Notification Using Presence Information
使用状态信息筛选通知
Abstract
摘要
This is a further extension to the Sieve mail filtering language Notification extension, defining presence information that may be checked through the notify_method_capability feature.
这是对Sieve邮件过滤语言通知扩展的进一步扩展,定义了可通过notify_method_功能检查的状态信息。
Status of This Memo
关于下段备忘
This is an Internet Standards Track document.
这是一份互联网标准跟踪文件。
This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 5741.
本文件是互联网工程任务组(IETF)的产品。它代表了IETF社区的共识。它已经接受了公众审查,并已被互联网工程指导小组(IESG)批准出版。有关互联网标准的更多信息,请参见RFC 5741第2节。
Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at http://www.rfc-editor.org/info/rfc6132.
有关本文件当前状态、任何勘误表以及如何提供反馈的信息,请访问http://www.rfc-editor.org/info/rfc6132.
Copyright Notice
版权公告
Copyright (c) 2011 IETF Trust and the persons identified as the document authors. All rights reserved.
版权所有(c)2011 IETF信托基金和确定为文件作者的人员。版权所有。
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.
本文件受BCP 78和IETF信托有关IETF文件的法律规定的约束(http://trustee.ietf.org/license-info)自本文件出版之日起生效。请仔细阅读这些文件,因为它们描述了您对本文件的权利和限制。从本文件中提取的代码组件必须包括信托法律条款第4.e节中所述的简化BSD许可证文本,并提供简化BSD许可证中所述的无担保。
Table of Contents
目录
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.1. Terminology Used in This Document . . . . . . . . . . . . . 2 2. Testing Presence Information . . . . . . . . . . . . . . . . . 2 3. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 4. Security Considerations . . . . . . . . . . . . . . . . . . . . 6 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . . 6 6. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . 7 7. References . . . . . . . . . . . . . . . . . . . . . . . . . . 7 7.1. Normative References . . . . . . . . . . . . . . . . . . . 7 7.2. Informative References . . . . . . . . . . . . . . . . . . 8
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.1. Terminology Used in This Document . . . . . . . . . . . . . 2 2. Testing Presence Information . . . . . . . . . . . . . . . . . 2 3. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 4. Security Considerations . . . . . . . . . . . . . . . . . . . . 6 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . . 6 6. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . 7 7. References . . . . . . . . . . . . . . . . . . . . . . . . . . 7 7.1. Normative References . . . . . . . . . . . . . . . . . . . 7 7.2. Informative References . . . . . . . . . . . . . . . . . . 8
Sometimes, it's desirable to tailor Sieve [RFC5228] notifications to a user's current situation. Presence information provides some information about the user that would be useful to have access to in these cases. The Notification extension [RFC5435] defines a mechanism to test for presence (the notify_method_capability feature), and defines one test for presence (the "online" notification-capability, described in Section 5 of RFC 5435). This extension defines more presence tests by registering additional notification-capability parameters in the IANA registry, allowing testing of a wider variety of presence information.
有时,需要根据用户的当前情况定制筛选[RFC5228]通知。状态信息提供了一些关于用户的信息,在这些情况下可以访问这些信息。通知扩展[RFC5435]定义了一种测试存在性的机制(notify_method_功能),并定义了一种存在性测试(“在线”通知功能,如RFC 5435第5节所述)。此扩展通过在IANA注册表中注册额外的通知功能参数来定义更多的状态测试,从而允许测试更广泛的状态信息。
The upper-case key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119].
本文件中大写关键字“必须”、“不得”、“必需”、“应”、“不应”、“应”、“不应”、“建议”、“可”和“可选”应按照[RFC2119]中的说明进行解释。
This extension uses the notify_method_capability test, as defined in the Sieve [RFC5228] Notify extension [RFC5435], to test presence information. When a Sieve event occurs (mail arrives) for a user, a Sieve script running on behalf of that user can present the user's presence URI (in the "notification-uri" parameter) and test a specific item of notification presence as defined below (in the "notification-capability" parameter) against one or more values (in the "key-list" parameter).
此扩展使用在筛[RFC5228]通知扩展[RFC5435]中定义的通知方法能力测试来测试存在信息。当用户发生筛选事件(邮件到达)时,代表该用户运行的筛选脚本可以显示用户的状态URI(在“notification URI”参数中),并根据一个或多个值(在“key list”参数中)测试下面定义的特定通知状态项(在“notification capability”参数中)。
This document defines an initial set of items of notification presence, which may be specified in the notification-capability parameter. It is expected that future extensions will add additional presence items derived from diverse sources, including calendar information, geographic location, and so on.
本文档定义了通知状态的初始项集,可在通知能力参数中指定。预计未来的扩展将添加来自不同来源的其他状态项,包括日历信息、地理位置等。
Note that, while the items below are documented as similar to items in Extensible Messaging and Presence Protocol (XMPP) [RFC6121], it is not the intent that this extension be tied to XMPP, nor to any particular source of presence, and flexible implementations will be ready for future extensions. Useful informational references for presence data and formats include Presence Information Data Format (PIDF) [RFC3863], RPID: Rich Presence Extensions to PIDF [RFC4480], and GEOPRIV Presence Information Data Format Location Object (PIDF-LO) [RFC5491].
请注意,虽然下面的项目与可扩展消息传递和状态协议(XMPP)[RFC6121]中的项目类似,但并不打算将此扩展绑定到XMPP,也不绑定到任何特定的状态源,灵活的实现将为将来的扩展做好准备。状态数据和格式的有用信息参考包括状态信息数据格式(PIDF)[RFC3863]、RPID:PIDF的丰富状态扩展[RFC4480]和GEOPRIV状态信息数据格式位置对象(PIDF-LO)[RFC5491]。
The script tests the values of notification presence items in the key-list parameter. The values that each item may have are specified in the list below. Note that in addition to the presence values, any item may have the value "unknown" if it is not possible to determine the correct presence value of the item.
该脚本测试键列表参数中通知状态项的值。每个项目可能具有的值在下面的列表中指定。注意,除了存在值之外,如果无法确定项目的正确存在值,则任何项目都可能具有“未知”值。
If a particular presence item is tested multiple times within the same script execution context, implementations MUST present the same value each time (for example, by caching the value on first use). This provides consistency within a single execution.
如果在同一脚本执行上下文中多次测试特定的状态项,则每次实现都必须呈现相同的值(例如,通过在第一次使用时缓存该值)。这在单个执行中提供了一致性。
Supported presence items are as follows:
支持的状态项如下所示:
busy: An indication of whether the user is considered "busy" now (the value "yes") or not (the value "no"), or "unknown" if it cannot be determined. The meaning of "busy" is left to the implementation, and may be a state that's synthesized from other information (including "show", below).
忙:表示用户现在是否被视为“忙”(值“是”)或“不忙”(值“否”),如果无法确定,则表示“未知”。“忙”的含义留给实现,可能是从其他信息合成的状态(包括下面的“show”)。
show: The availability status of the user, formally specified. Note that this is similar to the presence element with the same name that's defined in Section 4.7.2.1 of RFC 6121 [RFC6121]. The value of this item is one of the following:
显示:正式指定的用户的可用性状态。注意,这类似于RFC 6121[RFC6121]第4.7.2.1节中定义的同名存在元素。此项的值为以下值之一:
away: The user is temporarily away.
离开:用户暂时离开。
chat: The user is online and actively interested in chatting.
聊天:用户在线并且对聊天非常感兴趣。
dnd: Do Not Disturb; the user does not wish to be disturbed now.
dnd:请勿打扰;用户现在不希望受到干扰。
offline: The user is offline.
脱机:用户处于脱机状态。
xa: The user is away for an extended period (xa = "eXtended Away").
xa:用户离开一段较长的时间(xa=“延长离开”)。
unknown: The correct presence value could not be determined.
未知:无法确定正确的存在值。
status: A human-readable description of the user's availability status, in natural language. There is no formal definition for the values this item may take. It is free-form, and may be in any language. Direct comparisons against the value of this field are unlikely to be useful; rather, it is provided to enable extraction of the value into a variable [RFC5229] for use elsewhere (see example 3 in Section 3). Note that this is similar to the presence element with the same name that's defined in Section 4.7.2.2 of RFC 6121 [RFC6121], and to the <note> element defined in section 4.1.6 of PIDF [RFC3863].
状态:以自然语言对用户可用性状态的可读描述。此项可能采用的值没有正式定义。它是自由形式的,可以是任何语言。与该字段的值进行直接比较不太可能有用;相反,它是用来将值提取到变量[RFC5229]中,以便在其他地方使用(参见第3节中的示例3)。注意,这类似于RFC 6121[RFC6121]第4.7.2.2节中定义的同名存在元素,以及PIDF[RFC3863]第4.1.6节中定义的<Note>元素。
Because this is a free-form value that might be created directly by a user, no value, including "unknown", can have any special meaning. If the Sieve processor is unable to determine the value of this item, it might be best to leave it as an empty string. In any case, it is not meant for machine-readable processing, beyond possible XML interpretation.
因为这是一个自由形式的值,可以由用户直接创建,所以任何值,包括“未知”都不能有任何特殊含义。如果筛选处理器无法确定此项的值,最好将其保留为空字符串。在任何情况下,除了可能的XML解释之外,它并不意味着用于机器可读的处理。
There is no capability string associated with this extension, but this requires support for "enotify" [RFC5435]. If the implementation does not support the item being tested (that is, the specified notification-capability item is not known to the Sieve interpreter), RFC 5435 already specifies that the test fail without an error.
没有与此扩展关联的功能字符串,但这需要支持“enotify”[RFC5435]。如果实现不支持正在测试的项(即,指定的通知功能项对于Sieve解释器来说是未知的),RFC 5435已经指定测试失败,并且没有错误。
Although this feature was conceived to assist in notifications, and the test requires support of the Sieve Notify feature, it is only a condition test, and any Sieve action can appear inside it. There are no Sieve actions that conflict with this extension.
尽管此功能旨在帮助通知,并且测试需要支持筛通知功能,但它只是一个条件测试,任何筛动作都可以出现在其中。没有与此扩展冲突的筛选操作。
1. This example will send a notification only if the recipient is not "busy". If the test for "busy" is not supported, this example will not send a notification.
1. 此示例仅在收件人不“忙”时发送通知。如果不支持“忙”测试,则此示例将不发送通知。
require ["enotify"];
要求[“enotify”];
if notify_method_capability "xmpp:tim@example.com" "busy" "no" { notify :message "You got mail" "xmpp:tim@example.com?message;subject=SIEVE"; }
if notify_method_capability "xmpp:tim@example.com" "busy" "no" { notify :message "You got mail" "xmpp:tim@example.com?message;subject=SIEVE"; }
2. This example will send a notification only if the recipient is not "busy". If the test for "busy" is not supported, this example will send a notification.
2. 此示例仅在收件人不“忙”时发送通知。如果不支持“忙”测试,此示例将发送通知。
require ["enotify"];
要求[“enotify”];
if not notify_method_capability "xmpp:tim@example.com" "busy" "yes" { notify :message "You got mail" "xmpp:tim@example.com?message;subject=SIEVE"; }
if not notify_method_capability "xmpp:tim@example.com" "busy" "yes" { notify :message "You got mail" "xmpp:tim@example.com?message;subject=SIEVE"; }
3. This example uses the vacation extension [RFC5230] to generate an auto-reply [RFC6133] if the sender is in the recipient's address book [RFC6134] and the recipient's presence shows "extended away". The variables extension [RFC5229] is used to extract the value of the recipient's presence status message, which will be used in the response to the sender. If the test for "show" is not supported, this example will not send an auto-reply.
3. 此示例使用假期扩展[RFC5230]生成自动回复[RFC6133],前提是发件人位于收件人的通讯簿[RFC6134]中,并且收件人的状态显示为“已扩展”。变量扩展[RFC5229]用于提取收件人状态消息的值,该值将用于对发件人的响应。如果不支持“show”测试,则本例将不会发送自动回复。
require ["extlists", "vacation", "enotify", "variables"];
需要[“ExtList”、“休假”、“enotify”、“变量”];
if allof ( envelope :list "from" ":addrbook:default", notify_method_capability "xmpp:myjid@example.com" "show" "xa" ) { # :matches "*" is used here to extract the value if notify_method_capability :matches "xmpp:myjid@example.com" "status" "*" { set "resp_msg" "${1}"; } else { set "resp_msg" "I'm away from email for a while." } vacation :handle "ext-away" "${resp_msg}"; }
if allof ( envelope :list "from" ":addrbook:default", notify_method_capability "xmpp:myjid@example.com" "show" "xa" ) { # :matches "*" is used here to extract the value if notify_method_capability :matches "xmpp:myjid@example.com" "status" "*" { set "resp_msg" "${1}"; } else { set "resp_msg" "I'm away from email for a while." } vacation :handle "ext-away" "${resp_msg}"; }
Security considerations for Sieve [RFC5228] and the Notify extension [RFC5435] apply equally here. In addition, implementations MUST ensure that users cannot create scripts that access the presence information of others without the proper access controls.
筛[RFC5228]和通知扩展[RFC5435]的安全注意事项同样适用于此处。此外,实现必须确保用户在没有适当的访问控制的情况下无法创建访问他人状态信息的脚本。
In some situations, scripts may act on some of the recipient's presence information that the sender of the triggering message is not allowed to see. This can be a benefit to the recipient in many cases, but it can also present an opportunity for a sender to use messages to probe the recipient's presence (if, for example, messages sometimes result in auto-replies, and sometimes do not). Script authors should take care in considering this aspect of presence-triggered actions.
在某些情况下,脚本可能会作用于某些收件人的状态信息,而触发消息的发件人不允许看到这些信息。在许多情况下,这对收件人来说都是一个好处,但它也为发件人提供了一个机会,让他们可以使用邮件来探测收件人的存在(例如,如果邮件有时会导致自动回复,有时则不会)。脚本作者在考虑存在触发动作的这一方面时应该小心。
It's possible for a large number of messages to arrive at or around the same time and be processed by Sieve scripts that all test presence. If many of the users share the same presence server, such a burst could put an unexpectedly heavy load on the presence server. Implementations might consider providing options for rate limiting, or for caching presence tests for periods of time, even across Sieve script instances. When caching presence tests, the server must be careful not to violate access controls that the presence server might have. Thus, cached results MUST NOT be used outside the context in which they were retrieved. If, for example, a script running on behalf of Adam requests presence information for Barbara, that information MAY be cached for a future script running on behalf of Adam, but MUST NOT be used to satisfy the same query in a script running on behalf of Cindy -- because the presence server will have to decide whether Cindy has access to that information.
大量消息可能同时到达或大约同时到达,并由所有测试是否存在的筛选脚本进行处理。如果许多用户共享同一个状态服务器,这样的突发可能会给状态服务器带来意外的沉重负载。实现可能考虑为速率限制提供选项,或者在一段时间内缓存存在性测试,甚至跨越筛选器脚本实例。缓存状态测试时,服务器必须小心,不要违反状态服务器可能具有的访问控制。因此,缓存的结果不能在检索它们的上下文之外使用。例如,如果代表Adam运行的脚本请求Barbara的状态信息,则该信息可能会被缓存以供将来代表Adam运行的脚本使用,但不能用于在代表Cindy运行的脚本中满足相同的查询,因为状态服务器必须决定Cindy是否有权访问该信息。
This registers each presence item as a notification-capability parameter. Future extensions that add new presence items should register those items similarly, using the instructions in Section 9.3 of RFC 5435 [RFC5435].
这会将每个状态项注册为通知功能参数。添加新存在项的未来扩展应使用RFC 5435[RFC5435]第9.3节中的说明,以类似方式注册这些项。
To: iana@iana.org Subject: Registration of a new notification-capability parameter Capability name: busy Description: An indication of whether the user is considered "busy" now (the value "yes") or not (the value "no"). The meaning of "busy" is left to the implementation, and may be a state that's synthesized from other information. Syntax: Has one of the values "yes", "no", or "unknown". The value MUST be in lower case.
致:iana@iana.org主题:注册新的通知功能参数功能名称:忙描述:指示用户现在是否被视为“忙”(值“是”)(值“否”)。“忙”的含义留给实现,可能是从其他信息合成的状态。语法:具有值“是”、“否”或“未知”之一。该值必须为小写。
Permanent and readily available reference(s): RFC 6132 Contact information: The Sieve discussion list, <sieve@ietf.org>
Permanent and readily available reference(s): RFC 6132 Contact information: The Sieve discussion list, <sieve@ietf.org>
To: iana@iana.org Subject: Registration of a new notification-capability parameter Capability name: show Description: The availability status of the user. This is similar to the presence element with the same name that's defined in Section 4.7.2.1 of RFC 6121. Syntax: Has one of the values "away", "chat", "dnd", "offline", "xa", or "unknown". The value MUST be in lower case. Permanent and readily available reference(s): RFC 6132 Contact information: The Sieve discussion list, <sieve@ietf.org>
To: iana@iana.org Subject: Registration of a new notification-capability parameter Capability name: show Description: The availability status of the user. This is similar to the presence element with the same name that's defined in Section 4.7.2.1 of RFC 6121. Syntax: Has one of the values "away", "chat", "dnd", "offline", "xa", or "unknown". The value MUST be in lower case. Permanent and readily available reference(s): RFC 6132 Contact information: The Sieve discussion list, <sieve@ietf.org>
To: iana@iana.org Subject: Registration of a new notification-capability parameter Capability name: status Description: A human-readable description of the user's availability status. This is similar to the presence element with the same name that's defined in Section 4.7.2.2 of RFC 6121. Syntax: There is no formal definition for the values this item may take. It is free-form and may be in any language, and is meant for human consumption. Permanent and readily available reference(s): RFC 6132 Contact information: The Sieve discussion list, <sieve@ietf.org>
致:iana@iana.org主题:注册新的通知功能参数功能名称:状态描述:用户可用性状态的可读描述。这类似于RFC 6121第4.7.2.2节中定义的同名存在元素。语法:此项可能采用的值没有正式定义。它是自由形式的,可以是任何语言,并且是供人类消费的。永久和现成的参考资料:RFC 6132联系信息:筛讨论列表<sieve@ietf.org>
The authors thank Alexey Melnikov for significant early feedback and suggestions.
作者感谢Alexey Melnikov提供了重要的早期反馈和建议。
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.
[RFC2119]Bradner,S.,“RFC中用于表示需求水平的关键词”,BCP 14,RFC 2119,1997年3月。
[RFC5228] Guenther, P. and T. Showalter, "Sieve: An Email Filtering Language", RFC 5228, January 2008.
[RFC5228]Guenther,P.和T.Showalter,“筛选:电子邮件过滤语言”,RFC 5228,2008年1月。
[RFC5435] Melnikov, A., Leiba, B., Segmuller, W., and T. Martin, "Sieve Email Filtering: Extension for Notifications", RFC 5435, January 2009.
[RFC5435]Melnikov,A.,Leiba,B.,Segmuller,W.,和T.Martin,“筛选电子邮件过滤:通知扩展”,RFC 54352009年1月。
[RFC6121] Saint-Andre, P., "Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence", RFC 6121, March 2011.
[RFC6121]圣安德烈,P.,“可扩展消息和状态协议(XMPP):即时消息和状态”,RFC61212011年3月。
[RFC3863] Sugano, H., Fujimoto, S., Klyne, G., Bateman, A., Carr, W., and J. Peterson, "Presence Information Data Format (PIDF)", RFC 3863, August 2004.
[RFC3863]Sugano,H.,Fujimoto,S.,Klyne,G.,Batman,A.,Carr,W.,和J.Peterson,“状态信息数据格式(PIDF)”,RFC 38632004年8月。
[RFC4480] Schulzrinne, H., Gurbani, V., Kyzivat, P., and J. Rosenberg, "RPID: Rich Presence Extensions to the Presence Information Data Format (PIDF)", RFC 4480, July 2006.
[RFC4480]Schulzrinne,H.,Gurbani,V.,Kyzivat,P.,和J.Rosenberg,“RPID:状态信息数据格式(PIDF)的丰富状态扩展”,RFC 44802006年7月。
[RFC5229] Homme, K., "Sieve Email Filtering: Variables Extension", RFC 5229, January 2008.
[RFC5229]Homme,K.,“筛选电子邮件过滤:变量扩展”,RFC5292008年1月。
[RFC5230] Showalter, T. and N. Freed, "Sieve Email Filtering: Vacation Extension", RFC 5230, January 2008.
[RFC5230]Showalter,T.和N.Freed,“筛选电子邮件过滤:假期延长”,RFC 5230,2008年1月。
[RFC5491] Winterbottom, J., Thomson, M., and H. Tschofenig, "GEOPRIV Presence Information Data Format Location Object (PIDF-LO) Usage Clarification, Considerations, and Recommendations", RFC 5491, March 2009.
[RFC5491]Winterbottom,J.,Thomson,M.,和H.Tschofenig,“GEOPRIV存在信息数据格式位置对象(PIDF-LO)使用说明、注意事项和建议”,RFC 54912009年3月。
[RFC6133] George, R., Leiba, B., and A. Melnikov, "Sieve Email Filtering: Use of Presence Information with Auto-Responder Functionality", RFC 6134, July 2011.
[RFC6133]George,R.,Leiba,B.,和A.Melnikov,“筛选电子邮件过滤:使用状态信息和自动响应功能”,RFC 61342011年7月。
[RFC6134] Melnikov, A. and B. Leiba, "Sieve Extension: Externally Stored Lists", RFC 6134, July 2011.
[RFC6134]Melnikov,A.和B.Leiba,“筛子扩展:外部存储列表”,RFC 61342011年7月。
Authors' Addresses
作者地址
Robins George Huawei Technologies Bangalore, Karnataka 560071 India
罗宾斯乔治华为技术有限公司印度卡纳塔克邦班加罗尔560071
Phone: +91-080-41117676 EMail: robinsgv@gmail.com
Phone: +91-080-41117676 EMail: robinsgv@gmail.com
Barry Leiba Huawei Technologies
巴里·雷巴华为技术有限公司
Phone: +1 646 827 0648 EMail: barryleiba@computer.org URI: http://internetmessagingtechnology.org/
Phone: +1 646 827 0648 EMail: barryleiba@computer.org URI: http://internetmessagingtechnology.org/