Merge branch 'holomorph-remoteuser' into next

This commit is contained in:
Nicolas Sebrecht 2015-03-10 23:06:17 +01:00
commit 6d72fd74af

View File

@ -154,7 +154,8 @@ class IMAPRepository(BaseRepository):
if user != None: if user != None:
return localeval.eval(user) return localeval.eval(user)
user = self.getconf('remoteuser') if self.config.has_option(self.getsection(), 'remoteuser'):
user = self.getconf('remoteuser')
if user != None: if user != None:
return user return user
@ -309,7 +310,7 @@ class IMAPRepository(BaseRepository):
raise raise
else: else:
if netrcentry: if netrcentry:
user = self.getconf('remoteuser') user = self.getuser()
if user == None or user == netrcentry[0]: if user == None or user == netrcentry[0]:
return netrcentry[2] return netrcentry[2]
# 5. read password from /etc/netrc # 5. read password from /etc/netrc
@ -320,7 +321,7 @@ class IMAPRepository(BaseRepository):
raise raise
else: else:
if netrcentry: if netrcentry:
user = self.getconf('remoteuser') user = self.getuser()
if user == None or user == netrcentry[0]: if user == None or user == netrcentry[0]:
return netrcentry[2] return netrcentry[2]
# no strategy yielded a password! # no strategy yielded a password!