IMAP4 IDLE does not work. imapd_index == NULL ?
Bernhard T
cyrus at habmalnefrage.de
Thu Feb 5 08:04:42 EST 2015
Am 2015-02-04 um 12:10 schrieb Bron Gondwana:
> Sure, you have to select a mailbox if you want to IDLE on it. If you have selected a mailbox, then imapd_index is that mailbox.
>
> Bron.
>
>
Excellent Tip, Thank you!
Problem Solved. *facepalm*
This time instead of using the imap client's trace functionality,
I used tcpdump to record the conversation between client and server.
(and disabled tls, instead using ssh port forward for security)
Turns out, the idling client was misconfigured and instead of selecting
INBOX it selected '--'.
All other IMAP servers I'm using it with, were very forgiving and
refused to switch to '--', instead they let the client stay in the
previously selected 'INBOX'. Thus when the client started 'IDLE' it
worked as expected.
Cyrus on the other hand, responded 'GDGA6 NO Mailbox does not exist',
but DID switch the mailbox of the client from 'INBOX' to a
Mailbox-Does-Not-Exist State.
Thus the following 'IDLE' command did not succeed.
So first, thanks for helping me track down this problem.
Second I propose that Cyrus, if given an invalid mailbox name as
argument to SELECT, stays in the previously selected mailbox if any,
as this seems to be how other IMAP servers handle it.
Thanks and cheers,
Bernhard
-------- Packet capture with misconfigured client -----------
> GDGA2 CAPABILITY
< * CAPABILITY IMAP4rev1 LITERAL+ ID ENABLE ACL RIGHTS=kxte QUOTA
MAILBOX-REFERRALS NAMESPACE UIDPLUS NO_ATOMIC_RENAME UNSELECT CHILDREN
MULTIAPPEND BINARY CATENATE CONDSTORE ESEARCH SORT SORT=MODSEQ
SORT=DISPLAY THREAD=ORDEREDSUBJECT THREAD=REFERENCES ANNOTATEMORE
LIST-EXTENDED WITHIN QRESYNC SCAN XLIST URLAUTH URLAUTH=BINARY
LOGINDISABLED COMPRESS=DEFLATE IDLE
< GDGA2 OK Completed
> GDGA3 SELECT INBOX
< * 0 EXISTS
< * 0 RECENT
< * FLAGS (\Answered \Flagged \Draft \Deleted \Seen)
< * OK [PERMANENTFLAGS (\Answered \Flagged \Draft \Deleted \Seen \*)] Ok
< * OK [UIDVALIDITY 1212974392] Ok
< * OK [UIDNEXT 43071] Ok
< * OK [HIGHESTMODSEQ 480] Ok
< * OK [URLMECH INTERNAL] Ok
< GDGA3 OK [READ-WRITE] Completed
> GDGA4 EXPUNGE
< GDGA4 OK Completed
> GDGA5 CLOSE
< GDGA5 OK Completed
> GDGA6 SELECT --
< GDGA6 NO Mailbox does not exist
> GDGA7 IDLE
< + idling
> DONE
< GDGA7 OK Completed
-------- Packet capture with fixed client -----------
> DKKI2 CAPABILITY
< * CAPABILITY IMAP4rev1 LITERAL+ ID ENABLE ACL RIGHTS=kxte QUOTA
MAILBOX-REFERRALS NAMESPACE UIDPLUS NO_ATOMIC_RENAME UNSELECT CHILDREN
MULTIAPPEND BINARY CATENATE CONDSTORE ESEARCH SORT SORT=MODSEQ
SORT=DISPLAY THREAD=ORDEREDSUBJECT THREAD=REFERENCES ANNOTATEMORE
LIST-EXTENDED WITHIN QRESYNC SCAN XLIST URLAUTH URLAUTH=BINARY
LOGINDISABLED COMPRESS=DEFLATE IDLE
< DKKI2 OK Completed
> DKKI3 SELECT INBOX
< * 4 EXISTS
< * 0 RECENT
< * FLAGS (\Answered \Flagged \Draft \Deleted \Seen)
< * OK [PERMANENTFLAGS (\Answered \Flagged \Draft \Deleted \Seen \*)] Ok
< * OK [UNSEEN 1] Ok
< * OK [UIDVALIDITY 1212974392] Ok
< * OK [UIDNEXT 43075] Ok
< * OK [HIGHESTMODSEQ 484] Ok
< * OK [URLMECH INTERNAL] Ok
< DKKI3 OK [READ-WRITE] Completed
> DKKI4 FETCH 1:4 (UID RFC822.SIZE)
< * 1 FETCH (UID 43071 RFC822.SIZE 4316)
< * 2 FETCH (UID 43072 RFC822.SIZE 1833)
< * 3 FETCH (UID 43073 RFC822.SIZE 3957)
< * 4 FETCH (UID 43074 RFC822.SIZE 14310)
< DKKI4 OK Completed (0.000 sec)
> DKKI5 EXPUNGE
< DKKI5 OK Completed
> DKKI6 CLOSE
< DKKI6 OK Completed
> DKKI7 SELECT INBOX
< * 4 EXISTS
< * 0 RECENT
< * FLAGS (\Answered \Flagged \Draft \Deleted \Seen)
< * OK [PERMANENTFLAGS (\Answered \Flagged \Draft \Deleted \Seen \*)] Ok
< * OK [UNSEEN 1] Ok
< * OK [UIDVALIDITY 1212974392] Ok
< * OK [UIDNEXT 43075] Ok
< * OK [HIGHESTMODSEQ 484] Ok
< * OK [URLMECH INTERNAL] Ok
< DKKI7 OK [READ-WRITE] Completed
> DKKI8 IDLE
< + idling
< * 5 EXISTS
< * 1 RECENT
> DONE
More information about the Cyrus-devel
mailing list