    }
    result = [NSArray arrayWithObjects:objs count:cnt];
    if (objs) free(objs);
+Index: sope-mime/NGImap4/EOQualifier+IMAPAdditions.m
+===================================================================
+--- sope-mime/NGImap4/EOQualifier+IMAPAdditions.m	(revision 1660)
++++ sope-mime/NGImap4/EOQualifier+IMAPAdditions.m	(working copy)
+@@ -57,9 +57,9 @@
+                             @"draft", @"flagged", @"new", @"old", @"recent",
+                             @"seen", @"unanswered", @"undeleted", @"undraft",
+                             @"unflagged", @"unseen", nil];
+-  OtherKeyWords = [[NSArray alloc] initWithObjects:
+-                             @"bcc", @"body", @"cc", @"from", @"subject",
+-                             @"text", @"to", @"keyword", @"unkeyword", nil];
++  OtherKeyWords = [[NSArray alloc] initWithObjects: @"all", @"bcc", @"body",
++                                   @"cc", @"from", @"subject", @"text", @"to",
++                                   @"keyword", @"uid", @"unkeyword", nil];
+   
+   debugOn = [ud boolForKey:@"ImapDebugQualifierGeneration"];
+ }
+@@ -280,15 +280,22 @@
+   return nil;
+ }
+ 
+-- (NSString *)imap4OperatorForDateComparisonSelector:(SEL)lselector {
++- (NSString *)imap4OperatorForDateKeyword:(NSString *)dkey
++andComparisonSelector:(SEL)lselector {
++  NSString *operatorPrefix, *dateOperator;
++  if ([key isEqualToString: @"date"])
++    operatorPrefix = @"sent";
++  else
++    operatorPrefix = @"";
++
+   if (sel_eq(lselector, EOQualifierOperatorEqual))
+-    return @" senton ";
+-  if (sel_eq(lselector, EOQualifierOperatorGreaterThan))
+-    return @" sentsince ";
+-  if (sel_eq(lselector, EOQualifierOperatorLessThan))
+-    return @" sentbefore ";
++    dateOperator = @"on";
++  else if (sel_eq(lselector, EOQualifierOperatorGreaterThan))
++    dateOperator = @"since";
++  else if (sel_eq(lselector, EOQualifierOperatorLessThan))
++    dateOperator = @"before";
+   
+-  return nil;
++  return [NSString stringWithFormat: @" %@%@ ", operatorPrefix, dateOperator];
+ }
+ 
+ - (NSException *)appendToImap4SearchString:(NSMutableString *)search 
+@@ -314,7 +321,7 @@
+   if (insertNot) 
+     [search appendString:@"not "];
+   
+-  if ([lkey isEqualToString:@"date"]) {
++  if ([lkey isEqualToString:@"date"] || [lkey isEqualToString:@"receive-date"]) {
+     NSString *s;
+     
+     if (![lvalue isKindOfClass:[NSCalendarDate class]]) {
+@@ -322,7 +329,8 @@
+ 		     @"expected a NSDate as value"];
+     }
+     
+-    if ((s = [self imap4OperatorForDateComparisonSelector:lselector]) == nil)
++    if ((s = [self imap4OperatorForDateKeyword:lkey
++                         andComparisonSelector:lselector]) == nil)
+       return [self invalidImap4SearchQualifier:@"unexpected selector"];
+     
+     // TODO: operator created but NOT added?
 Index: sope-mime/NGImap4/NGImap4ResponseParser.m
 ===================================================================
 --- sope-mime/NGImap4/NGImap4ResponseParser.m	(revision 1660)

   }
   return data;
 }
Index: sope-core/NGExtensions/NGExtensions/NSString+Ext.h
===================================================================
--- sope-core/NGExtensions/NGExtensions/NSString+Ext.h	(revision 1660)

===================================================================
--- sope-mime/NGImap4/ChangeLog	(revision 1660)
+++ sope-mime/NGImap4/ChangeLog	(working copy)
@@ -1,3 +1,57 @@
+2009-10-06  Wolfgang Sourdeau  <wsourdeau@inverse.ca>
+
+	* EOQualifier+IMAPAdditions.m
+	(-imap4OperatorForDateKeyword:andComparisonSelector:): modified
+	operator handler to handle "receive-date" search key as well as
+	"date", prefixing the real filter with "sent" or not.
+
+2009-09-22  Wolfgang Sourdeau  <wsourdeau@inverse.ca>
+
+	* NGImap4Client.m (_sopeSORT:qualifier:encoding:): added support
