1
2
3
4
5
6
7Network Working Group C. Daboo
8Request for Comments: 3685 Cyrusoft International, Inc.
9Category: Standards Track February 2004
10
11
12 SIEVE Email Filtering: Spamtest and VirusTest Extensions
13
14Status of this Memo
15
16 This document specifies an Internet standards track protocol for the
17 Internet community, and requests discussion and suggestions for
18 improvements. Please refer to the current edition of the "Internet
19 Official Protocol Standards" (STD 1) for the standardization state
20 and status of this protocol. Distribution of this memo is unlimited.
21
22Copyright Notice
23
24 Copyright (C) The Internet Society (2004). All Rights Reserved.
25
26Abstract
27
28 The SIEVE mail filtering language "spamtest" and "virustest"
29 extensions permit users to use simple, portable commands for spam and
30 virus tests on email messages. Each extension provides a new test
31 using matches against numeric 'scores'. It is the responsibility of
32 the underlying SIEVE implementation to do the actual checks that
33 result in values returned by the tests.
34
35Table of Contents
36
37 1. Introduction and Overview . . . . . . . . . . . . . . . . . . 2
38 2. SIEVE Extensions . . . . . . . . . . . . . . . . . . . . . . . 3
39 2.1. General Considerations . . . . . . . . . . . . . . . . . 3
40 2.2. Test spamtest. . . . . . . . . . . . . . . . . . . . . . 3
41 2.3. Test virustest . . . . . . . . . . . . . . . . . . . . . 4
42 3. Security Considerations . . . . . . . . . . . . . . . . . . . 5
43 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 6
44 4.1. spamtest registration. . . . . . . . . . . . . . . . . . 6
45 4.2. virustest registration . . . . . . . . . . . . . . . . . 6
46 5. References . . . . . . . . . . . . . . . . . . . . . . . . . . 7
47 5.1. Normative References . . . . . . . . . . . . . . . . . . 7
48 5.2. Informative References . . . . . . . . . . . . . . . . . 7
49 6. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 7
50 7. Intellectual Property Rights Statement . . . . . . . . . . . . 7
51 8. Author's Address . . . . . . . . . . . . . . . . . . . . . . . 8
52 9. Full Copyright Statement . . . . . . . . . . . . . . . . . . . 9
53
54
55
56
57
58Daboo Standards Track [Page 1]
59
60RFC 3685 SIEVE Spamtest and VirusTest Extensions February 2004
61
62
631. Introduction and Overview
64
65 SIEVE scripts are frequently being used to do spam and virus
66 filtering based on either implicit script tests (e.g., tests for
67 'black-listed' senders directly encoded in the SIEVE script), or via
68 testing messages modified by some external spam or virus checker that
69 handled the message prior to SIEVE. The use of third-party spam and
70 virus checker tools poses a problem since each tool has its own way
71 of indicating the result of its checks. These usually take the form
72 of a header added to the message, the content of which indicates the
73 status using some syntax defined by the particular tool. Each user
74 has to then create their own SIEVE scripts to match the contents of
75 these headers to do filtering. This requires the script to stay in
76 synchronization with the third party tool as it gets updated or
77 perhaps replaced with another. Thus scripts become tied to specific
78 environments, and lose portability.
79
80 The purpose of this document is to introduce two SIEVE tests that can
81 be used to implement 'generic' tests for spam and viruses in messages
82 processed via SIEVE scripts. These tests return a string containing
83 a range of numeric values that indicate the severity of spam or
84 viruses in a message, or a string that indicates the message has not
85 passed through any spam or virus checking tools. The spam and virus
86 checks themselves are handled by the underlying SIEVE implementation
87 in whatever manner is appropriate, and the implementation maps the
88 results of these checks into the numeric ranges defined by the new
89 tests. Thus a SIEVE implementation can have a spam test that
90 implicitly checks for third-party spam tool headers and determines
91 how those map into the spamtest numeric range.
92
93 In order to do numeric comparisons against the returned strings,
94 server implementations MUST also support the SIEVE relational
95 [RELATIONAL] extension, in addition to the extensions described here.
96 All examples below assume the relational extension is present.
97
98 Conventions for notations are as in [SIEVE] section 1.1, including
99 use of [KEYWORDS].
100
101 The term 'spam' is used in this document to refer to unsolicited or
102 unwanted email messages. This document does not attempt to define
103 what exactly constitutes spam, or how it should be identified, or
104 what actions should be taken when detected.
105
106 The term 'virus' is used in this document to refer to any type of
107 message whose content can cause malicious damage. This document does
108 not attempt to define what exactly constitutes a virus, or how it
109 should be identified, or what actions should be taken when detected.
110
111
112
113
114Daboo Standards Track [Page 2]
115
116RFC 3685 SIEVE Spamtest and VirusTest Extensions February 2004
117
118
1192. SIEVE Extensions
120
1212.1. General Considerations
122
123 The "spamtest" and "virustest" tests described below both return a
124 string that starts with a numeric value, followed by an optional
125 space (%x20) character and optional arbitrary text. The numeric
126 value can be compared to specific values using the SIEVE relational
127 [RELATIONAL] extension in conjunction with the "i;ascii-numeric"
128 comparator [ACAP], which will test for the presence of a numeric
129 value at the start of the string, ignoring any additional text in the
130 string. The additional text can be used to carry implementation
131 specific details about the tests performed and descriptive comments
132 about the result. Tests can be done using standard string
133 comparators against this text if it helps to refine behavior, however
134 this will break portability of the script as the text will likely be
135 specific to a particular implementation.
136
1372.2. Test spamtest
138
139 Syntax: spamtest [COMPARATOR] [MATCH-TYPE] <value: string>
140
141 SIEVE implementations that implement the "spamtest" test have an
142 identifier of "spamtest" for use with the capability mechanism.
143
144 The "spamtest" test evaluates to true if the spamtest result matches
145 the value. The type of match is specified by the optional match
146 argument, which defaults to ":is" if not specified.
147
148 The spamtest result is a string starting with a numeric value in the
149 range "0" (zero) through "10", with meanings summarized below:
150
151 spamtest interpretation
152 value
153
154 0 message was not tested for spam
155 1 message was tested and is clear of spam
156 2 - 9 message was tested and has a varying likelihood of
157 containing spam in increasing order
158 10 message was tested and definitely contains spam
159
160 The underlying SIEVE implementation will map whatever spam check is
161 done into this numeric range, as appropriate.
162
163
164
165
166
167
168
169
170Daboo Standards Track [Page 3]
171
172RFC 3685 SIEVE Spamtest and VirusTest Extensions February 2004
173
174
175 Examples:
176
177 require ["spamtest", "fileinto",
178 "relational", "comparator-i;ascii-numeric"];
179
180 if spamtest :value "eq" :comparator "i;ascii-numeric" "0"
181 {
182 fileinto "INBOX.unclassified";
183 }
184 elsif spamtest :value "ge" :comparator "i;ascii-numeric" "3"
185 {
186 fileinto "INBOX.spam-trap";
187 }
188
189 In this example, any message that has not passed through a spam check
190 tool will be filed into the mailbox "INBOX.unclassified". Any
191 message with a spamtest value greater than or equal to "3" is filed
192 into a mailbox called "INBOX.spam-trap" in the user's mailstore.
193
1942.3. Test virustest
195
196 Syntax: virustest [COMPARATOR] [MATCH-TYPE] <value: string>
197
198 SIEVE implementations that implement the "virustest" test have an
199 identifier of "virustest" for use with the capability mechanism.
200
201 The "virustest" test evaluates to true if the virustest result
202 matches the value. The type of match is specified by the optional
203 match argument, which defaults to ":is" if not specified.
204
205 The virustest result is a string starting with a numeric value in the
206 range "0" (zero) through "5", with meanings summarized below:
207
208 virustest interpretation
209 value
210
211 0 message was not tested for viruses
212 1 message was tested and contains no known viruses
213 2 message was tested and contained a known virus which
214 was replaced with harmless content
215 3 message was tested and contained a known virus
216 which was "cured" such that it is now harmless
217 4 message was tested and possibly contains a
218 known virus
219 5 message was tested and definitely contains a
220 known virus
221
222
223
224
225
226Daboo Standards Track [Page 4]
227
228RFC 3685 SIEVE Spamtest and VirusTest Extensions February 2004
229
230
231 The underlying SIEVE implementation will map whatever virus checks
232 are done into this numeric range, as appropriate. If the message has
233 not been categorized by any virus checking tools, then the virustest
234 result is "0".
235
236 Example:
237
238 require ["virustest", "fileinto",
239 "relational", "comparator-i;ascii-numeric"];
240
241 if virustest :value "eq" :comparator "i;ascii-numeric" "0"
242 {
243 fileinto "INBOX.unclassified";
244 }
245 if virustest :value "eq" :comparator "i;ascii-numeric" "4"
246 {
247 fileinto "INBOX.quarantine";
248 }
249 elsif virustest :value "eq" :comparator "i;ascii-numeric" "5"
250 {
251 discard;
252 }
253
254 In this example, any message that has not passed through a virus
255 check tool will be filed into the mailbox "INBOX.unclassified". Any
256 message with a virustest value equal to "4" is filed into a mailbox
257 called "INBOX.quarantine" in the user's mailstore. Any message with
258 a virustest value equal to "5" is discarded (removed) and not
259 delivered to the user's mailstore.
260
2613. Security Considerations
262
263 SIEVE implementations SHOULD ensure that "spamtest" and "virustest"
264 tests can only occur for messages that have gone through a legitimate
265 spam or virus check process. If such checks rely on the addition of
266 special headers to messages, it is the responsibility of the
267 implementation to ensure that such headers cannot be spoofed by the
268 sender, to prevent the implementation from being tricked into
269 returning the wrong result for the test.
270
271 Server administrators MUST ensure that the virus checking tools are
272 kept up to date, to provide reasonable protection for users using the
273 "virustest" test. Users should be made aware of the fact that the
274 "virustest" test does not provide a 100% reliable way to remove all
275 viruses, and they should continue to exercise caution when dealing
276 with messages of unknown content and origin.
277
278
279
280
281
282Daboo Standards Track [Page 5]
283
284RFC 3685 SIEVE Spamtest and VirusTest Extensions February 2004
285
286
287 Beyond that, the "spamtest" and "virustest" extensions do not raise
288 any security considerations that are not present in the base [SIEVE]
289 protocol, and these issues are discussed in [SIEVE].
290
2914. IANA Considerations
292
293 The following templates specify the IANA registration of the Sieve
294 extensions specified in this document:
295
2964.1. spamtest registration
297
298 To: iana@iana.org
299 Subject: Registration of new Sieve extension
300
301 Capability name: spamtest
302 Capability keyword: spamtest
303 Capability arguments: N/A
304 Standards Track/IESG-approved RFC XXXX: this RFC
305 Person and email address to contact for further information:
306
307 Cyrus Daboo
308 Cyrusoft International, Inc.
309 5001 Baum Blvd., Suite 780,
310 Pittsburgh, PA 15213
311 U.S.A.
312
313 <mailto:daboo@cyrusoft.com>
314
315 This information has been added to the list of sieve extensions given
316 on http://www.iana.org/assignments/sieve-extensions.
317
3184.2. virustest registration
319
320 To: iana@iana.org
321 Subject: Registration of new Sieve extension
322
323 Capability name: virustest
324 Capability keyword: virustest
325 Capability arguments: N/A
326 Standards Track/IESG-approved RFC XXXX: this RFC
327 Person and email address to contact for further information:
328
329 Cyrus Daboo
330 Cyrusoft International, Inc.
331 5001 Baum Blvd., Suite 780,
332 Pittsburgh, PA 15213
333 U.S.A.
334
335
336
337
338Daboo Standards Track [Page 6]
339
340RFC 3685 SIEVE Spamtest and VirusTest Extensions February 2004
341
342
343 <mailto:daboo@cyrusoft.com>
344
345 This information has been added to the list of sieve extensions given
346 on http://www.iana.org/assignments/sieve-extensions.
347
3485. References
349
3505.1. Normative References
351
352 [KEYWORDS] Bradner, S., "Key words for use in RFCs to Indicate
353 Requirement Levels", BCP 14, RFC 2119, March 1997.
354
355 [RELATIONAL] Segmuller, W., "Sieve Extension: Relational Tests", RFC
356 3431, December 2002.
357
358 [SIEVE] Showalter, T., "Sieve: A Mail Filtering Language", RFC
359 3028, January 2001.
360
3615.2. Informative References
362
363 [ACAP] Newman, C. and J. Myers, "ACAP -- Application
364 Configuration Access Protocol", RFC 2244, November 1997.
365
3666. Acknowledgments
367
368 Thanks to Tony Hansen, Jutta Degener, Ned Freed, Ashish Gawarikar and
369 Nigel Swinson for comments and corrections.
370
3717. Intellectual Property Rights Statement
372
373 The IETF takes no position regarding the validity or scope of any
374 intellectual property or other rights that might be claimed to
375 pertain to the implementation or use of the technology described in
376 this document or the extent to which any license under such rights
377 might or might not be available; neither does it represent that it
378 has made any effort to identify any such rights. Information on the
379 IETF's procedures with respect to rights in standards-track and
380 standards-related documentation can be found in BCP-11. Copies of
381 claims of rights made available for publication and any assurances of
382 licenses to be made available, or the result of an attempt made to
383 obtain a general license or permission for the use of such
384 proprietary rights by implementors or users of this specification can
385 be obtained from the IETF Secretariat.
386
387
388
389
390
391
392
393
394Daboo Standards Track [Page 7]
395
396RFC 3685 SIEVE Spamtest and VirusTest Extensions February 2004
397
398
399 The IETF invites any interested party to bring to its attention any
400 copyrights, patents or patent applications, or other proprietary
401 rights which may cover technology that may be required to practice
402 this standard. Please address the information to the IETF Executive
403 Director.
404
4058. Author's Address
406
407 Cyrus Daboo
408 Cyrusoft International, Inc.
409 5001 Baum Blvd., Suite 780,
410 Pittsburgh, PA 15213
411 U.S.A.
412
413 EMail: daboo@cyrusoft.com
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450Daboo Standards Track [Page 8]
451
452RFC 3685 SIEVE Spamtest and VirusTest Extensions February 2004
453
454
4559. Full Copyright Statement
456
457 Copyright (C) The Internet Society (2004). All Rights Reserved.
458
459 This document and translations of it may be copied and furnished to
460 others, and derivative works that comment on or otherwise explain it
461 or assist in its implementation may be prepared, copied, published
462 and distributed, in whole or in part, without restriction of any
463 kind, provided that the above copyright notice and this paragraph are
464 included on all such copies and derivative works. However, this
465 document itself may not be modified in any way, such as by removing
466 the copyright notice or references to the Internet Society or other
467 Internet organizations, except as needed for the purpose of
468 developing Internet standards in which case the procedures for
469 copyrights defined in the Internet Standards process must be
470 followed, or as required to translate it into languages other than
471 English.
472
473 The limited permissions granted above are perpetual and will not be
474 revoked by the Internet Society or its successors or assignees.
475
476 This document and the information contained herein is provided on an
477 "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
478 TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
479 BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
480 HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
481 MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
482
483Acknowledgement
484
485 Funding for the RFC Editor function is currently provided by the
486 Internet Society.
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506Daboo Standards Track [Page 9]
507
508