draft-ietf-sieve-include-06.txt   draft-ietf-sieve-include-07.txt 
Network Working Group C. Daboo Network Working Group C. Daboo
Internet-Draft A. Stone Internet-Draft A. Stone
Intended status: Standards Track July 26, 2010 Intended status: Standards Track July 5, 2011
Expires: January 27, 2011 Expires: January 6, 2012
Sieve Email Filtering: Include Extension Sieve Email Filtering: Include Extension
draft-ietf-sieve-include-06 draft-ietf-sieve-include-07
Abstract Abstract
The Sieve Email Filtering "include" extension permits users to The Sieve Email Filtering "include" extension permits users to
include one Sieve script inside another. This can make managing include one Sieve script inside another. This can make managing
large scripts or multiple sets of scripts much easier, and allows a large scripts or multiple sets of scripts much easier, and allows a
site and its users to build up libraries of scripts. Users are able site and its users to build up libraries of scripts. Users are able
to include their own personal scripts or site-wide scripts. to include their own personal scripts or site-wide scripts.
Status of this Memo Status of this Memo
skipping to change at page 1, line 34 skipping to change at page 1, line 34
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at http://datatracker.ietf.org/drafts/current/. Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on January 27, 2011. This Internet-Draft will expire on January 6, 2012.
Copyright Notice Copyright Notice
Copyright (c) 2010 IETF Trust and the persons identified as the Copyright (c) 2011 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info) in effect on the date of (http://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
skipping to change at page 2, line 16 skipping to change at page 2, line 16
1. Introduction and Overview . . . . . . . . . . . . . . . . . . 5 1. Introduction and Overview . . . . . . . . . . . . . . . . . . 5
2. Conventions Used in This Document . . . . . . . . . . . . . . 5 2. Conventions Used in This Document . . . . . . . . . . . . . . 5
3. Include Extension . . . . . . . . . . . . . . . . . . . . . . 6 3. Include Extension . . . . . . . . . . . . . . . . . . . . . . 6
3.1. General Considerations . . . . . . . . . . . . . . . . . . 6 3.1. General Considerations . . . . . . . . . . . . . . . . . . 6
3.2. Control Structure include . . . . . . . . . . . . . . . . 7 3.2. Control Structure include . . . . . . . . . . . . . . . . 7
3.3. Control Structure return . . . . . . . . . . . . . . . . . 10 3.3. Control Structure return . . . . . . . . . . . . . . . . . 10
3.4. Interaction with Variables . . . . . . . . . . . . . . . . 10 3.4. Interaction with Variables . . . . . . . . . . . . . . . . 10
3.4.1. Control Structure global . . . . . . . . . . . . . . . 10 3.4.1. Control Structure global . . . . . . . . . . . . . . . 10
3.4.2. Variables Namespace global . . . . . . . . . . . . . . 12 3.4.2. Variables Namespace global . . . . . . . . . . . . . . 12
4. Security Considerations . . . . . . . . . . . . . . . . . . . 12 4. Security Considerations . . . . . . . . . . . . . . . . . . . 13
5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 13 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 13
5.1. "include" Extension Registration . . . . . . . . . . . . . 13 5.1. "include" Extension Registration . . . . . . . . . . . . . 13
6. References . . . . . . . . . . . . . . . . . . . . . . . . . . 13 6. References . . . . . . . . . . . . . . . . . . . . . . . . . . 14
6.1. Normative References . . . . . . . . . . . . . . . . . . . 13 6.1. Normative References . . . . . . . . . . . . . . . . . . . 14
6.2. Informative References . . . . . . . . . . . . . . . . . . 13 6.2. Informative References . . . . . . . . . . . . . . . . . . 14
Appendix A. Acknowledgments . . . . . . . . . . . . . . . . . . . 13 Appendix A. Acknowledgments . . . . . . . . . . . . . . . . . . . 14
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 14 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 14
Change History (to be removed prior to publication as an RFC) Change History (to be removed prior to publication as an RFC)
Changes from ietf-06 to ietf-07:
a. Nits from Stephan Bosch.
Changes from ietf-05 to ietf-06: Changes from ietf-05 to ietf-06:
a. Nits from Barry Leiba. a. Nits from Barry Leiba.
Changes from ietf-04 to ietf-05: Changes from ietf-04 to ietf-05:
a. Integrate review from Barry Leiba. a. Integrate review from Barry Leiba.
Changes from ietf-03 to ietf-04: Changes from ietf-03 to ietf-04:
skipping to change at page 8, line 35 skipping to change at page 8, line 35
include :personal "always_allow"; include :personal "always_allow";
include :global "spam_tests"; include :global "spam_tests";
include :personal "spam_tests"; include :personal "spam_tests";
include :personal "mailing_lists"; include :personal "mailing_lists";
Personal script "always_allow" Personal script "always_allow"
This script special-cases some correspondent email addresses and This script special-cases some correspondent email addresses and
makes sure any message containing those addresses are always kept. makes sure any message containing those addresses are always kept.
if header :is "From" "boss@example.com" if address :is "from" "boss@example.com"
{ {
keep; keep;
} }
elsif header :is "From" "ceo@example.com" elsif address :is "from" "ceo@example.com"
{ {
keep; keep;
} }
Personal script "spam_tests" Personal script "spam_tests"
This script does some user-specific spam tests to catch spam This script does some user-specific spam tests to catch spam
messages not caught by the site-wide spam tests. messages not caught by the site-wide spam tests.
require ["reject"]; require ["reject"];
if header :contains "Subject" "XXXX" if header :contains "Subject" "XXXX"
{ {
reject; reject "Subject XXXX is unacceptable.";
} }
elsif header :is "From" "money@example.com" elsif address :is "from" "money@example.com"
{ {
reject; reject "Mail from this sender is unwelcome.";
} }
Personal script "mailing_lists" Personal script "mailing_lists"
This script looks for messages from different mailing lists and This script looks for messages from different mailing lists and
files each into a mailbox specific to the mailing list. files each into a mailbox specific to the mailing list.
require ["fileinto"]; require ["fileinto"];
if header :is "List-ID" "sieve.ietf.org" if header :is "List-ID" "sieve.ietf.org"
skipping to change at page 11, line 29 skipping to change at page 11, line 29
declaring it global, the name specifies a separate, non-global declaring it global, the name specifies a separate, non-global
variable within that script. variable within that script.
Interpretation of a string containing a variable marked as global, Interpretation of a string containing a variable marked as global,
but without any value set, SHALL behave as any other access to an but without any value set, SHALL behave as any other access to an
unknown variable, as specified in VARIABLES [RFC5229], Section 3 unknown variable, as specified in VARIABLES [RFC5229], Section 3
(i.e., evaluates to an empty string). (i.e., evaluates to an empty string).
Example: Example:
require ["variables", "include"]; The active script
The included script may contain repetitive code that is
effectively a subroutine that can be factored out. In this
script, the test which matches last will leave its value in the
test-mailbox variable and the top-level script will file the
message into that mailbox. If no tests matched, the message will
be implicitly kept in the INBOX.
require ["include", "variables", "relational"];
global "test"; global "test";
global "test-mailbox"; global "test-mailbox";
# The included script may contain repetitive code that is
# effectively a subroutine that can be factored out.
set "test" "$$" set "test" "$$"
include "spam_filter_script"; include "spam_checks";
set "test" "Make money" set "test" "Make money"
include "spam_filter_script"; include "spam_checks";
# Message will be filed according to the test that matched last. if string :count "eq" "${test-mailbox}" "1"
if string :count "${test-mailbox}" "1"
{ {
fileinto "INBOX${test-mailbox}"; fileinto "${test-mailbox}";
stop; stop;
} }
# If nothing matched, the message is implicitly kept. Personal script "spam_checks"
Active script This script is makes a number of tests against the message,
falling through back to the top-level script having set the global
test-mailbox variable with a target folder to file the message
into.
require ["variables", "include"]; require ["include", "variables"];
global ["test", "test-mailbox"]; global ["test", "test-mailbox"];
if header :contains "Subject" "${test}" if header :contains "Subject" "${test}"
{ {
set "test-mailbox" "spam-${test}; set "test-mailbox" "spam-${test}";
} }
spam_filter_script
3.4.2. Variables Namespace global 3.4.2. Variables Namespace global
In addition to the "global" command, this document defines the In addition to the "global" command, this document defines the
variables namespace "global", as specified in VARIABLES [RFC5229], variables namespace "global", as specified in VARIABLES [RFC5229],
Section 3. Section 3.
Example: Example:
require ["variables", "include"]; require ["variables", "include"];
 End of changes. 23 change blocks. 
29 lines changed or deleted 40 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/