[imapfilter-devel] Interesting issue with daemon mode
Lefteris Chatzimparmpas
lefcha at hellug.gr
Wed Dec 16 21:56:49 EET 2009
On Wed, Dec 16, 2009 at 06:52:06AM -0600, David Mandala wrote:
> Noticed something interesting, if you use become_daemon and your gateway
> changes it's IP address (which happens a lot to me), filtering stops,
> you need to kill the process and restart it.
>
> Not sure how to fix that but I've falling back to a cron job that
> connects each time it's run. Wonder if there is a way that the process
> can tell it's not talking to the imap server anymore and try to
> reconnect?
Can you run imapfilter in such a way that it will run in a loop but not
with become_daemon()? You can do this like this:
function forever()
...
end
while true do
forever()
ifsys.sleep(600)
end
You can put your commands inside the forever() function. This will keep
imapfilter executing those commands every 600 seconds, but without going
into the background like a daemon. So we might see any error messages
in the terminal if/when it hangs.
More information about the Imapfilter-devel
mailing list