Bug 101463 - IMAP broken with newer Dovecot versions
Summary: IMAP broken with newer Dovecot versions
Status: RESOLVED FIXED
Alias: None
Product: kmail
Classification: Unmaintained
Component: IMAP (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-14 09:52 UTC by Timo Sirainen
Modified: 2007-09-14 12:17 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Timo Sirainen 2005-03-14 09:52:19 UTC
Version:            (using KDE KDE 3.3.2)
Installed from:    Debian testing/unstable Packages
OS:                Linux

Dovecot 1.0-test and 1.0-stable releases send FETCH replies a bit differently than earlier versions (and other IMAP servers). This breaks kmail completely, it shows only 0-1 messages per mailbox.

I'm guessing it's because kmail's IMAP code expects UID to be returned as first element (or in first line), but because Dovecot returns headers first, it breaks and doesn't know what to do with it. As kmail is the only client that I know of which breaks so badly with this, I'd rather not change Dovecot's code to be less optimal.

Here is an example protocol dump:

10 UID FETCH 28572:28583,28589:28592 (UID RFC822.SIZE FLAGS ENVELOPE BODY.PEEK[HEADER.FIELDS (REFERENCES)])

* 1 FETCH (ENVELOPE ("19 Jan 2005 01:29:42 +0200" NIL ((NIL NIL "Mail" "MISSING_DOMAIN")) ((NIL NIL "Mail" "MISSING_DOMAIN")) ((NIL NIL "Mail" "MISSING_DOMAIN")) NIL NIL NIL NIL NIL) BODY[HEADER.FIELDS (REFERENCES)] {2}



 UID 28572 RFC822.SIZE 723 FLAGS ())

* 2 FETCH (ENVELOPE ("Sat, 5 Mar 2005 21:30:13 +0200 (EET)" "subject" (("Timo Sirainen" NIL "cras" "oma.irssi.org")) (("Timo Sirainen" NIL "cras" "oma.irssi.org")) (("Timo Sirainen" NIL "cras" "oma.irssi.org")) ((NIL NIL "cras" "oma.irssi.org")) NIL NIL NIL "<20050305193013.6D429300DFC0C@oma.irssi.org>") BODY[HEADER.FIELDS (REFERENCES)] {2}



 UID 28573 RFC822.SIZE 399 FLAGS (\Seen))

...
10 OK Fetch completed.

11 UID STORE 0 -FLAGS.SILENT (\SEEN \ANSWERED \FLAGGED \DRAFT)

11 BAD Error in IMAP command UID: Invalid UID messageset
Comment 1 Carsten Burghardt 2005-04-04 22:34:41 UTC
On Monday 14 March 2005 09:52, Timo Sirainen wrote:
> Dovecot 1.0-test and 1.0-stable releases send FETCH replies a bit
> differently than earlier versions (and other IMAP servers). This breaks
> kmail completely, it shows only 0-1 messages per mailbox.


I'm not too keen to change the kioslave to support this as it works with all 
other servers. Nevertheless it would be good to have a test server. Is there 
any?


Carsten
Comment 2 Timo Sirainen 2005-04-04 23:00:21 UTC
And from my point of view kmail is the only one that breaks completely with RFC compliat IMAP replies ;)

But, I gave up with the most recent 1.0-test release and changed it to work like other servers. So my test server also uses now the new code and I don't have any running with the old code..
Comment 3 Matt Howard 2005-04-05 21:18:01 UTC
I still have a package I built without the changed behavior on a box of mine.  I can get it ready to go in less than 10 minutes if you're still interested in looking at this.
Comment 4 Carsten Burghardt 2005-05-23 21:28:48 UTC
From a quick look at the parsing I'd say it should work.
Matt, any chance to setup a test account?
Comment 5 Matt Howard 2005-05-23 21:46:27 UTC
imaps://home.hattmoward.org

burghardt
kMail!test

You can throw test messages at 'burghardt@home.hattmoward.org', and ssh in too if you want to check things over from a shell.  I already sent two short tests there.
Comment 6 Carsten Burghardt 2005-05-23 23:21:21 UTC
SVN commit 417539 by burghard:

Handle out-of-order UIDs.
BUGS:101463


 M  +4 -4      imapparser.cc  


--- trunk/KDE/kdepim/kioslaves/imap4/imapparser.cc #417538:417539
@@ -1396,7 +1396,7 @@
         }
         else if (word == "BODY[]" )
         {
-	  // Do the same as with "RFC822"
+          // Do the same as with "RFC822"
           parseLiteralC(inWords, true);
         }
         else if (word == "BODYSTRUCTURE")
@@ -1429,10 +1429,10 @@
           else 
             lastHandled = new imapCache();
 
-          if (envelope || seenUid.isEmpty ())
+          if (seenUid.isEmpty ())
           {
-            // we have seen this one already
-            // or don't know where to put it
+            // unknown what to do
+            kdDebug(7116) << "imapParser::parseFetch - UID empty" << endl;
           }
           else
           {