[Dovecot] FETCH FLAGS in response to SORT and SEARCH commands
Hi,
I am getting IMAP FETCH FLAGS in response to SORT and SEARCH commands
for my INBOX. See the following transcript between dovecot (marked
with S:) and an imap client (marked with C:) for an example SEARCH
command.
C: A004 UID SEARCH CHARSET ISO-8859-1 ALL TEXT {4}
C: test
S: + OK
S: * SEARCH 5 13 20 21 22 23 24 30 37 39 56 64 77 82 93 94 96 103 109
110 118 135 136 158 160 165 171 174 175 177 180 181 190 198 207 209
210 212 220 221 233 237 242 248 250 253 256 257 261 270 278 281 294
296 301 302 303 304 305 309 310 317 318 320 323 330 331 333 342 343
352 355 356 357 365 387 390 394 407 412 416 426 428 432 437 450 451
454 459 460 465 468 470 477 482 484 488 493 500 522 524 526 529 530
537 541 571 575 580 597 604 666 689 730 738 741 742 743 746 750 751
752 753 754 755 758 759 760 762 763 764 766 767 768 770 772 773 782
788 797 798 829 831 832 835 836 842 854 863 864 865 866 868 869 871
874 880 881 891 943 944 945 954 957 962 963 964 965 968 970 971 973
974 985 986 987
S: * 307 FETCH (FLAGS (\Seen $NotJunk $MDNSent))
S: * 381 FETCH (FLAGS (\Seen $NotJunk $MDNSent))
S: * 971 FETCH (FLAGS (\Seen $NotJunk NonJunk JunkRecorded))
S: * 307 FETCH (FLAGS (\Seen $NotJunk $MDNSent))
S: * 381 FETCH (FLAGS (\Seen $NotJunk $MDNSent))
S: * 971 FETCH (FLAGS (\Seen $NotJunk NonJunk JunkRecorded))
S: * 971 FETCH (FLAGS (\Seen $NotJunk NonJunk JunkRecorded))
S: * 307 FETCH (FLAGS (\Seen $NotJunk $MDNSent))
S: * 381 FETCH (FLAGS (\Seen $NotJunk $MDNSent))
S: * 971 FETCH (FLAGS (\Seen $NotJunk NonJunk JunkRecorded))
S: A004 OK Search completed
Mozilla Thunderbird and Apple Mail seem to be able to cope with this,
but squirrelmail chokes when it receives those flags.
I get them only for my INBOX and not for other folders like sent
mail, so the behaivour seems to depend on the content of the folder.
It occurrs at least with dovecot 1.0alpha4 and 1.0alpha5 using
maildir. I have not tested other versions / mbox format.
Is this behaviour expected?
regards, Michael
On 23.12.2005, at 02:43, Michael Doppler wrote:
I am getting IMAP FETCH FLAGS in response to SORT and SEARCH commands for my INBOX. See the following transcript between dovecot (marked with S:) and an imap client (marked with C:) for an example SEARCH command.
At the end of each IMAP command Dovecot checks if there have been external changes to mailbox (eg. by another IMAP client). If flags have changed, the flag changes are sent to client. This is how IMAP specification defines it should work.
Mozilla Thunderbird and Apple Mail seem to be able to cope with this, but squirrelmail chokes when it receives those flags.
Strange. UW-IMAP at least does the same thing, and I'd have thought Cyrus also does it, so this shouldn't be a Dovecot-specific problem.. It's definitely a Squirrelmail bug anyway.
Looks like you're using Squirrelmail at the same time you have another IMAP client open since you have those Junk-flags added. Most people probably don't do that which is why Squirrelmail doesn't break with them.
I get them only for my INBOX and not for other folders like sent mail, so the behaivour seems to depend on the content of the folder.
That's because the Junk flags get added only to INBOX by Thunderbird or Apple Mail.
Is this behaviour expected?
Yep. I think Squirrelmail should be fixed. If this problem occurs for other IMAP clients too, I might add yet another workaround option to fix this.
Hi,
thanks for your extensive reply!
At the end of each IMAP command Dovecot checks if there have been
external changes to mailbox (eg. by another IMAP client). If flags
have changed, the flag changes are sent to client. This is how IMAP
specification defines it should work.
I see. I already skimmed through one of the IMAP RFCs but was not
sure after reading it whether the FLAGS are also to be expected
after SEARCH and SORT commands.
Strange. UW-IMAP at least does the same thing, and I'd have thought
Cyrus also does it, so this shouldn't be a Dovecot-specific
problem.. It's definitely a Squirrelmail bug anyway.
I already prepared a patch for squirrelmail that fixes their bug, I
will send it to the developers a soon as it has been tested
thoroughly enough.
Looks like you're using Squirrelmail at the same time you have
another IMAP client open since you have those Junk-flags added.
Most people probably don't do that which is why Squirrelmail
doesn't break with them.
The strange thing is that I definitely didn't use another client at
the same time. I even replicated our production server in a vmware
and tried the same sequence with a single telnet session which still
produced those flags the first time after I have logged in. Another
strange thing is that the same FLAGS responses get repeated for the
same messages ( see ids 307, 381, 971 in my original post ), that is
only a minor issue though.
I moved a lot of mails from another imap account to the one i get the
flags with, maybe something went wrong with the maildir while moving
those messages. As soon as I have time I will compile a debug
version, attach to the imap process and step through the code to see
what happens.
Yep. I think Squirrelmail should be fixed. If this problem occurs
for other IMAP clients too, I might add yet another workaround
option to fix this.
As long as no proprietary clients have troubles with this I wouldn't
add a workaround. If other open source clients have problems with
that, they should be fixed as well. I will see if I can find someone
who can test with outlook and evolution and check how those clients
react.
regards, Michael
On 25.12.2005, at 13:56, Michael Doppler wrote:
Another strange thing is that the same FLAGS responses get repeated for the same messages ( see ids 307, 381, 971 in my original post ), that is only a minor issue though.
Oh. That is a bug in Dovecot then. Is this with mbox or maildir? Could you send your dovecot.index* files and the mailbox to me? Mailbox could be crippled in a way that it isn't readable, eg. http://dovecot.org/tools/mboxcrypt.pl
On Sun, 2005-12-25 at 14:29 +0200, Timo Sirainen wrote:
On 25.12.2005, at 13:56, Michael Doppler wrote:
Another strange thing is that the same FLAGS responses get repeated for the same messages ( see ids 307, 381, 971 in my original post ), that is only a minor issue though.
Oh. That is a bug in Dovecot then.
Fixed in CVS. Might have happened for mails with more than one keyword, with both mbox and maildir.
participants (2)
-
Michael Doppler
-
Timo Sirainen