[imapfilter-devel] IDLE
Ivan Bajdarvanov
ivanbaj at gmail.com
Tue Mar 2 20:54:14 EET 2010
I am unable to make IDLE work. My code is bellow and also the debug
file shows that the IDLE works. It does receive a response but my Lua
code never executes the lines after
update = account1.Inbox:enter_idle()
Eventually it will time out with:
timeout period expired while waiting to read data
and only then will proceed with the remaining lines of Lua code. It
prints nul for the print(update).
I have also tested the IDLE using telnet to the same server/account
from the same machine running imapfilter. The telnet works fine.
Can you tell me what I am doing wrong?
Telnet session
====================
3 select INBOX
* 725 EXISTS
* 33 RECENT
* OK [UNSEEN 112] Message 112 is first unseen
* OK [UIDVALIDITY 0] UIDs valid
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
* OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft)]
3 OK [READ-WRITE] SELECT completed
5 IDLE
+
* 726 EXISTS
* 34 RECENT
* 727 EXISTS
* 34 RECENT
* 728 EXISTS
* 34 RECENT
* 729 EXISTS
* 34 RECENT
* Session timeout, Server signing off
Connection to host lost.
======End Telnet=====================================
My code
===================
exist, unread, unseen = account1['Inbox']:check_status()
print ("exist: " ..exist)
print ("unread: " .. unread)
print ("unseen: " .. unseen)
update = account1.Inbox:enter_idle()
print(update)
all = account1['Inbox']:is_new() ....
=====END CODE===========
The debug log shows this:
==============
log file: 'log'
getting response (5):
* OK IMAP4rev1 SmarterMail
sending command (5):
1000 NOOP
getting response (5):
1000 OK NOOP completed
sending command (5):
1001 CAPABILITY
getting response (5):
* CAPABILITY IMAP4 IDLE IMAP4rev1
getting response (5):
1001 OK CAPABILITY completed
sending command (5):
1002 LOGIN "ivanb at irove.net" *
getting response (5):
1002 OK LOGIN completed
sending command (5):
1003 STATUS "Inbox" (MESSAGES RECENT UNSEEN)
getting response (5):
* STATUS Inbox (MESSAGES 728 RECENT 33 UNSEEN 110)
getting response (5):
1003 OK STATUS completed
sending command (5):
1004 SELECT "Inbox"
getting response (5):
* 728 EXISTS
getting response (5):
* 33 RECENT
* OK [UNSEEN 112] Message 112 is first unseen
* OK [UIDVALIDITY 0] UIDs valid
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
* OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft)]
1004 OK [READ-WRITE] SELECT completed
sending command (5):
1005 IDLE
getting response (5):
+
getting response (5):
* 729 EXISTS
getting response (5):
* 34 RECENT
More information about the Imapfilter-devel
mailing list