Hi Mark,

My purpose is to have the server inform me only new changes. For example, in
my mail box on server there is one new mail just arrived, and three among
1000 email have changed status to 'read'. Using the IDLE command, and keep
the connection alive, the server will inform any change to that mailbox
using the current connection.
I don't want to scan folder-by-folder, mail-by-mail to detect changes made
to mail items on the server, and update to the mail items on client machine.

Is there any way to do that?

Regards,
Khoa


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Mark Crispin
Sent: Friday, December 12, 2003 5:22 PM
To: Khoa Vo
Cc: [EMAIL PROTECTED]
Subject: Re: implement the IDLE command


All IMAP commands will inform you of updates to the selected mailbox.
IDLE is simply a way of being informed without doing a command.

So, all you need to do in order to stay informed of updates to the mailbox
is to do any command.  If you do not have any command to do, you can do
the NOOP command.  The mail_ping() function will do a NOOP.

NOOP does nothing, but it is a command, and all IMAP commands return
updates.

If an application is not otherwise doing anything to the server, it
generally executes the mail_ping() function every 1 to 3 minutes.

In other words, something like:
        while (nothing_to_do) {
          mail_ping (stream);
          sleep (60);
        }
is very close in function to IDLE.

Of course, if the application is doing other IMAP commands, it does not
need to do NOOP with mail_ping().  mail_ping() is only needed if the
application is not doing anything.

-- Mark --

http://staff.washington.edu/mrc
Science does not emerge from voting, party politics, or public debate.
Si vis pacem, para bellum.

Reply via email to