You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After years of silent and perfect operation, I was checking imapfilter to see if I could combine the three instances I have into one.
I noticed/remembered however that I am using enter_idle, which blocks execution of commands until an update is received.
Is then a separate instance per IMAP server the only solution, or are there better ones?
The text was updated successfully, but these errors were encountered:
I know it is not the same, but I combined multiple instances into one with an approach like the one below:
function sync_mail()
local servers = { server1, server2 }
for _, server in pairs(servers) do
msgs = server['INBOX']:select_all()
if #msgs > 0 then
...
end
end
end
function forever()
while true do
sync_mail()
sleep(60)
end
end
recover(forever)
Well the IMAP IDLE is a blocking network call, so basically the whole program stops waiting for something to be received from the socket. There's a different extension to support multiple mailboxes the IMAP NOTIFY Extension, but it's not supported by imapfilter yet.
But for multiple IDLE on different servers, the only way would be to either have multiple threads or somehow doing non-blocking networking calls with Lua coroutines (eg. Lua Copas or similar).
I think the easiest way is to run multiple processes as you already do, or otherwise don't use IDLE but do periodic polling as suggested.
After years of silent and perfect operation, I was checking imapfilter to see if I could combine the three instances I have into one.
I noticed/remembered however that I am using enter_idle, which blocks execution of commands until an update is received.
Is then a separate instance per IMAP server the only solution, or are there better ones?
The text was updated successfully, but these errors were encountered: