[imapfilter-devel] Emails not copied

Paul imapfilter at airbred.com
Mon Aug 23 16:10:59 EEST 2010


Can anyone offer some insight into why this loop doesn't work, for 
mailboxes that don't support imap-idle?

The "print" statement shows me that there are emails available.  So the 
frommailbox must have been connected to in the previous step.  The 
messages are not copied to the tomailbox and are not moved to the 
backupmailbox (which in real life is just another folder on the 
frommailbox imap account).

I have the two logouts in the if in an attempt to make sure the 
frommailbox and tomailbox are reconnected at the beginning of the next loop.

This is imapfilter 2.2.2

Thanks,

Paul

=============
function do_idle(frommailbox, tomailbox, backupmailbox)
         print ("Idling for ".. frommailbox._mailbox)
         while true do
                 theerror = "0"
                 print "Check status.."
                 exists, unread, unseen  = frommailbox:check_status()
                 print ("error ".. theerror.." Exists: " .. exists .. " 
Unread:" .. unread  .. " Unseen:" .. unseen)
                 results = frommailbox:select_all()
                 print "Copy.."
                 results:copy_messages(tomailbox)
                 print "Move.."
                 results:move_messages(backupmailbox)
                 print "Idle.."
                 idlesupport = frommailbox:enter_idle()
                 if(not idlesupport) then
                         print "Idle not supported"
                         os.execute("sleep 180")
                         ifcore.logout(frommailbox._account._imap)
                         ifcore.logout(tomailbox._account._imap)
                 end
         end
end
===================


More information about the Imapfilter-devel mailing list