|
|
@ -73,15 +73,17 @@ class ConfigManager(dict):
|
|
|
|
'mysql': 'mysql://{DB_USER}:{DB_PW}@{DB_HOST}/{DB_NAME}'
|
|
|
|
'mysql': 'mysql://{DB_USER}:{DB_PW}@{DB_HOST}/{DB_NAME}'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
HOSTS = ('HOST_IMAP', 'HOST_POP3', 'HOST_AUTHSMTP', 'HOST_SMTP',
|
|
|
|
HOSTS = ('IMAP', 'POP3', 'AUTHSMTP', 'SMTP')
|
|
|
|
'HOST_WEBMAIL')
|
|
|
|
OPTIONAL_HOSTS = ('WEBMAIL', 'ANTISPAM')
|
|
|
|
|
|
|
|
|
|
|
|
def __init__(self):
|
|
|
|
def __init__(self):
|
|
|
|
self.config = dict()
|
|
|
|
self.config = dict()
|
|
|
|
|
|
|
|
|
|
|
|
def resolve_host(self):
|
|
|
|
def resolve_host(self):
|
|
|
|
for item in self.HOSTS:
|
|
|
|
optional = [item for item in self.OPTIONAL_HOSTS if item in self.config]
|
|
|
|
self.config[item] = system.resolve_address(self.config[item])
|
|
|
|
for item in self.HOSTS + optional:
|
|
|
|
|
|
|
|
host = 'HOST_' + item
|
|
|
|
|
|
|
|
self.config[host] = system.resolve_address(self.config[host])
|
|
|
|
|
|
|
|
|
|
|
|
def __coerce_value(self, value):
|
|
|
|
def __coerce_value(self, value):
|
|
|
|
if isinstance(value, str) and value.lower() in ('true','yes'):
|
|
|
|
if isinstance(value, str) and value.lower() in ('true','yes'):
|
|
|
|