|
|
@ -54,6 +54,7 @@ DEFAULT_CONFIG = {
|
|
|
|
'DKIM_PATH': '/dkim/{domain}.{selector}.key',
|
|
|
|
'DKIM_PATH': '/dkim/{domain}.{selector}.key',
|
|
|
|
'DEFAULT_QUOTA': 1000000000,
|
|
|
|
'DEFAULT_QUOTA': 1000000000,
|
|
|
|
'MESSAGE_RATELIMIT': '200/day',
|
|
|
|
'MESSAGE_RATELIMIT': '200/day',
|
|
|
|
|
|
|
|
'MESSAGE_RATELIMIT_EXEMPTION': '',
|
|
|
|
'RECIPIENT_DELIMITER': '',
|
|
|
|
'RECIPIENT_DELIMITER': '',
|
|
|
|
# Web settings
|
|
|
|
# Web settings
|
|
|
|
'SITENAME': 'Mailu',
|
|
|
|
'SITENAME': 'Mailu',
|
|
|
@ -154,6 +155,7 @@ class ConfigManager:
|
|
|
|
self.config['PERMANENT_SESSION_LIFETIME'] = timedelta(hours=int(self.config['SESSION_LIFETIME']))
|
|
|
|
self.config['PERMANENT_SESSION_LIFETIME'] = timedelta(hours=int(self.config['SESSION_LIFETIME']))
|
|
|
|
hostnames = [host.strip() for host in self.config['HOSTNAMES'].split(',')]
|
|
|
|
hostnames = [host.strip() for host in self.config['HOSTNAMES'].split(',')]
|
|
|
|
self.config['AUTH_RATELIMIT_EXEMPTION'] = set(ipaddress.ip_network(cidr, False) for cidr in (cidr.strip() for cidr in self.config['AUTH_RATELIMIT_EXEMPTION'].split(',')) if cidr)
|
|
|
|
self.config['AUTH_RATELIMIT_EXEMPTION'] = set(ipaddress.ip_network(cidr, False) for cidr in (cidr.strip() for cidr in self.config['AUTH_RATELIMIT_EXEMPTION'].split(',')) if cidr)
|
|
|
|
|
|
|
|
self.config['MESSAGE_RATELIMIT_EXEMPTION'] = set([s for s in self.config['MESSAGE_RATELIMIT_EXEMPTION'].lower().replace(' ', '').split(',') if s])
|
|
|
|
self.config['HOSTNAMES'] = ','.join(hostnames)
|
|
|
|
self.config['HOSTNAMES'] = ','.join(hostnames)
|
|
|
|
self.config['HOSTNAME'] = hostnames[0]
|
|
|
|
self.config['HOSTNAME'] = hostnames[0]
|
|
|
|
|
|
|
|
|
|
|
|