Author Topic: Empty Folders - Error in IMAP-Syntax  (Read 3583 times)

Offline Trueffelwurm

  • Newbie
  • *
  • Posts: 2
Empty Folders - Error in IMAP-Syntax
« on: January 29, 2008, 08:48:39 AM »
Hi, i installed Roundcubemail 0.1-RC2 on my linux machine with qmail an courier-imap service.
I have several Folders in my mailbox, some are displayed empty in Roundcubemail.

I figured out that there ar errors in some IMAP-FETCH-Querys looking like this:
> SORT (DATE) US-ASCII ALL
< SORT 3 2 17 16 15 1 14 13 12 11 7 18 4 19 5 6 20 22 21 23
< OK SORT done.

> FETCH 3,2,17,16,15,1,14,13,12,11,7,18,4,19,5,6,20,22,21,23,,,,,,,
    (BODY.PEEK[HEADER.FIELDS (DATE FROM TO SUBJECT REPLY-TO IN-REPLY-TO CC BCC CONTENT-TRANSFER-ENCODING CONTENT-TYPE MESSAGE-ID REFERENCE)])

< NO Error in IMAP command received by server.

Anyone else got this Problem or maybe a solution?

Thanks!

Offline Trueffelwurm

  • Newbie
  • *
  • Posts: 2
Re: Empty Folders - Error in IMAP-Syntax
« Reply #1 on: January 30, 2008, 01:28:50 PM »
I found a Workaround...  8)

When I disable sorting in my IMAP-Config (IMAP_DISABLETHREADSORT=1) the server wont answer sort-requerst. So RCM requests all Mails (1:x) whithout sorting.
Not perfect but it works!

> SORT (DATE) US-ASCII ALL
< NO This command is disabled by the system administrator.
> FETCH 1:28 (BODY.PEEK[HEADER.FIELDS (DATE FROM TO SUBJECT REPLY-TO IN-REPLY-TO CC BCC CONTENT-TRANSFER-ENCODING CONTENT-TYPE MESSAGE-ID REFERENCES DISPOSITION-NOTIFICATION-TO)])
< 1 FETCH (BODY[...


EDIT:
fyi
IMAP-Server is courier-imap 3.0.8

Offline jackdelamare

  • Jr. Member
  • **
  • Posts: 22
Re: Empty Folders - Error in IMAP-Syntax
« Reply #2 on: February 04, 2008, 08:13:46 AM »
I have contacted my server host and they have said they do not know what to edit but I should let them know anything if I find it. So pretty much they can edit files (config etc) so does this really work? Does this solve the problem of when you click on a folder it actually has messages in it instead of being empty?

Offline tobo

  • Newbie
  • *
  • Posts: 2
Re: Empty Folders - Error in IMAP-Syntax
« Reply #3 on: February 28, 2008, 06:05:24 AM »
There's another patch which doesn't need switching off SORT.
You should add a line in program/include/rcube_imap.inc , inside the definition _list_headers(...).

Here is the diff output:
Code: [Select]
564c564,567
<      $msgs = $msgs.','.$msg_index[$i];
---
>     {
>     if($msg_index[$i])
>      $msgs = $msgs.','.$msg_index[$i];
>     }

That is you should change the code on line 564 from the above one to the below one.
It concerns the 20080212 nightly build, on rc2 the line number may be different (but close).

What it does is that it doesn't let empty ",,"-s into the request string.
It's quite an adhoc hack, and though worked for me I didn't test it thoroughly (still have to try it in rc2).
Use it with caution :).