reconnect on io errors and broken pipes

This commit is contained in:
B. Petersen
2019-10-21 23:46:01 +02:00
parent e17c69f89c
commit edec6cada6

View File

@@ -1025,7 +1025,7 @@ impl Imap {
info!(context, "IMAP-IDLE has data.");
}
Err(err) => match err {
imap::error::Error::ConnectionLost => {
imap::error::Error::Io(_) | imap::error::Error::ConnectionLost => {
info!(context, "IMAP-IDLE wait cancelled, we will reconnect soon.");
self.should_reconnect.store(true, Ordering::Relaxed);
}