summaryrefslogtreecommitdiff
path: root/get_zammad_ham_spam.py
diff options
context:
space:
mode:
authorDavid Kaufmann <astra@ionic.at>2025-03-19 00:13:56 +0100
committerDavid Kaufmann <astra@ionic.at>2025-03-19 00:13:56 +0100
commite72dfdc82e00d1930f46c15e5da9f9994f8f7c35 (patch)
tree686530a9d362333f34f963493bbe14d3ddbbc260 /get_zammad_ham_spam.py
parent7eeb7e9e56792a5b420efb07d6bee05c73cc6018 (diff)
downloadscripts-e72dfdc82e00d1930f46c15e5da9f9994f8f7c35.tar.gz
add spam state to mail
Diffstat (limited to 'get_zammad_ham_spam.py')
-rwxr-xr-xget_zammad_ham_spam.py4
1 files changed, 2 insertions, 2 deletions
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