Fix debug log message and rename quarantines.py to storages.py

This commit is contained in:
2020-02-03 12:07:16 +01:00
parent a10e341056
commit 365fa9cd6d
2 changed files with 4 additions and 4 deletions

View File

@@ -189,9 +189,9 @@ class Quarantine(object):
self.host_whitelist.append(net) self.host_whitelist.append(net)
if self.host_whitelist: if self.host_whitelist:
self.logger.debug( self.logger.debug(
"{}: ignore hosts: {}".format( "{}: host whitelist: {}".format(
self.name, self.name,
", ".join(ignored))) ", ".join([str(ip) for ip in host_whitelist])))
def notify(self, storage_id, recipient=None, synchronous=True): def notify(self, storage_id, recipient=None, synchronous=True):
"Notify recipient about email in storage." "Notify recipient about email in storage."
@@ -324,12 +324,12 @@ class QuarantineMilter(Milter.Base):
for quarantine in self.quarantines.copy(): for quarantine in self.quarantines.copy():
if quarantine.host_in_whitelist(hostaddr): if quarantine.host_in_whitelist(hostaddr):
self.logger.debug( self.logger.debug(
"host {} is ignored by quarantine {}".format( "host {} is in whitelist of quarantine {}".format(
hostaddr[0], quarantine["name"])) hostaddr[0], quarantine["name"]))
self.quarantines.remove(quarantine) self.quarantines.remove(quarantine)
if not self.quarantines: if not self.quarantines:
self.logger.debug( self.logger.debug(
"host {} is ignored by all quarantines, " "host {} is in whitelist of all quarantines, "
"skip further processing", "skip further processing",
hostaddr[0]) hostaddr[0])
return Milter.ACCEPT return Milter.ACCEPT