From dde021ce52990497a08d066d92e56ea019b56cd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kim=20Lidstro=CC=88m?= Date: Thu, 20 Jun 2013 11:38:45 +0200 Subject: [PATCH 1/2] Added remoteporteval --- offlineimap/repository/IMAP.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/offlineimap/repository/IMAP.py b/offlineimap/repository/IMAP.py index be8c858..01e78b5 100644 --- a/offlineimap/repository/IMAP.py +++ b/offlineimap/repository/IMAP.py @@ -148,6 +148,13 @@ class IMAPRepository(BaseRepository): def getport(self): + port = None + + if self.config.has_option(self.getsection(), 'remoteporteval'): + port = self.getconf('remoteporteval') + if port != None: + return self.localeval.eval(port) + return self.getconfint('remoteport', None) def getssl(self): From 7a21cab6c56b1e5b7090883e2b8772391ba56abb Mon Sep 17 00:00:00 2001 From: Dmitrijs Ledkovs Date: Wed, 10 Jul 2013 02:17:01 +0100 Subject: [PATCH 2/2] Correct whitespace & add docs about remoteporteval. --- offlineimap.conf | 1 + offlineimap/repository/IMAP.py | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/offlineimap.conf b/offlineimap.conf index fccceab..7b1755e 100644 --- a/offlineimap.conf +++ b/offlineimap.conf @@ -292,6 +292,7 @@ type = IMAP # "getcredentials" that parses a file "filename" and returns the account # details for "hostname". # remotehosteval = getcredentials("filename", "hostname", "hostname") +# remoteporteval = getcredentials("filename", "hostname", "port") # remoteusereval = getcredentials("filename", "hostname", "user") # remotepasseval = getcredentials("filename", "hostname", "passwd") diff --git a/offlineimap/repository/IMAP.py b/offlineimap/repository/IMAP.py index 01e78b5..f18090f 100644 --- a/offlineimap/repository/IMAP.py +++ b/offlineimap/repository/IMAP.py @@ -148,12 +148,12 @@ class IMAPRepository(BaseRepository): def getport(self): - port = None + port = None - if self.config.has_option(self.getsection(), 'remoteporteval'): - port = self.getconf('remoteporteval') - if port != None: - return self.localeval.eval(port) + if self.config.has_option(self.getsection(), 'remoteporteval'): + port = self.getconf('remoteporteval') + if port != None: + return self.localeval.eval(port) return self.getconfint('remoteport', None)