diff options
author | Florian Pritz <bluewind@xinu.at> | 2018-09-21 22:27:10 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2018-09-25 16:49:13 +0200 |
commit | 24083421e4a38b1dbca6f0f593aaecae8f4f57ec (patch) | |
tree | f01ed5b69bb1a090b27f28e404db20e79e72af39 /lib | |
parent | 606f8c689220f61e10315d372e0aee9ae0dbf2a7 (diff) | |
download | App-ImapNotify-24083421e4a38b1dbca6f0f593aaecae8f4f57ec.tar.gz App-ImapNotify-24083421e4a38b1dbca6f0f593aaecae8f4f57ec.tar.xz |
loop_reconnect: Ignore incomplete FETCH lines when dovecot dies
Signed-off-by: Florian Pritz <bluewind@xinu.at>
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++); |