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.