diff --git a/src/lib-sieve/plugins/body/tst-body.c b/src/lib-sieve/plugins/body/tst-body.c index b74107da1adec13c764c4130caa6966618e9e74a..1d58e30f1de0fa0313bab4c0be0c1322f2d01c82 100644 --- a/src/lib-sieve/plugins/body/tst-body.c +++ b/src/lib-sieve/plugins/body/tst-body.c @@ -305,7 +305,7 @@ static int ext_body_operation_execute int ret = SIEVE_EXEC_OK; int opt_code = 0; int mret; - const struct sieve_comparator *cmp = &i_octet_comparator; + const struct sieve_comparator *cmp = &i_ascii_casemap_comparator; const struct sieve_match_type *mtch = &is_match_type; enum tst_body_transform transform; struct sieve_coded_stringlist *key_list, *ctype_list = NULL; diff --git a/tests/extensions/body/basic.svtest b/tests/extensions/body/basic.svtest index 786ab5b2a59120b0cad93cd00ef1f619e10a4e45..f9dab31da92928130a3fca12f1d82c6a42ed87d0 100644 --- a/tests/extensions/body/basic.svtest +++ b/tests/extensions/body/basic.svtest @@ -12,6 +12,14 @@ Test! . ; +/* Empty line + * + * RFC 5173: + * 'The body test matches content in the body of an email message, that + * is, anything following the first empty line after the header. (The + * empty line itself, if present, is not considered to be part of the + * body.)' + */ test "The empty line" { if not body :raw :is text: @@ -36,3 +44,22 @@ Test! test_fail "body test matches nonsense"; } } + +/* Default comparator and match type + * + * RFC 5173: + * 'The COMPARATOR and MATCH-TYPE keyword parameters are defined in + * [SIEVE]. As specified in Sections 2.7.1 and 2.7.3 of [SIEVE], the + * default COMPARATOR is "i;ascii-casemap" and the default MATCH-TYPE is + * ":is".' + */ + +test "Defaults" { + if anyof ( body :raw "Test", body :raw "*Test*" ) { + test_fail "default match type is not :is as is required"; + } + + if allof( not body :raw :contains "tesT", body :raw :contains "Test" ) { + test_fail "default comparator is not i;ascii-casemap as is required"; + } +}