bugGNU Mailutils - Bugs: bug #14580, imap mailbox backend sometimes...

 
 

bug #14580: imap mailbox backend sometimes generates wrong sequences

Submitted by:  None
Submitted on:  Mon 19 Sep 2005 05:06:03 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: Sergey Poznyakoff <gray>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 19 Sep 2005 06:30:12 PM UTC, comment #1:

Thanks for reporting. Attached is the right fix for version 0.6. It should apply cleanly to 0.6.90 as well.

Sergey Poznyakoff <gray>
Project AdministratorIn charge of this item.
Mon 19 Sep 2005 05:06:03 PM UTC, original submission:

In some cases, the IMAP mailbox backend generates malformed message number sequences, e.g.

g8 STORE 1,3, +FLAGS.SILENT (\Deleted)

Note the trailing comma. This is wrong according to the current version of the relevant IMAP RFC and breaks at least one IMAP server used by a large European IASP. The answer to the above request:

g8 BAD invalid command: "at column 14: parse error, unexpected ICMD_SPACE, expecting ICMD_NUMBER or ICMD_STAR"

I reproduced this by creating a test folder "INBOX.Sprachnachrichten", filling it with four messages and then running the attached program. The bug is present at least in stable 0.6 as well as the version in Debian sid (0.6.90).

We have a workaround, but it doesn't feel right: Remove the trailing comma if it's present. Instead, the sequence should be generated without the trailing comma in the first place.

This is the diff for our workaround:

--- mailutils-0.6/mailbox/imap/mbox.c 2005-01-26 09:16:26.000000000 +0100
+++ mailutils-0.6/mailbox/imap/mbox.c.new 2005-01-26 09:16:18.000000000 +0100
@@ -862,6 +862,17 @@ imap_expunge (mailbox_t mailbox)
free (set);
return 0;
}
+ /removing "," if it is at the end of the list/
+ {
+ char *ctrl = NULL;
+ ctrl = strrchr(set,',');
+ if(ctrl != NULL){
+ if(*(++ctrl) == '\0'){
+ *(--ctrl)='\0';
+ }
+ }
+ }
+
status = imap_writeline (f_imap,
"g%d STORE %s +FLAGS.SILENT (\\Deleted)\r\n",
f_imap->seq++, set);

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #3180:  diff added by gray (591B - application/octet-stream)
file #3179:  t1.c added by None (2KiB - text/x-csrc - testcase)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 6 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Mon 19 Sep 2005 06:30:12 PM UTCgrayStatusNone=>Fixed
  Assigned toNone=>gray
  Open/ClosedOpen=>Closed
  Attached File-=>Added diff, #2966
Mon 19 Sep 2005 05:16:14 PM UTCgeflaCarbon-Copy-=>Added gefla
Mon 19 Sep 2005 05:06:03 PM UTCNoneAttached File-=>Added t1.c, #2965

Back to the top


Powered by Savane 3.1-cleanup1