Re: Efficent method of checking for new messages

"DINH Viêt Hoà" <[email protected]> Wed, 22 Aug 2007 19:38:49 +0200
Newsgroups gmane.mail.libetpan.user
Message-ID <[email protected]>
On 8/22/07, Simon Banks <[email protected]> wrote:
> Hi There,
>
> New to the list so hello everybody..
>
> I'm writing the backend of a Webmail system which uses libetpan for the
> IMAP4 connectivity.  However because HTTP is transaction based I can't
> keep an IMAP4 session open very long..  Can anyone suggest using the
> libetpan how I can quickly check if there are new messages to be read?.
>
> I'm thinking that if I connect and use mailsession_message_number() and
> compare the number with the last time I preformed the action I'd be ok..

Hello,

A cleaner solution would be to use a daemon that would keep the IMAP
connection opened.
The webmail would query this daemon to get the information.

But if the IMAP server if fast enough, you can do what you suggested.
Though, you'd rather query the unseen messages number.

Regards,

-- 
DINH Viêt Hoà

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/