- eval { $IMAP->idle(\&MonitorMail) };
-
- # If we return from idle then the server went away for some reason. With Gmail
- # the server seems to time out around 30-40 minutes. Here we simply reconnect
- # to the imap server and continue to MonitorMail.
- $log->dbug("MonitorMail: Connection to $opts{imap} ended - lasted "
- . howlong $startTime);
-
- # Destroy current IMAP connection
- $log->dbug("MonitorMail: Destroying IMAP connection to $opts{imap}");