Hello,

I have fixed the bug that caused the failure with Sylpheed.

It took some hours of tracking, but the fix itself is of the one-liner
kind.

I'm attaching the patch. My coding feat is done now, so I will now put
up a Web page with all my four patches (I propose all of them for
2.0.1).

In the process of tracking down the bug, I have found RFC non-compliance
in the search code. Apparently it does not handle searches for UIDs (and
perhaps sequence numbers too) with ranges that start with the bigger
number. I.e. the following commands:

SEARCH UID *:1
SEARCH UID 335:12

are supposed to work as per RFC 3501 (exactly like 1:* and 12:335,
respectively). But they won't.

One solution would be to modify the string when it's processed in
check_msg_set(), swapping the set parameters in such cases. Another
would be to modify build_set() and build_uid_set() to handle teh cases
correctly. I'm afraid I won't be able to do either while being sure of
not breaking something. 

Should I, perhaps, file a bug in Mantis? While this RFC option is
unlikely to be used in real life, it's still in the RFC, so this is a
bug.

Yours, Mikhail Ramendik

P.S. Sylpheed's IMAP folder handling seems crazy, and while it works
now, it causes massive dbmail CPU load (because of endless FETCHes and
SEARCHes with comma-separated lists of UIDs, instead of one lagre range
request). I'll write to sylpheed-claws-users on that. And Evolution
handles fetches right but eats RAM and somehow breaks on searches
(timeout? it never tells). Is there a *normal* IMAP client for Linux out
there?  
--- dbmail-orig/imaputil.c	2004-10-30 02:33:55.258888527 +0400
+++ dbmail-new/imaputil.c	2004-10-30 02:33:43.068228250 +0400
@@ -1,6 +1,8 @@
 /*
  Copyright (C) 1999-2004 IC & S  [EMAIL PROTECTED]
 
+ Modified by Mikhail Ramendik [EMAIL PROTECTED] (MR)
+
  This program is free software; you can redistribute it and/or 
  modify it under the terms of the GNU General Public License 
  as published by the Free Software Foundation; either 
@@ -2866,6 +2868,7 @@
 			 * it is valid -> check *sep
 			 */
 			if (*sep == ':') {
+                                result = 1; /*MR as we have a valid number here, let's tell the code below that it should run*/
 				for (msn = 0; mb->seq_list[msn] < num;
 				     msn++);
 				if (msn >= mb->exists)

Reply via email to