From e72dfdc82e00d1930f46c15e5da9f9994f8f7c35 Mon Sep 17 00:00:00 2001 From: David Kaufmann Date: Wed, 19 Mar 2025 00:13:56 +0100 Subject: add spam state to mail --- get_zammad_ham_spam.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'get_zammad_ham_spam.py') diff --git a/get_zammad_ham_spam.py b/get_zammad_ham_spam.py index 9e60349..6decd12 100755 --- a/get_zammad_ham_spam.py +++ b/get_zammad_ham_spam.py @@ -16,9 +16,9 @@ def send_to_rspamd(ticketid, title, spamflag, maildata): with subprocess.Popen(['/usr/bin/rspamc', f"learn_{spamflag}"], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) as rspamd: stdout, stderr = rspamd.communicate(input=maildata) if len(stdout) > 0: - print(f"Ticket {ticketid}:\nSubject: {title}\nstdout: {stdout.decode('utf-8')}") + print(f"Ticket {ticketid}: {spamflag}\nSubject: {title}\nstdout: {stdout.decode('utf-8')}") if len(stderr) > 0: - print(f"Ticket {ticketid}:\nSubject: {title}\n stderr: {stderr.decode('utf-8')}") + print(f"Ticket {ticketid}: {spamflag}\nSubject: {title}\nstderr: {stderr.decode('utf-8')}") # Send mails from zammad to rspamc to learn already processed mails -- cgit v1.2.3