diff options
| author | David Kaufmann <astra@ionic.at> | 2025-03-19 00:13:56 +0100 |
|---|---|---|
| committer | David Kaufmann <astra@ionic.at> | 2025-03-19 00:13:56 +0100 |
| commit | e72dfdc82e00d1930f46c15e5da9f9994f8f7c35 (patch) | |
| tree | 686530a9d362333f34f963493bbe14d3ddbbc260 | |
| parent | 7eeb7e9e56792a5b420efb07d6bee05c73cc6018 (diff) | |
| download | scripts-e72dfdc82e00d1930f46c15e5da9f9994f8f7c35.tar.gz | |
add spam state to mail
| -rwxr-xr-x | get_zammad_ham_spam.py | 4 |
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 |
