[imapfilter-devel] UID SEARCH OR OR

Lefteris Chatzibarbas lefcha at hellug.gr
Thu Nov 9 23:30:59 EET 2006


Dylan Martin wrote:
> Hi, either I've found a problem with multiple ORs or I'm not getting
> how it's supposed to work.
> 
> myfilter = {
> 	{ 'cc = "bob"', 'to = "bob"', 'bcc = "bcc"' }
> }
> 
> produces a UID SEARCH that looks like this:
> 
> UID SEARCH ALL OR OR (cc "bob") (to "bob") (bcc "bob")
> 
> shouldn't that be something like?  Did I not read that RFC right?
> 
> UID SEARCH ALL OR ( (cc "bob") (to "bob") (bcc "bob") ) 

Hello,

According to the RFC 3501 or 2060, the syntax is:

  OR <search-key1> <search-key2>
    Messages that match either search key.

And a search-key can be something like (cc "bob") or (to "bob") or
another OR () (), eg.

  OR (cc "bob") (OR (to "bob") (bcc "bob"))

... which is the same as:

  OR OR (cc "bob") (to "bob") (bcc "bob")

... because this is actually:

  OR (OR (cc "bob") (to "bob")) (bcc "bob")

So OR is a binary operator used in prefix or polish notation, if you're
into language and automata theory...

L.




More information about the Imapfilter-devel mailing list