From 8cd2bdf7f5075006773a639a7d43fb1461bdf235 Mon Sep 17 00:00:00 2001 From: James Bunton Date: Tue, 10 Feb 2009 15:57:03 +1100 Subject: [PATCH] Allow keepalive to be overridden by user if imapfolders is set --- offlineimap/repository/IMAP.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/offlineimap/repository/IMAP.py b/offlineimap/repository/IMAP.py index ee074cf..3909995 100644 --- a/offlineimap/repository/IMAP.py +++ b/offlineimap/repository/IMAP.py @@ -79,9 +79,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