Post pep-8 cleanup
This commit is contained in:
@@ -68,8 +68,8 @@ class dkimMilter(Milter.Base):
|
|||||||
self.AuthservID = self.receiver
|
self.AuthservID = self.receiver
|
||||||
if hostaddr and len(hostaddr) > 0:
|
if hostaddr and len(hostaddr) > 0:
|
||||||
ipaddr = hostaddr[0]
|
ipaddr = hostaddr[0]
|
||||||
if milterconfig['InternalHostsObj']:
|
if milterconfig['IntHosts']:
|
||||||
if milterconfig['InternalHostsObj'].match(ipaddr):
|
if milterconfig['IntHosts'].match(ipaddr):
|
||||||
self.internal_connection = True
|
self.internal_connection = True
|
||||||
else:
|
else:
|
||||||
ipaddr = ''
|
ipaddr = ''
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ defaultConfigData = {
|
|||||||
'UserID': 'dkimpy-milter',
|
'UserID': 'dkimpy-milter',
|
||||||
'Canonicalization': 'relaxed/simple',
|
'Canonicalization': 'relaxed/simple',
|
||||||
'InternalHosts': '127.0.0.1',
|
'InternalHosts': '127.0.0.1',
|
||||||
'InternalHostsObj': False,
|
'IntHosts': False,
|
||||||
'DiagnosticDirectory': '',
|
'DiagnosticDirectory': '',
|
||||||
'MacroList': '',
|
'MacroList': '',
|
||||||
'MacroListVerify': ''
|
'MacroListVerify': ''
|
||||||
@@ -252,7 +252,7 @@ def _find_boolean(item):
|
|||||||
return item
|
return item
|
||||||
|
|
||||||
|
|
||||||
def _calculate_authserv_id(as_id):
|
def _make_authserv_id(as_id):
|
||||||
"""Determine AuthservID if needed"""
|
"""Determine AuthservID if needed"""
|
||||||
if as_id == 'HOSTNAME':
|
if as_id == 'HOSTNAME':
|
||||||
as_id = socket.gethostname()
|
as_id = socket.gethostname()
|
||||||
@@ -342,7 +342,7 @@ def _readConfigFile(path, configData=None, configGlobal={}):
|
|||||||
'SelectorEd25519': 'str',
|
'SelectorEd25519': 'str',
|
||||||
'Canonicalization': 'str',
|
'Canonicalization': 'str',
|
||||||
'InternalHosts': 'dataset',
|
'InternalHosts': 'dataset',
|
||||||
'InternalHostsObj': 'bool',
|
'IntHosts': 'bool',
|
||||||
'DiagnosticDirectory': 'str',
|
'DiagnosticDirectory': 'str',
|
||||||
'MacroList': 'dataset',
|
'MacroList': 'dataset',
|
||||||
'MacroListVerify': 'dataset'
|
'MacroListVerify': 'dataset'
|
||||||
@@ -410,10 +410,8 @@ def _readConfigFile(path, configData=None, configGlobal={}):
|
|||||||
configData[name] = conversion(value)
|
configData[name] = conversion(value)
|
||||||
fp.close()
|
fp.close()
|
||||||
try:
|
try:
|
||||||
configData['AuthservID'] = _calculate_authserv_id(configData
|
configData['AuthservID'] = _make_authserv_id(configData['AuthservID'])
|
||||||
['AuthservID'])
|
configData['IntHosts'] = HostsDataset(configData['InternalHosts'])
|
||||||
configData['InternalHostsObj'] = HostsDataset(configData
|
|
||||||
['InternalHosts'])
|
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user