Closed
Bug 220256
Opened 21 years ago
Closed 21 years ago
downloading imap mails when going offline fails with large numbers of non-contiguous messages
Categories
(MailNews Core :: Networking: IMAP, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: lee.essen, Assigned: Bienvenu)
Details
Attachments
(1 file)
1.18 KB,
patch
|
Bienvenu
:
superreview+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (compatible; Konqueror/3.1; Linux)
Build Identifier: Mozilla Thunderbird 0.2 (20030911)
When downloading mails prior to going offline, with a large number of non-contiguous
ID's the server responds with "invalid command argument".
(NOTE: suggested fix included)
Reproducible: Always
Steps to Reproduce:
1. Fill your mailbox with several hundred messages
2. Delete every other one
3. Go offline and download the mail
Actual Results:
Message box pops up saying the command failed with "invalid command argument"
Expected Results:
The mail should have downloaded.
Upon investigation it seems that the problem is caused by the routine that forms the list of
message ids for the PEEK[] command.
AllocateImapUidString (in mailnews/imap/src/nsImapUtils.cpp)
If the list is very long (over 950 characters) the code exits a loop AFTER putting a trailing
comma on the list, this violates the IMAP protocol and the server complains.
My suggested patch is to move the comma-adding code after the length checking code...
i.e.
diff -uNr mozilla.orig/mailnews/imap/src/nsImapUtils.cpp
mozilla/mailnews/imap/src/nsImapUtils.cpp
--- mozilla.orig/mailnews/imap/src/nsImapUtils.cpp 2003-07-22 14:57:44.000000000
+0100
+++ mozilla/mailnews/imap/src/nsImapUtils.cpp 2003-09-25 06:58:45.000000000 +0100
@@ -421,8 +421,8 @@
returnString.AppendInt(startSequence);
returnString += ':';
returnString.AppendInt(curSequenceEnd);
- if (!lastKey)
- returnString += ',';
+// if (!lastKey)
+// returnString += ',';
startSequence = nextKey;
curSequenceEnd = startSequence;
curFlagStateIndex = -1;
@@ -432,8 +432,8 @@
startSequence = nextKey;
curSequenceEnd = startSequence;
returnString.AppendInt(msgUids[keyIndex]);
- if (!lastKey)
- returnString += ',';
+// if (!lastKey)
+// returnString += ',';
curFlagStateIndex = -1;
}
// check if we've generated too long a string - if there's no flag state,
@@ -444,6 +444,10 @@
msgCount = total;
break;
}
+ // LEE: If we are not the last item then we need to add the comma
+ // but it's important we do it here, after the length check
+ if (!lastKey)
+ returnString += ',';
}
}
Assignee | ||
Comment 1•21 years ago
|
||
I'll look at this on Thursday...this got lost, sorry.
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Assignee | ||
Comment 2•21 years ago
|
||
cleaned up patch
Assignee | ||
Comment 3•21 years ago
|
||
Comment on attachment 142935 [details] [diff] [review]
proposed fix
sr=me. thx, Lee, I'll check this in.
Attachment #142935 -
Flags: superreview+
Assignee | ||
Comment 4•21 years ago
|
||
fix checked in, r/sr=me. thx, Lee.
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Updated•20 years ago
|
Product: MailNews → Core
Comment 5•20 years ago
|
||
To help others find this bug report, what you would see with a
Microsoft Exchange server when you simply try to access your mailbox,
is the following:
9 UID fetch 100,130:138,.....,3584,3588:3595, (UID RFC822.SIZE FLAGS BODY.PEEK[...])
9 BAD Protocol Error: "Invalid message set in FETCH command"
The UW imapd seems to be ok with the extra comma in the sequence set.
Updated•16 years ago
|
Product: Core → MailNews Core
You need to log in
before you can comment on or make changes to this bug.
Description
•