OT, question on IMAP

Etienne Goyer etienne.goyer at linuxquebec.com
Fri Sep 12 15:32:36 EDT 2003


Thanks all for your response.  I would have two more questions.

In a Murder, if I connect to a backend and issue :

* OK backend1 Cyrus IMAP4 v2.1.13 server ready
. login admin *******
. OK User logged in
. STATUS user/egoyer (MESSAGES UNSEEN)
. NO Permission denied

Which ACL do I need to get STATUS on a mailbox ?  Does it make sense for 
the admin to have that permissions ?

Secondly, the RFC have the following to say concerning the STATUS 
command :

      Unlike the LIST command, the STATUS command is not guaranteed to
      be fast in its response.  Under certain circumstances, it can be
      quite slow.  In some implementations, the server is obliged to
      open the mailbox read-only internally to obtain certain status
      information.

Is this the case with Cyrus ?  Can the STATUS command be considered
expensive ?

To give some perspective, I want to count read vs unread messages in a
Murder (don't ask why, some people just love statistics).  Since this
will have to be done from a remote machine, I would prefer to do that
within the IMAP (or another) protocol instead of accessing the
filesystem directly.  My plan was to connect to each backend in turn, 
retrieve mailbox list, get seen/unseen count for each mailbox and 
compute the total.  If you know of a better way to do it, your 
suggestion are welcome !

Thanks again for your insight.


On Thu, Sep 11, 2003 at 12:38:42PM -0400, Rob Siemborski wrote:
> On Thu, 11 Sep 2003, Etienne Goyer wrote:
> 
> > Sorry for this OT message.  I have a question about IMAP-the-protocol,
> > and I guessed tis is where I had the better chance of a good answer.
> 
> You can also try the IMAP protocol list itself (see www.imap.org).
> 
> > It's very simple actually.  From a program I am writing, I want to know
> > how many messages in a mailbox are read or not.  I guess I must must
> > somehow query for the \Seen flag.  While I am at it, why not make it
> > generic and query how many messages in a mailbox have a particuliar flag
> > set.
> >
> > So my question is : what would an IMAP client send to determine how many
> > message in a particuliar mailbox have a particuliar flag setted ?  Is it
> > possible to reverse this and ask how many messages *don't* have a
> > particuliar flag setted ?
> 
> If you just need a count, you can issue the status command:
> 
> x status INBOX (UNSEEN)
> * STATUS INBOX (UNSEEN 204)
> x OK Completed
> 
> If you want the messages themselves, use search:
> 
> z select INBOX
> y search UNSEEN
> * SEARCH 1022 1355 1410 1484 1534 1579 1652 1737 1738 1753 1759 1787 1805
> ....
> 4038 4039 4042 4051 4054 4058 4060 4066 4069 4088 4097
> y OK Completed (204 msgs in 0.000 secs)
> 
> -Rob
> 
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> Rob Siemborski * Andrew Systems Group * Cyert Hall 207 * 412-268-7456
> Research Systems Programmer * /usr/contributed Gatekeeper

-- 
Etienne Goyer                    Linux Québec Technologies Inc.
http://www.LinuxQuebec.com       etienne.goyer at linuxquebec.com




More information about the Info-cyrus mailing list