james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r1130248 - /james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/SearchProcessor.java
Date Wed, 01 Jun 2011 18:05:09 GMT
Author: norman
Date: Wed Jun  1 18:05:08 2011
New Revision: 1130248

URL: http://svn.apache.org/viewvc?rev=1130248&view=rev
Log:
Fix header exist searching. See IMAP-311

Modified:
    james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/SearchProcessor.java

Modified: james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/SearchProcessor.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/SearchProcessor.java?rev=1130248&r1=1130247&r2=1130248&view=diff
==============================================================================
--- james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/SearchProcessor.java
(original)
+++ james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/SearchProcessor.java
Wed Jun  1 18:05:08 2011
@@ -240,7 +240,13 @@ public class SearchProcessor extends Abs
         case SearchKey.TYPE_FROM:
             return SearchQuery.address(AddressType.From, key.getValue());
         case SearchKey.TYPE_HEADER:
-            return SearchQuery.headerContains(key.getName(), key.getValue());
+            String value = key.getValue();
+            // Check if header exists if the value is empty. See IMAP-311
+            if (value == null || value.length() == 0) {
+                return SearchQuery.headerExists(key.getName());
+            } else {
+                return SearchQuery.headerContains(key.getName(), value);
+            }
         case SearchKey.TYPE_KEYWORD:
             return SearchQuery.flagIsSet(key.getValue());
         case SearchKey.TYPE_LARGER:



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message