Recently-APPENDed messages not showing up as RECENT responses after NOOP

Kjetil Torgrim Homme kjetilho at ifi.uio.no
Mon Sep 4 12:35:27 EDT 2006


On Mon, 2006-09-04 at 15:42 +0100, John J Lee wrote:
> On Mon, 4 Sep 2006, Kjetil Torgrim Homme wrote:
> > oh yes, please use flags!  Cyrus supports arbitrarily chosen flags by
> > clients, see PERMANENTFLAGS.  (of course, other IMAP servers aren't as
> > advanced, so you may want to keep this wasteful APPEND/STORE/EXPUNGE
> > hack around for those.)
> 
> Aha!  Thanks.  If anybody has any pointers to sample client code, I'd be 
> grateful.

I don't, but basically you have to check the SELECT response to see if
the PERMANENTFLAGS is empty, and if so, you can just make up your own
flag names ("Spam" and "Ham" would do nicely :) and pass to FETCH/STORE.

> > you can't trust RECENT, if a different client is connected, your
> > SpamBayes client may not be told about the message, since only one
> > client will be notified.
> >
> >> If that doesn't
> >> result in a RECENT response, it keeps polling, issuing NOOP commands up to
> >> 100 times (it doesn't sleep() between each poll).  If that fails, it dies
> >> horribly :-/
> >
> > this is really unnecessary.  when the APPEND is done, SpamBayes can
> > simply do a SEARCH to find the message with the Message-ID and fetch its
> > UID.
> 
> OK, I was mistaken about the reason is does this loop.  The loop is there 
> not to find the UID (the code does indeed do a SEARCH for that), but 
> rather to wait until the new message is available, prior to SEARCHing for 
> the UID.

I don't understand this.  the message should be available as soon as the
response for your APPEND command arrives.

> >> 2. Does this reveal a bug in the Cyrus implementation?
> >
> > hard to tell.  is it the only client?
> 
> I don't understand your question.  Is SpamBayes the only client of Cyrus? 
> No.  Did you mean "is Cyrus the only server that fails with this client 
> code"?  Seems not: somebody reported Courier failing intermittently too.

if there are other clients connected while you do your testing, missing
RECENT is expected to happen occasionally.

-- 
Kjetil T.




More information about the Info-cyrus mailing list