'Return the configured hostname to connect to
:returns: hostname as string or throws Exception'

def gethost(self):

    if self._host:
        return self._host
    if self.config.has_option(self.getsection(), 'remotehosteval'):
        host = self.getconf('remotehosteval')
        try:
            host = self.localeval.eval(host)
        except Exception as e:
            six.reraise(OfflineImapError, OfflineImapError(("remotehosteval    option    for    repository    '%s'    failed:\n%s" % (self, e)), OfflineImapError.ERROR.REPO), exc_info()[2])
        if host:
            self._host = host
            return self._host
    host = self.getconf('remotehost', None)
    if (host != None):
        self._host = host
        return self._host
    raise OfflineImapError(("No    remote    host    for    repository    '%s'    specified." % self), OfflineImapError.ERROR.REPO)
