lazy load quarantine objects in cli

This commit is contained in:
2021-10-01 00:53:18 +02:00
parent b9b6a62b5e
commit 5b21adcd24
5 changed files with 26 additions and 45 deletions

View File

@@ -47,10 +47,6 @@ class BaseMailStorage:
self.metavar = metavar
self.pretend = False
@property
def type(self):
return "Base"
def add(self, data, qid, mailfrom, recipients, subject, variables):
"Add email to storage."
return ("", "")
@@ -107,10 +103,6 @@ class FileMailStorage(BaseMailStorage):
cfg.append(f"original={self.original}")
return "FileMailStorage(" + ", ".join(cfg) + ")"
@property
def type(self):
return "File"
def get_storageid(self, qid):
timestamp = datetime.now().strftime("%Y%m%d%H%M%S")
return f"{timestamp}_{qid}"