draft-ietf-sieve-variables-03.txt   draft-ietf-sieve-variables-04.txt 
Network Working Group K. T. Homme Network Working Group K. T. Homme
Updates: 3028 Updates: 3028
Document: draft-ietf-sieve-variables-03.txt University of Oslo Document: draft-ietf-sieve-variables-04.txt University of Oslo
Expires Oct 28, 2005 28 Apr 2005 Expires Jan 14, 2006 14 Jul 2005
Sieve Mail Filtering Language: Variables Extension Sieve Mail Filtering Language: Variables Extension
Status of this Memo Status of this Memo
This document is an Internet-Draft and is subject to all provisions This document is an Internet-Draft and is subject to all provisions
of section 3 of RFC 3978. By submitting this Internet-Draft, each of section 3 of RFC 3978. By submitting this Internet-Draft, each
author represents that any applicable patent or other IPR claims of author represents that any applicable patent or other IPR claims of
which he or she is aware have been or will be disclosed, and any of which he or she is aware have been or will be disclosed, and any of
which he or she becomes aware will be disclosed, in accordance with which he or she becomes aware will be disclosed, in accordance with
skipping to change at page 5, line 18 skipping to change at page 5, line 18
keyword, only the first component. keyword, only the first component.
e) allow level 2 and above of the namespace specification to be all- e) allow level 2 and above of the namespace specification to be all-
digit. digit.
f) combining :upper and :lower etc. is a now syntax error. f) combining :upper and :lower etc. is a now syntax error.
g) allow SET to set variables in namespaces if the extension allows g) allow SET to set variables in namespaces if the extension allows
it. it.
0.2.9. Changes since -03
a) added two new modifiers, ":quoteregex" and ":quotewildcard".
b) added wording about security implications of silent truncation.
0.3. Open Issues 0.3. Open Issues
This extension is in conflict with a MUST in [SIEVE] 2.4: "Tests MUST This extension is in conflict with a MUST in [SIEVE] 2.4: "Tests MUST
NOT have side effects." This document therefore can't leave draft NOT have side effects." This document therefore can't leave draft
status until a revised Sieve specification has been accepted by the status until a revised Sieve specification has been accepted by the
IESG. No significant changes to this draft are foreseen before IESG. No significant changes to this draft are foreseen before
submission as a proposed standard. submission as a proposed standard.
1. Introduction 1. Introduction
skipping to change at page 10, line 5 skipping to change at page 10, line 8
4.1. Modifiers 4.1. Modifiers
Syntax: ":lower" / ":upper" / ":lowerfirst" / ":upperfirst" / Syntax: ":lower" / ":upper" / ":lowerfirst" / ":upperfirst" /
":length" ":length"
Modifier names are case insensitive. Unknown modifiers MUST yield a Modifier names are case insensitive. Unknown modifiers MUST yield a
syntax error. More than one modifier can be specified, in which case syntax error. More than one modifier can be specified, in which case
they are applied according to this precedence list, largest value they are applied according to this precedence list, largest value
first: first:
+-----------------------------+ +--------------------------------+
| Precedence Modifier | | Precedence Modifier |
+-----------------------------+ +--------------------------------+
| 30 :lower | | 40 :lower |
| :upper | | :upper |
+-----------------------------+ +--------------------------------+
| 20 :lowerfirst | | 30 :lowerfirst |
| :upperfirst | | :upperfirst |
+-----------------------------+ +--------------------------------+
| 20 :quotewildcard |
| :quoteregex |
+--------------------------------+
| 10 :length | | 10 :length |
+-----------------------------+ +--------------------------------+
Using two or more modifiers of the same precedence is a syntax error. Using two or more modifiers of the same precedence is a syntax error.
Examples: Examples:
# The value assigned to the variable is printed after the arrow # The value assigned to the variable is printed after the arrow
set "a" "juMBlEd lETteRS"; => "juMBlEd lETteRS" set "a" "juMBlEd lETteRS"; => "juMBlEd lETteRS"
set :length "b" "${a}"; => "15" set :length "b" "${a}"; => "15"
set :lower "b" "${a}"; => "jumbled letters" set :lower "b" "${a}"; => "jumbled letters"
set :lower :comparator "i;octet" set :lower :comparator "i;octet"
"b" "${a}"; => "juMBlEd lETteRS" "b" "${a}"; => "juMBlEd lETteRS"
set :upperfirst "b" "${a}"; => "JuMBlEd lETteRS" set :upperfirst "b" "${a}"; => "JuMBlEd lETteRS"
set :upperfirst :lower "b" "${a}"; => "Jumbled letters" set :upperfirst :lower "b" "${a}"; => "Jumbled letters"
set :quotewildcard "b" "Rock*"; => "Rock\*"
4.1.1. Modifier ":length" 4.1.1. Modifier ":length"
The value is the decimal number of characters in the expansion, The value is the decimal number of characters in the expansion,
converted to a string. converted to a string.
4.1.2. Case modifiers 4.1.2. Quoting modifiers
These modifiers add the necessary quotes to ensure that the expanded
text will only match a literal occurence if used as a parameter for
:matches or :regex.
4.1.2.1. Modifier ":quotewildcard"
Every character with special meaning for :matches ("*", "?" and " is
prefixed with "
4.1.2.2. Modifier ":quoteregex"
Every character with special meaning for :regex (".", "*", "?" etc.)
is prefixed with "
4.1.3. Case modifiers
These modifiers change the letters of the text from upper to lower These modifiers change the letters of the text from upper to lower
case or vice versa. The implementation MUST support US-ASCII, but is case or vice versa. The implementation MUST support US-ASCII, but is
not required to handle the entire Unicode repertoire. The comparator not required to handle the entire Unicode repertoire. The comparator
specified SHOULD be consulted to establish which locale to use. specified SHOULD be consulted to establish which locale to use.
4.1.2.1. Modifier ":upper" 4.1.3.1. Modifier ":upper"
All lower case letters are converted to their upper case counterpart. All lower case letters are converted to their upper case counterpart.
4.1.2.2. Modifier ":lower" 4.1.3.2. Modifier ":lower"
All upper case letters are converted to their lower case counterpart. All upper case letters are converted to their lower case counterpart.
4.1.2.3. Modifier ":upperfirst" 4.1.3.3. Modifier ":upperfirst"
The first character of the string is converted to upper case if it is The first character of the string is converted to upper case if it is
a letter and set in lower case. The rest of the string is left a letter and set in lower case. The rest of the string is left
unchanged. unchanged.
4.1.2.4. Modifier ":lowerfirst" 4.1.3.4. Modifier ":lowerfirst"
The first character of the string is converted to lower case if it is The first character of the string is converted to lower case if it is
a letter and set in upper case. The rest of the string is left a letter and set in upper case. The rest of the string is left
unchanged. unchanged.
5. Test string 5. Test string
Syntax: string [MATCH-TYPE] [COMPARATOR] Syntax: string [MATCH-TYPE] [COMPARATOR]
<source: string-list> <key-list: string-list> <source: string-list> <key-list: string-list>
skipping to change at page 12, line 11 skipping to change at page 12, line 38
Match variables ${1} through ${9} MUST be supported. References to Match variables ${1} through ${9} MUST be supported. References to
higher indices than the implementation supports MUST be treated as a higher indices than the implementation supports MUST be treated as a
syntax error which SHOULD be discovered at compile-time. syntax error which SHOULD be discovered at compile-time.
7. Security Considerations 7. Security Considerations
When match variables are used, and the author of the script isn't When match variables are used, and the author of the script isn't
careful, strings can contain arbitrary values controlled by the careful, strings can contain arbitrary values controlled by the
sender of the e-mail. sender of the e-mail.
Since values stored by SET exceeding implementation limits are
silently truncated, it's not appropriate to store large structures
with security implications in variables.
The introduction of variables makes advanced decision making easier The introduction of variables makes advanced decision making easier
to write, but since no looping construct is provided, all Sieve to write, but since no looping construct is provided, all Sieve
scripts will terminate in an orderly manner. scripts will terminate in an orderly manner.
Sieve filtering should not be relied on as a security measure against Sieve filtering should not be relied on as a security measure against
hostile e-mail messages. Sieve is designed to do simple, mostly hostile e-mail messages. Sieve is designed to do simple, mostly
static tests, and is not suitable for use as a spam or virus checker, static tests, and is not suitable for use as a spam or virus checker,
where the perpetrator has a motivation to vary the format of the where the perpetrator has a motivation to vary the format of the
email in order to avoid filtering rules. See also [SPAMTEST]. email in order to avoid filtering rules. See also [SPAMTEST].
skipping to change at page 12, line 48 skipping to change at page 13, line 33
NO-0316 OSLO NO-0316 OSLO
E-mail: kjetilho@ifi.uio.no E-mail: kjetilho@ifi.uio.no
This information should be added to the list of sieve extensions This information should be added to the list of sieve extensions
given on http://www.iana.org/assignments/sieve-extensions. given on http://www.iana.org/assignments/sieve-extensions.
9. Acknowledgments 9. Acknowledgments
Thanks to Cyrus Daboo, Jutta Degener, Ned Freed, Lawrence Greenfield, Thanks to Cyrus Daboo, Jutta Degener, Ned Freed, Lawrence Greenfield,
Mark E. Mallett, Alexey Melnikov, Peder Stray and Nigel Swinson for Jeffrey Hutzelman, Mark E. Mallett, Alexey Melnikov, Peder Stray and
valuable feedback. Nigel Swinson for valuable feedback.
10. Author's Address 10. Author's Address
Kjetil T. Homme Kjetil T. Homme
University of Oslo University of Oslo
PO Box 1080 PO Box 1080
0316 Oslo, Norway 0316 Oslo, Norway
Phone: +47 9366 0091 Phone: +47 9366 0091
E-mail: kjetilho@ifi.uio.no E-mail: kjetilho@ifi.uio.no
 End of changes. 

This html diff was produced by rfcdiff 1.25, available from http://www.levkowetz.com/ietf/tools/rfcdiff/