On Sun, 9 Apr 2006,
halayli@gmail.com wrote:
> Does c-client library support IDLE command from the client side?
> Because I dont want to keep checking on the server if a new mail has
> arrived or not.
No, c-client does not have client IDLE support.
In this day and age of NAT you do not want to use IDLE. That's because
the NAT mapping is likely to be flushed if the session goes idle for more
than a couple of minutes.
That's why UW imapd gives unsolicited server responses every minute or so
in IDLE mode; it's an attempt to keep NAT mappings alive. Otherwise, too
many people who used IDLE-capable clients were losing their sessions and
thus not being alerted to new mail.
It was just about the time that I finished IDLE support in UW imapd and
was about to add IDLE support to c-client that NAT reared its ugly head in
a massive way. We had *lots* of people complaining about "not seeing new
mail". It turned out that NAT had dropped their connections, and that
shelved any c-client implementation plans for IDLE.
[You have one guess as to which client program these users were using.
Hint: everybody who uses Windows has it on their system, even if they
don't use it. Ready, set, go!]
Consequently, you need to call mail_noop() periodically to ping the
session. I recommend an interval between 90 to 180 seconds; certainly no
more frequent than 60 seconds.
The role of IDLE today is probably limited to mobile devices (cell phones
and the like) where battery considerations dictate that you don't want to
communicate unless necessary. But the mobile device world doesn't use
NAT; or at least not the same kind of NAT that is commonly found in
offices and people's homes.
If you are programming a mobile device, you probably want custom code
specifically designed for mobile devices to do the protocol operations,
and not a general-purpose library such as c-client. You probably also
want to have custom servers whose behavior is optimized for mobile
devices.
-- Mark --
http://panda.com/mrc
Democracy is two wolves and a sheep deciding what to eat for lunch.
Liberty is a well-armed sheep contesting the vote.