match incoming mail to event

This commit is contained in:
j3d1 2024-11-18 02:01:23 +01:00
parent d18fa897a0
commit 90f47fa9d6
4 changed files with 15 additions and 22 deletions

View file

@ -29,13 +29,13 @@ class Email(SoftDeleteModel):
self.save()
def train_spam(self):
if ACTIVE_SPAM_TRAINING:
if ACTIVE_SPAM_TRAINING and self.raw_file.path:
import subprocess
path = self.raw_file.path
subprocess.run(["rspamc", "learn_spam", path])
def train_ham(self):
if ACTIVE_SPAM_TRAINING:
if ACTIVE_SPAM_TRAINING and self.raw_file.path:
import subprocess
path = self.raw_file.path
subprocess.run(["rspamc", "learn_ham", path])