?? rfc3028.txt
字號:
identifier = (ALPHA / "_") *(ALPHA DIGIT "_")
tag = ":" identifier
number = 1*DIGIT [QUANTIFIER]
QUANTIFIER = "K" / "M" / "G"
quoted-string = DQUOTE *CHAR DQUOTE
;; in general, \ CHAR inside a string maps to CHAR
;; so \" maps to " and \\ maps to \
;; note that newlines and other characters are all allowed
;; strings
multi-line = "text:" *(SP / HTAB) (hash-comment / CRLF)
*(multi-line-literal / multi-line-dotstuff)
"." CRLF
multi-line-literal = [CHAR-NOT-DOT *CHAR-NOT-CRLF] CRLF
multi-line-dotstuff = "." 1*CHAR-NOT-CRLF CRLF
;; A line containing only "." ends the multi-line.
;; Remove a leading '.' if followed by another '.'.
white-space = 1*(SP / CRLF / HTAB) / comment
8.2. 語法
濾網描述語言進行詞法分析后采用如下的語法結構,以下的陳述都不涉及空白字符或者
注釋成分,開始符號是“start”。
argument = string-list / number / tag
arguments = *argument [test / test-list]
block = "{" commands "}"
command = identifier arguments ( ";" / block )
commands = *command
start = commands
string = quoted-string / multi-line
string-list = "[" string *("," string) "]" / string ;; if
there is only a single string, the brackets are optional
test = identifier arguments
test-list = "(" test *("," test) ")"
9. 擴展的例子
下面是對濾網語言進行擴展的例子,注意其中沒有使用隱含留存。
#
# Example Sieve Filter
# Declare any optional features or extension used by the script
#
require ["fileinto", "reject"];
#
# Reject any large messages (note that the four leading dots get
# "stuffed" to three)
#
if size :over 1M
{
reject text:
Please do not send me large attachments.
Put your file on a server and send me the URL.
Thank you.
.... Fred
.
;
stop;
}
#
# Handle messages from known mailing lists
# Move messages from IETF filter discussion list to filter folder
#
if header :is "Sender" "owner-ietf-mta-filters@imc.org"
{
fileinto "filter"; # move to "filter" folder
}
#
# Keep all messages to or from people in my company
#
elsif address :domain :is ["From", "To"] "example.com"
{
keep; # keep in "In" folder
}
#
# Try and catch unsolicited email. If a message is not to me,
# or it contains a subject known to be spam, file it away.
#
elsif anyof (not address :all :contains
["To", "Cc", "Bcc"] "me@example.com",
header :matches "subject"
["*make*money*fast*", "*university*dipl*mas*"])
{
# If message header does not contain my address,
# it's from a list.
fileinto "spam"; # move to "spam" folder
}
else
{
# Move all other (non-company) mail to "personal"
# folder.
fileinto "personal";
}
10. 安全性問題
用戶必須能夠得到他們的郵件,實現無論采用何種方法保存都必須保證用戶定義的過濾
程序是安全的。同樣重要的是實現必須詳細檢查用戶的描述程序,不允許用戶建立一個定時
的郵件炸彈。比方說,如果允許反復拒收或轉發一個郵件,就可能意味著準許用戶建立一個
靠來自特定用戶的郵件激活的郵件炸彈。站點或者事先定義的動作限制對此類問題非常有
效。有幾個命令,如“discard”、“redirect”和“fileinto”可能會帶來潛在的危險。實現應該
設法禁止在語言中使用循環。
11. 鳴謝
非常感謝Chris Newman的支持和他的ABNF語法檢查器;John Myers和Steve Hole,
他們列出了最初草案的大綱;Larry Greenfield,他仔細地進行語法檢查并予以修正;Greg
Sereda提供并反復修正文中的例子;Ned Freed則改正了其他的錯誤;Rob Earhart完成了最
初的實現給了我很大幫助;Randall Gellens,無數次的校對。我非常感謝卡內基.梅隆大學,
本文的大部分工作都是在那里完成的。最后我還要感謝ietf-mta-filters@imc.org郵件列表的
所有讀者。
12. 作者地址
Tim Showalter
Mirapoint, Inc.
909 Hermosa Court
Sunnyvale, CA 94085
EMail: tjs@mirapoint.com
13. 參考
[ABNF] Crocker, D. and P. Overell, "Augmented BNF for Syntax
Specifications: ABNF", RFC 2234, November 1997.
[ACAP] Newman, C. and J. G. Myers, "ACAP -- Application
Configuration Access Protocol", RFC 2244, November 1997.
[BINARY-SI] "Standard IEC 60027-2: Letter symbols to be used in
electrical technology - Part 2: Telecommunications and
electronics", January 1999.
[DSN] Moore, K. and G. Vaudreuil, "An Extensible Message Format
for Delivery Status Notifications", RFC 1894, January
1996.
[FLAMES] Borenstein, N, and C. Thyberg, "Power, Ease of Use, and
Cooperative Work in a Practical Multimedia Message
System", Int. J. of Man-Machine Studies, April, 1991.
Reprinted in Computer-Supported Cooperative Work and
Groupware, Saul Greenberg, editor, Harcourt Brace
Jovanovich, 1991. Reprinted in Readings in Groupware and
Computer-Supported Cooperative Work, Ronald Baecker,
editor, Morgan Kaufmann, 1993.
[KEYWORDS] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, March 1997.
[IMAP] Crispin, M., "Internet Message Access Protocol - version
4rev1", RFC 2060, December 1996.
[IMAIL] Crocker, D., "Standard for the Format of ARPA Internet
Text Messages", STD 11, RFC 822, August 1982.
[MIME] Freed, N. and N. Borenstein, "Multipurpose Internet Mail
Extensions (MIME) Part One: Format of Internet Message
Bodies", RFC 2045, November 1996.
[MDN] Fajman, R., "An Extensible Message Format for Message
Disposition Notifications", RFC 2298, March 1998.
[RFC1123] Braden, R., "Requirements for Internet Hosts --
Application and Support", STD 3, RFC 1123, November 1989.
[SMTP] Postel, J., "Simple Mail Transfer Protocol", STD 10, RFC
821, August 1982.
[UTF-8] Yergeau, F., "UTF-8, a transformation format of Unicode
and ISO 10646", RFC 2044, October 1996.
14. 版權聲明
Copyright (C) The Internet Society (2001). All Rights Reserved.
This document and translations of it may be copied and furnished to
others, and derivative works that comment on or otherwise explain it
or assist in its implementation may be prepared, copied, published
and distributed, in whole or in part, without restriction of any
kind, provided that the above copyright notice and this paragraph are
included on all such copies and derivative works. However, this
document itself may not be modified in any way, such as by removing
the copyright notice or references to the Internet Society or other
Internet organizations, except as needed for the purpose of
developing Internet standards in which case the procedures for
copyrights defined in the Internet Standards process must be
followed, or as required to translate it into languages other than
English.
The limited permissions granted above are perpetual and will not be
revoked by the Internet Society or its successors or assigns.
This document and the information contained herein is provided on an
"AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED,
INCLUDING
BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE
INFORMATION
HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES
OF
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
Acknowledgement
Funding for the RFC Editor function is currently provided by the
Internet Society.
RFC3028——Sieve: A Mail Filtering Language 濾網:一種郵件過濾語言
2
RFC文檔中文翻譯計劃
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -