Re: [Exim] Exim and Sieve rules

Páxina inicial
Borrar esta mensaxe
Responder a esta mensaxe
Autor: Michael Haardt
Data:  
Para: exim-users
Asunto: Re: [Exim] Exim and Sieve rules
> The problem is that the regular expression "Yes*" matches "Ye" followed
> by 0 or more "s"s. So, case sensitivity aside, if the following line
> was in the mail:
>
>      X-Spam-Status: No (score=1.2): LINES_OF_YELLING=1.2
>                                              ^^

>
> the message would incorrectly be dumped into the Junk folder.


I just checked and this is the result for Exim 4.33:

String comparison (match :matches, comparison "i;ascii-casemap"):
Search = Yes* (4 chars)
Inside = No (score=1.2): LINES_OF_YELLING=1.2 (36 chars)
Result false

> Using Cyrus sieve filters, the line:
>      if header :matches "X-Spam-Status" "Yes.*"

>
> works as expected.


Am I wrong in thinking that this violates RFC 3028, Section 2.7.1?

The ":matches" version specifies a wildcard match using the
characters "*" and "?". "*" matches zero or more characters, and "?"
matches a single character. "?" and "*" may be escaped as "\\?" and
"\\*" in strings to match against themselves. The first backslash
escapes the second backslash; together, they escape the "*". This is
awkward, but it is commonplace in several programming languages that
use globs and regular expressions.

To me, it sounds like "*" and "?" are used as in the shell, not as in
regular expressions. ".*" would match a dot and zero or more following
characters.

Michael