idnits 2.17.1 draft-ietf-sieve-spamtestbis-03.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** It looks like you're using RFC 3978 boilerplate. You should update this to the boilerplate described in the IETF Trust License Policy document (see https://trustee.ietf.org/license-info), which is required now. -- Found old boilerplate from RFC 3978, Section 5.1 on line 15. -- Found old boilerplate from RFC 3978, Section 5.5 on line 565. -- Found old boilerplate from RFC 3979, Section 5, paragraph 1 on line 542. -- Found old boilerplate from RFC 3979, Section 5, paragraph 2 on line 549. -- Found old boilerplate from RFC 3979, Section 5, paragraph 3 on line 555. ** This document has an original RFC 3978 Section 5.4 Copyright Line, instead of the newer IETF Trust Copyright according to RFC 4748. ** This document has an original RFC 3978 Section 5.5 Disclaimer, instead of the newer disclaimer which includes the IETF Trust according to RFC 4748. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- == No 'Intended status' indicated for this document; assuming Proposed Standard Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the RFC 3978 Section 5.4 Copyright Line does not match the current year -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (June 12, 2006) is 6529 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Missing Reference: 'COMPARATOR' is mentioned on line 351, but not defined == Missing Reference: 'MATCH-TYPE' is mentioned on line 351, but not defined == Outdated reference: A later version (-13) exists of draft-ietf-sieve-3028bis-06 == Outdated reference: A later version (-14) exists of draft-newman-i18n-comparator-11 -- Obsolete informational reference (is this intentional?): RFC 3685 (Obsoleted by RFC 5235) Summary: 3 errors (**), 0 flaws (~~), 6 warnings (==), 8 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 SIEVE Email Filtering Working C. Daboo 3 Group June 12, 2006 4 Internet-Draft 5 Expires: December 14, 2006 7 SIEVE Email Filtering: Spamtest and Virustest Extensions 8 draft-ietf-sieve-spamtestbis-03 10 Status of this Memo 12 By submitting this Internet-Draft, each author represents that any 13 applicable patent or other IPR claims of which he or she is aware 14 have been or will be disclosed, and any of which he or she becomes 15 aware will be disclosed, in accordance with Section 6 of BCP 79. 17 Internet-Drafts are working documents of the Internet Engineering 18 Task Force (IETF), its areas, and its working groups. Note that 19 other groups may also distribute working documents as Internet- 20 Drafts. 22 Internet-Drafts are draft documents valid for a maximum of six months 23 and may be updated, replaced, or obsoleted by other documents at any 24 time. It is inappropriate to use Internet-Drafts as reference 25 material or to cite them other than as "work in progress." 27 The list of current Internet-Drafts can be accessed at 28 http://www.ietf.org/ietf/1id-abstracts.txt. 30 The list of Internet-Draft Shadow Directories can be accessed at 31 http://www.ietf.org/shadow.html. 33 This Internet-Draft will expire on December 14, 2006. 35 Copyright Notice 37 Copyright (C) The Internet Society (2006). 39 Abstract 41 The SIEVE email filtering language "spamtest", "spamtestplus" and 42 "virustest" extensions permit users to use simple, portable commands 43 for spam and virus tests on email messages. Each extension provides 44 a new test using matches against numeric "scores". It is the 45 responsibility of the underlying SIEVE implementation to do the 46 actual checks that result in proper input to the tests. 48 Change History (to be removed prior to publication as an RFC) 49 Changes from -02: 50 1. Changed formatting of tables. 51 2. Fixed missing 2119 definitions. 52 3. Moved reference to previous extension to informative. 53 4. Minor text improvements. 54 5. Fixed some single/double quote issues. 55 6. Reworded abstract, introduction and overview to use better SIEVE 56 terminology when describing tests, commands and results. 57 7. Remove "untested" string result from ":percent" test. 58 8. Allow ":count" match type to be used for tested/untested checks. 60 Changes from -01: 61 1. Changed ACAP reference to i18n-comparators draft. 62 2. Changed MUST in security section for virus checker updates to 63 plain must. 64 3. Return string "untested" when :percent is used and no test has 65 been done. 66 4. Remove MUST NOT for having both spamtestplus and spamtest 67 capabilities present, and instead make it a SHOULD NOT. 68 5. Add text to state that implementations MUST return an error if 69 spamtestplus is not present when :percent is used. 70 6. Tweak first para of security considerations to better reflect 71 reality of testing. 72 7. Syntax -> Usage. 73 8. Updated references to 3028bis and 3431bis. 75 Changes from -00: 76 1. Added description of how to check for untested when using 77 :percent. 78 2. Changed requires item to "spamtestplus". 79 3. Changed text describing which requires item needs to be present. 81 Changes from RFC3685: 82 1. Added ":percent" argument to spamtest. 84 Table of Contents 86 1. Introduction and Overview . . . . . . . . . . . . . . . . . . 4 87 2. Conventions Used in This Document . . . . . . . . . . . . . . 4 88 3. SIEVE Extensions . . . . . . . . . . . . . . . . . . . . . . . 5 89 3.1. General Considerations . . . . . . . . . . . . . . . . . . 5 90 3.2. Test spamtest . . . . . . . . . . . . . . . . . . . . . . 5 91 3.2.1. spamtest without :percent argument . . . . . . . . . . 6 92 3.2.2. spamtest with :percent argument . . . . . . . . . . . 7 93 3.3. Test virustest . . . . . . . . . . . . . . . . . . . . . . 9 94 4. Security Considerations . . . . . . . . . . . . . . . . . . . 10 95 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 11 96 5.1. spamtest registration . . . . . . . . . . . . . . . . . . 11 97 5.2. virustest registration . . . . . . . . . . . . . . . . . . 12 98 5.3. spamtestplus registration . . . . . . . . . . . . . . . . 12 99 6. References . . . . . . . . . . . . . . . . . . . . . . . . . . 12 100 6.1. Normative References . . . . . . . . . . . . . . . . . . . 12 101 6.2. Informative References . . . . . . . . . . . . . . . . . . 13 102 Appendix A. Acknowledgments . . . . . . . . . . . . . . . . . . . 13 103 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 14 104 Intellectual Property and Copyright Statements . . . . . . . . . . 15 106 1. Introduction and Overview 108 SIEVE scripts are frequently being used to do spam and virus 109 filtering based on either implicit script tests (e.g. tests for 110 "black-listed" senders directly encoded in the SIEVE script), or via 111 testing messages modified by some external spam or virus checker that 112 handled the message prior to SIEVE. The use of third-party spam and 113 virus checker tools poses a problem since each tool has its own way 114 of indicating the result of its checks. These usually take the form 115 of a header added to the message, the content of which indicates the 116 status using some syntax defined by the particular tool. Each user 117 has to then create their own SIEVE scripts to match the contents of 118 these headers to do filtering. This requires the script to stay in 119 synchronization with the third party tool as it gets updated or 120 perhaps replaced with another. Thus scripts become tied to specific 121 environments, and lose portability. 123 The purpose of this document is to introduce two SIEVE tests that can 124 be used to implement "generic" tests for spam and viruses in messages 125 processed via SIEVE scripts. The spam and virus checks themselves 126 are handled by the underlying SIEVE implementation in whatever manner 127 is appropriate, so that the SIEVE spam and virus test commands can be 128 used in a portable way. 130 In order to do numeric comparisons against the returned strings, 131 server implementations MUST also support the SIEVE relational 132 [I-D.ietf-sieve-3431bis] extension, in addition to the extensions 133 described here. All examples below assume the relational extension 134 is present. 136 2. Conventions Used in This Document 138 Conventions for notations are as in [I-D.ietf-sieve-3028bis] section 139 1.1. 141 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 142 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 143 document are to be interpreted as described in [RFC2119]. 145 The term "spam" is used in this document to refer to unsolicited or 146 unwanted email messages. This document does not attempt to define 147 what exactly constitutes spam, or how it should be identified, or 148 what actions should be taken when detected. 150 The term "virus" is used in this document to refer to any type of 151 message whose content can cause malicious damage. This document does 152 not attempt to define what exactly constitutes a virus, or how it 153 should be identified, or what actions should be taken when detected. 155 3. SIEVE Extensions 157 3.1. General Considerations 159 The "spamtest" and "virustest" tests described below evaluate the 160 results of implementation-specific spam and virus checks in a 161 portable way. The implementation may, for example, check for third- 162 party spam tool headers and determine how those map into the way the 163 test commands are used. To do this, the underlying SIEVE 164 implementation provides a normalized result string as one of the 165 inputs to each test command. The normalized result string is 166 considered to be the value on the left hand side of the test, and the 167 comparison values given in the test command are considered to be on 168 the right hand side. 170 The normalized result starts with a digit string, with its numeric 171 value within the range of values used by the specific test, 172 indicating the severity of spam or viruses in a message or whether 173 any tests were done at all. This may optionally be followed by a 174 space (%x20) character and arbitrary text, or in one specific case a 175 single keyword is returned. The numeric value can be compared to 176 specific values using the SIEVE relational [I-D.ietf-sieve-3431bis] 177 extension in conjunction with the "i;ascii-numeric" comparator 178 [I-D.newman-i18n-comparator], which will test for the presence of a 179 numeric value at the start of the string, ignoring any additional 180 text in the string. The optional text can be used to carry 181 implementation specific details about the tests and descriptive 182 comments about the result. Tests can be done using standard string 183 comparators against this text if it helps to refine behavior, however 184 this will break portability of the script as the text will likely be 185 specific to a particular implementation. 187 In addition, the SIEVE relational [I-D.ietf-sieve-3431bis] ":count" 188 match type can be used to determine if the underlying implementation 189 actually did a test. If the underlying spam or virus test was done, 190 the ":count" of the normalized result will return the numeric value 191 "1", whilst if the test was not done, the ":count" value will be "0" 192 (zero). 194 3.2. Test spamtest 196 Usage: spamtest [":percent"] [COMPARATOR] [MATCH-TYPE] 197 199 SIEVE implementations that implement the "spamtest" test use an 200 identifier of either "spamtest" or "spamtestplus" for use with the 201 capability mechanism. 203 If the ":percent" argument is not used with any spamtest test, then 204 one of either the "spamtest" or "spamtestplus" capability identifiers 205 MUST be present. 207 If the ":percent" argument is used with any spamtest test, then the 208 "spamtestplus" capability identifier MUST be present. SIEVE 209 implementations MUST return an error if the ":percent" argument is 210 used and "spamtestplus" is not specified. 212 In the interests of brevity and clarity, scripts SHOULD NOT specify 213 both "spamtestplus" and "spamtest" capability identifiers together. 215 The "spamtest" test evaluates to true if the normalized spamtest 216 result matches the value. The type of match is specified by the 217 optional match argument, which defaults to ":is" if not specified. 219 3.2.1. spamtest without :percent argument 221 When the ":percent" argument is not present in the "spamtest" test, 222 the normalized result string provided for the left hand side of the 223 test starts with a numeric value in the range "0" (zero) through 224 "10", with meanings summarized below: 226 +----------+--------------------------------------------------------+ 227 | spamtest | interpretation | 228 | value | | 229 +----------+--------------------------------------------------------+ 230 | 0 | message was not tested for spam | 231 | 1 | message was tested and is clear of spam | 232 | 2 - 9 | message was tested and has a varying likelihood of | 233 | | containing spam in increasing order | 234 | 10 | message was tested and definitely contains spam | 235 +----------+--------------------------------------------------------+ 237 The underlying SIEVE implementation will map whatever spam check is 238 done into this numeric range, as appropriate. 240 Examples: 242 require ["spamtest", "fileinto", 243 "relational", "comparator-i;ascii-numeric"]; 245 if spamtest :value "eq" :comparator "i;ascii-numeric" "0" 246 { 247 fileinto "INBOX.unclassified"; 248 } 249 elsif spamtest :value "ge" :comparator "i;ascii-numeric" "3" 250 { 251 fileinto "INBOX.spam-trap"; 252 } 254 In this example, any message that has not passed through a spam check 255 tool will be filed into the mailbox "INBOX.unclassified". Any 256 message with a normalized result value greater than or equal to "3" 257 is filed into a mailbox called "INBOX.spam-trap" in the user's 258 mailstore. 260 3.2.2. spamtest with :percent argument 262 When the ":percent" argument is present in the "spamtest" test, the 263 normalized result string provided for the left hand side of the test 264 starts with a numeric value in the range "0" (zero) through "100", 265 with meanings summarized below: 267 +----------+--------------------------------------------------------+ 268 | spamtest | interpretation | 269 | value | | 270 +----------+--------------------------------------------------------+ 271 | 0 | message was tested and is clear of spam, or was not | 272 | | tested for spam | 273 | 1 - 99 | message was tested and has a varying likelihood of | 274 | | containing spam in increasing order based on the | 275 | | spamtest value | 276 | 100 | message was tested and definitely contains spam | 277 +----------+--------------------------------------------------------+ 279 The underlying SIEVE implementation will map whatever spam check is 280 done into the numeric range, as appropriate. 282 To determine whether the message was tested for spam or not, the 283 preferred solution is to use the test without the ":percent" 284 argument, testing for the normalized result value "0" as described in 285 Section 3.2.1. 287 Examples: 289 require ["spamtestplus", "fileinto", 290 "relational", "comparator-i;ascii-numeric"]; 292 if spamtest :value "eq" 293 :comparator "i;ascii-numeric" "0" 294 { 295 fileinto "INBOX.unclassified"; 296 } 297 elsif spamtest :percent :value "eq" 298 :comparator "i;ascii-numeric" "0" 299 { 300 fileinto "INBOX.not-spam"; 301 } 302 elsif spamtest :percent :value "lt" 303 :comparator "i;ascii-numeric" "37" 304 { 305 fileinto "INBOX.spam-trap"; 306 } 307 else 308 { 309 discard; 310 } 312 In this example, any message that has not passed through a spam check 313 tool will be filed into the mailbox "INBOX.unclassified". Any 314 message that is classified as definitely not containing spam 315 (normalized result value "0") will be filed into the mailbox 316 "INBOX.not-spam". Any message with a normalized result value less 317 than "37" is filed into a mailbox called "INBOX.spam-trap" in the 318 user's mailstore. Any other normalized result value will result in 319 the message being discarded. 321 Alternatively, the SIEVE relational [I-D.ietf-sieve-3431bis] ":count" 322 match type can be used: 324 Examples: 326 if spamtest :percent :count "eq" 327 :comparator "i;ascii-numeric" "0" 328 { 329 fileinto "INBOX.unclassified"; 330 } 331 elsif spamtest :percent :value "eq" 332 :comparator "i;ascii-numeric" "0" 333 { 334 fileinto "INBOX.not-spam"; 335 } 336 elsif spamtest :percent :value "lt" 337 :comparator "i;ascii-numeric" "37" 338 { 339 fileinto "INBOX.spam-trap"; 340 } 341 else 342 { 343 discard; 344 } 346 This example will result in exactly the same behavior as the previous 347 one. 349 3.3. Test virustest 351 Usage: virustest [COMPARATOR] [MATCH-TYPE] 352 354 SIEVE implementations that implement the "virustest" test have an 355 identifier of "virustest" for use with the capability mechanism. 357 The "virustest" test evaluates to true if the normalized result 358 string matches the value. The type of match is specified by the 359 optional match argument, which defaults to ":is" if not specified. 361 The normalized result string provided for the left side of the test 362 starts with a numeric value in the range "0" (zero) through "5", with 363 meanings summarized below: 365 +-----------+-------------------------------------------------------+ 366 | virustest | interpretation | 367 | value | | 368 +-----------+-------------------------------------------------------+ 369 | 0 | message was not tested for viruses | 370 | 1 | message was tested and contains no known viruses | 371 | 2 | message was tested and contained a known virus which | 372 | | was replaced with harmless content | 373 | 3 | message was tested and contained a known virus which | 374 | | was "cured" such that it is now harmless | 375 | 4 | message was tested and possibly contains a known | 376 | | virus | 377 | 5 | message was tested and definately contains a known | 378 | | virus | 379 +-----------+-------------------------------------------------------+ 381 The underlying SIEVE implementation will map whatever virus checks 382 are done into this numeric range, as appropriate. If the message has 383 not been categorized by any virus checking tools, then the virustest 384 result is "0". 386 Example: 388 require ["virustest", "fileinto", 389 "relational", "comparator-i;ascii-numeric"]; 391 if virustest :value "eq" :comparator "i;ascii-numeric" "0" 392 { 393 fileinto "INBOX.unclassified"; 394 } 395 if virustest :value "eq" :comparator "i;ascii-numeric" "4" 396 { 397 fileinto "INBOX.quarantine"; 398 } 399 elsif virustest :value "eq" :comparator "i;ascii-numeric" "5" 400 { 401 discard; 402 } 404 In this example, any message that has not passed through a virus 405 check tool will be filed into the mailbox "INBOX.unclassified". Any 406 message with a normalized result value equal to "4" is filed into a 407 mailbox called "INBOX.quarantine" in the user's mailstore. Any 408 message with a normalized result value equal to "5" is discarded 409 (removed) and not delivered to the user's mailstore. 411 4. Security Considerations 413 SIEVE implementations SHOULD ensure that "spamtest" and "virustest" 414 tests only report spam and virus test results for messages that 415 actually have gone through a legitimate spam or virus check process. 416 In particular, if such checks rely on the addition and subsequent 417 checking of private header fields, it is the responsibility of the 418 implementation to ensure that such headers cannot be spoofed by the 419 sender or intermediary and thereby prevent the implementation from 420 being tricked into returning the wrong result for the test. 422 Server administrators must ensure that the virus checking tools are 423 kept up to date, to provide reasonable protection for users using the 424 "virustest" test. Users should be made aware of the fact that the 425 "virustest" test does not provide a 100% reliable way to remove all 426 viruses, and they should continue to exercise caution when dealing 427 with messages of unknown content and origin. 429 Beyond that, the "spamtest" and "virustest" extensions do not raise 430 any security considerations that are not present in the base 431 [I-D.ietf-sieve-3028bis] protocol, and these issues are discussed in 432 [I-D.ietf-sieve-3028bis]. 434 5. IANA Considerations 436 The following templates specify the IANA registration of the Sieve 437 extensions specified in this document. The registrations for 438 "spamtest" and "virustest" replace those from in [RFC3685]: 440 5.1. spamtest registration 442 To: iana@iana.org 443 Subject: Registration of new Sieve extension 445 Capability name: spamtest 446 Capability keyword: spamtest 447 Capability arguments: N/A 448 Standards Track/IESG-approved experimental RFC number: this RFC 449 Person and email address to contact for further information: 451 Cyrus Daboo 453 455 This information should be added to the list of sieve extensions 456 given on http://www.iana.org/assignments/sieve-extensions. 458 5.2. virustest registration 460 To: iana@iana.org 461 Subject: Registration of new Sieve extension 463 Capability name: virustest 464 Capability keyword: virustest 465 Capability arguments: N/A 466 Standards Track/IESG-approved experimental RFC number: this RFC 467 Person and email address to contact for further information: 469 Cyrus Daboo 471 473 This information should be added to the list of sieve extensions 474 given on http://www.iana.org/assignments/sieve-extensions. 476 5.3. spamtestplus registration 478 To: iana@iana.org 479 Subject: Registration of new Sieve extension 481 Capability name: spamtestplus 482 Capability keyword: spamtestplus 483 Capability arguments: :percent 484 Standards Track/IESG-approved experimental RFC number: this RFC 485 Person and email address to contact for further information: 487 Cyrus Daboo 489 491 This information should be added to the list of sieve extensions 492 given on http://www.iana.org/assignments/sieve-extensions. 494 6. References 496 6.1. Normative References 498 [I-D.ietf-sieve-3028bis] 499 Showalter, T. and P. Guenther, "Sieve: An Email Filtering 500 Language", draft-ietf-sieve-3028bis-06 (work in progress), 501 March 2006. 503 [I-D.ietf-sieve-3431bis] 504 Segmuller, W. and B. Leiba, "Sieve Extension: Relational 505 Tests", draft-ietf-sieve-3431bis-04 (work in progress), 506 December 2005. 508 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 509 Requirement Levels", BCP 14, RFC 2119, March 1997. 511 6.2. Informative References 513 [I-D.newman-i18n-comparator] 514 Newman, C., "Internet Application Protocol Collation 515 Registry", draft-newman-i18n-comparator-11 (work in 516 progress), May 2006. 518 [RFC3685] Daboo, C., "SIEVE Email Filtering: Spamtest and VirusTest 519 Extensions", RFC 3685, February 2004. 521 Appendix A. Acknowledgments 523 Thanks to Mark E. Mallett, Tony Hansen, Jutta Degener, Ned Freed, 524 Ashish Gawarikar, Alexey Melnikov and Nigel Swinson for comments and 525 corrections. 527 Author's Address 529 Cyrus Daboo 531 Email: cyrus@daboo.name 533 Intellectual Property Statement 535 The IETF takes no position regarding the validity or scope of any 536 Intellectual Property Rights or other rights that might be claimed to 537 pertain to the implementation or use of the technology described in 538 this document or the extent to which any license under such rights 539 might or might not be available; nor does it represent that it has 540 made any independent effort to identify any such rights. Information 541 on the procedures with respect to rights in RFC documents can be 542 found in BCP 78 and BCP 79. 544 Copies of IPR disclosures made to the IETF Secretariat and any 545 assurances of licenses to be made available, or the result of an 546 attempt made to obtain a general license or permission for the use of 547 such proprietary rights by implementers or users of this 548 specification can be obtained from the IETF on-line IPR repository at 549 http://www.ietf.org/ipr. 551 The IETF invites any interested party to bring to its attention any 552 copyrights, patents or patent applications, or other proprietary 553 rights that may cover technology that may be required to implement 554 this standard. Please address the information to the IETF at 555 ietf-ipr@ietf.org. 557 Disclaimer of Validity 559 This document and the information contained herein are provided on an 560 "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS 561 OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET 562 ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, 563 INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE 564 INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED 565 WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 567 Copyright Statement 569 Copyright (C) The Internet Society (2006). This document is subject 570 to the rights, licenses and restrictions contained in BCP 78, and 571 except as set forth therein, the authors retain all their rights. 573 Acknowledgment 575 Funding for the RFC Editor function is currently provided by the 576 Internet Society.