{"id":4663,"date":"2014-06-06T09:37:21","date_gmt":"2014-06-06T07:37:21","guid":{"rendered":"http:\/\/www.limilabs.com\/blog\/?p=4663"},"modified":"2014-06-06T09:37:21","modified_gmt":"2014-06-06T07:37:21","slug":"ideaimapserver-imap-search-parentheses-bug","status":"publish","type":"post","link":"https:\/\/www.limilabs.com\/blog\/ideaimapserver-imap-search-parentheses-bug","title":{"rendered":"IdeaImapServer IMAP search parentheses bug"},"content":{"rendered":"<p>IdeaImapServer doesn&#8217;t recognize parenthesis in IMAP search command.<\/p>\n<p><a href=\"\/mail\/rfc\/3501\">RFC 3501<\/a> is clear:<\/p>\n<blockquote><p>A search key can also be a parenthesized list of one or more search keys (e.g., for use with the OR and NOT keys).<\/p><\/blockquote>\n<p>Please note that RFC document is not talking, if a server SHOULD or MUST support parentheses. It tells that any search key can always be a parenthesized list.<\/p>\n<p>What is worth mentioning, although IMAP search uses polish notation (which doesn&#8217;t need parenthesis by itself) <a href=\"\/blog\/imap-search-requires-parentheses\">IMAP search command syntax actually requires parentheses<\/a>.<\/p>\n<p><code>UID SEARCH (OR SUBJECT subject BODY body)<\/code> &#8211; fails, while:<br \/>\n<code>UID SEARCH OR SUBJECT subject BODY body<\/code> &#8211; succeeds.<\/p>\n<p>This is the log from the server minus the authentication (note that 2nd search returns one email):<\/p>\n<p><code><br \/>\nS: * OK serwer1476502.home.pl IdeaImapServer v0.80 ready<br \/>\nC: 21a04 CAPABILITY<br \/>\nS: * CAPABILITY IMAP4rev1 LITERAL+ CHILDREN I18NLEVEL=1 IDLE SORT UIDPLUS UNSELECT XLIST AUTH=PLAIN AUTH=LOGIN<br \/>\nC: 98104 UID SEARCH (OR SUBJECT subject BODY body)<br \/>\n<span style=\"color: #ff0000\">S: 98104 BAD Unknown argument: (OR SUBJECT subject BODY body<\/span><br \/>\nC: 16e37 UID SEARCH OR SUBJECT subject BODY body<br \/>\nS: * SEARCH 1<br \/>\nS: 16e37 OK Completed<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>IdeaImapServer doesn&#8217;t recognize parenthesis in IMAP search command. RFC 3501 is clear: A search key can also be a parenthesized list of one or more search keys (e.g., for use with the OR and NOT keys). Please note that RFC document is not talking, if a server SHOULD or MUST support parentheses. It tells that [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[98,28],"class_list":["post-4663","post","type-post","status-publish","format-standard","hentry","category-news","tag-bug","tag-imap"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/posts\/4663"}],"collection":[{"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/comments?post=4663"}],"version-history":[{"count":12,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/posts\/4663\/revisions"}],"predecessor-version":[{"id":4680,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/posts\/4663\/revisions\/4680"}],"wp:attachment":[{"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/media?parent=4663"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/categories?post=4663"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/tags?post=4663"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}