Peter Williams
2011-Nov-11 07:41 UTC
[Dovecot] Invalid "doveadm search" queries not rejected
Hello, I think I've encountered a bug in Dovecot 2.0.9 (as provided on CentOS 6). According to the doveadm-search-query(7) manual page, a "mailbox" specification can only come at the beginning of a search query. However, if I put a mailbox specification in the middle of a query, not only do I not get an error message, I get surprising results: $ doveadm search mailbox A |wc -l 6979 $ doveadm search mailbox B |wc -l 206 $ doveadm search mailbox A OR mailbox B |wc -l 42492 If it became possible to do boolean logic on mailbox queries, that'd be cool. But barring that, these invalid queries should be rejected. Relatedly, if I can only do simple mailbox filtering, does anyone know of a clever way to efficiently emulate more complex boolean logic? Please CC me on any replies as I'm not subscribed to the list. Thanks, Peter -- Peter Williams / peter at newton.cx
Timo Sirainen
2011-Nov-15 20:24 UTC
[Dovecot] Invalid "doveadm search" queries not rejected
On Thu, 2011-11-10 at 23:41 -0800, Peter Williams wrote:> I think I've encountered a bug in Dovecot 2.0.9 (as provided on CentOS > 6). > > According to the doveadm-search-query(7) manual page, a "mailbox" > specification can only come at the beginning of a search query.It doesn't exactly say that, but yeah, it doesn't also include MAILBOX and MAILBOX-GUID as search keys. Added now to future versions.> However, > if I put a mailbox specification in the middle of a query, not only do I > not get an error message, I get surprising results: > > $ doveadm search mailbox A |wc -l > 6979 > $ doveadm search mailbox B |wc -l > 206 > $ doveadm search mailbox A OR mailbox B |wc -l > 42492I'm pretty sure this was fixed in v2.0.14.> If it became possible to do boolean logic on mailbox queries, that'd be > cool.It is.