patch - IMAP IDLE command

Mehturt <[email protected]>
Newsgroups gmane.comp.gnome.apps.gkrellm
Message-ID <[email protected]>
Hi list,
this patch implements IDLE command for IMAP server (if the server supports it).
I only tested it with IMAP over SSL using GNUTLS, the server was Courier IMAP.

How it works.
The connection establishment is the same as before.
After that STATUS is sent, same as before, then SELECT INBOX and IDLE
commands are sent.
The thread finishes, but the connection to server stays open.

Upon next execution thread only receives data from the server, waiting
for anything.
If nothing is read, thread stops.
If data is read, command DONE is sent and STATUS, SELECT INBOX and
IDLE are sent again.
This is necessary to get the correct number of unread messages.

The configuration of remote checks is changed to seconds.
The timeout for receiving data over SSL connection is the same as for
non-ssl, it's TCP_TIMEOUT.

A problem could arise if there are multiple remote mailboxes
configured, one IMAP account with IDLE support, another one for
non-IDLE IMAP or POP.  For IMAP IDLE the check period should be pretty
low in order to receive early notifications.  This configuration part
probably needs more work.

m.
diff (application/octet-stream, 13.8 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.