[imapfilter-devel] Imapfilter Exiting Infinite Loop Timeout?

Paul imapfilter at airbred.com
Tue May 18 14:35:12 EEST 2010


Hello, I hope someone can help here.  I have a imapfilter config below 
that has a infinite while loop wrapping an idle.

At first I thought there may be something up with the idle, but now I 
look at it, I think it is the transfer that is the problem perhaps.  
This email in question was a voicemail, so fairly large.

Once the idle exits, any emails are copied to another account, and then 
those same emails are moved to a different folder on the original account.

My guess is that while the big email is being copied to a second 
account, the account that the email was pulled from is doing nothing.  
Then once that transfer is complete, it then goes to move the same 
emails over on the original account, but this has timed out when the 
copy was running.  So it gets back to do the move and fails, and the 
script exits.

Does that look like a reasonable interpretation? If so, can anyone 
suggest a workaround?

Thanks,

Paul



-------
options.info = 'true'

home = IMAP {
--- account details
}

airbred = IMAP {
--- account details
}

function do_idle(frommailbox, tomailbox, backupmailbox)
         print ("Idling for ".. frommailbox._mailbox)
         while true do
                 exist, unread, unseen = frommailbox:check_status()
                 print ("Exist:" .. exist .. " Unread:" .. unread .. " 
Unseen:" .. unseen)

                 results = frommailbox:select_all()
                 results:copy_messages(tomailbox)
                 results:move_messages(backupmailbox)
                 update = frommailbox:enter_idle()
         end
end

do_idle(airbred['INBOX'],home['personal/incoming'],airbred['delivered'])
--------------------------

Here is the verbose output:
---------
S (4): * OK Still here
S (4): * OK Still here
S (4): * OK Still here
S (4): * OK Still here
S (4): * OK Still here
S (4): * OK Still here
S (4): * OK Still here
S (4): * 1 EXISTS
* 1 RECENT
S (4): 1084 OK Idle completed.
C (4): 1085 STATUS "INBOX" (MESSAGES RECENT UNSEEN)
S (4): 1085 OK [CLIENTBUG] Status on selected mailbox completed.
Exist:1 Unread:1 Unseen:1
C (4): 1086 UID SEARCH ALL
S (4): 1086 OK Search completed (0.000 secs).
C (4): 1087 UID FETCH 8355 FAST
S (4): 1087 OK Fetch completed.
C (4): 1088 UID FETCH 8355 BODY.PEEK[HEADER]
S (4): 1088 OK Fetch completed.
C (4): 1089 UID FETCH 8355 BODY.PEEK[TEXT]
S (4): 1089 OK Fetch completed.
C (5): 108A APPEND "personal.incoming" () "18-May-2010 20:06:05 +1000" 
{18060}

(the script ends here and returns to the prompt)
----------
Here is the end of the debug for the session, for the last message obtained:
---------
getting response (4):

* OK Still here

getting response (4):

* 1 EXISTS
* 1 RECENT

sending continuation data (4):

DONE

getting response (4):

1084 OK Idle completed.

sending command (4):

1085 STATUS "INBOX" (MESSAGES RECENT UNSEEN)

getting response (4):

* STATUS "INBOX" (MESSAGES 1 RECENT 1 UNSEEN 1)
1085 OK [CLIENTBUG] Status on selected mailbox completed.

sending command (4):

1086 UID SEARCH ALL

getting response (4):

* SEARCH 8355
1086 OK Search completed (0.000 secs).

sending command (4):

1087 UID FETCH 8355 FAST

getting response (4):

* 1 FETCH (UID 8355 FLAGS (\Recent) INTERNALDATE "18-May-2010 20:06:05 
+1000" RFC822.SIZE 18060)
1087 OK Fetch completed.

sending command (4):

1088 UID FETCH 8355 BODY.PEEK[HEADER]

getting response (4):

* 1 FETCH (UID 8355 BODY[HEADER] {982}
<header snipped>
)
getting response (4):


1088 OK Fetch completed.

sending command (4):

1089 UID FETCH 8355 BODY.PEEK[TEXT]

getting response (4):

* 1 FETCH (UID 8355 BODY[TEXT] {17078}

(all body elements snipped)
getting response (4):

getting response (4):


getting response (4):

getting response (4):

getting response (4):

getting response (4):

getting response (4):

getting response (4):

getting response (4):

getting response (4):

getting response (4):

getting response (4):

getting response (4):

getting response (4):

)
1089 OK Fetch completed.

namespace: 'personal/incoming' -> 'personal.incoming'
sending command (5):

108A APPEND "personal.incoming" () "18-May-2010 20:06:05 +1000" {18060}

getting response (5):

* BYE Disconnected for inactivity.
------------------------------


More information about the Imapfilter-devel mailing list