diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/App/ImapNotify.pm | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/App/ImapNotify.pm b/lib/App/ImapNotify.pm index cbdc4ac..1781c86 100644 --- a/lib/App/ImapNotify.pm +++ b/lib/App/ImapNotify.pm @@ -75,7 +75,12 @@ method loop_reconnect() { try { $self->loop(); } catch { - die $@ unless $@ =~ m/^Lost connection while .*/; + sub { + return if $@ =~ m/^Lost connection while .*/; + # dovecot crashes somtimes during fetching and sends an incomplete fetch response + return if $@ =~ m/^First line doesn't match FETCH pattern./; + die $@; + }->(); } $holdoff_repeat = 0 if (time - $last_time) > $holdoff_limit; sleep($holdoff_time * $holdoff_repeat++); |