diff --git a/offlineimap/repository/IMAP.py b/offlineimap/repository/IMAP.py index 1d40a8f..3517d88 100644 --- a/offlineimap/repository/IMAP.py +++ b/offlineimap/repository/IMAP.py @@ -84,9 +84,11 @@ class IMAPRepository(BaseRepository): return self.getconfboolean("holdconnectionopen", 0) def getkeepalive(self): - if self.getidlefolders(): + num = self.getconfint("keepalive", 0) + if num == 0 and self.getidlefolders(): return 29*60 - return self.getconfint("keepalive", 0) + else: + return num def getsep(self): return self.imapserver.delim