From 2cc2ead503ba9491d41c36d8f9d410312171f6ef Mon Sep 17 00:00:00 2001 From: Ethan Glasser-Camp Date: Thu, 19 May 2011 15:02:30 -0400 Subject: [PATCH] Let the user configure how long to IDLE for This commit was originally by James Bunton . Signed-off-by: Ethan Glasser-Camp Signed-off-by: Nicolas Sebrecht --- 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 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