summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2018-09-21 22:27:10 +0200
committerFlorian Pritz <bluewind@xinu.at>2018-09-25 16:49:13 +0200
commit24083421e4a38b1dbca6f0f593aaecae8f4f57ec (patch)
treef01ed5b69bb1a090b27f28e404db20e79e72af39
parent606f8c689220f61e10315d372e0aee9ae0dbf2a7 (diff)
downloadApp-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>
-rw-r--r--lib/App/ImapNotify.pm7
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++);