diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-09-08 09:23:45 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-09-08 09:23:45 +0100 |
commit | f4bcd9642cce794bf6beaaa19c0a6a6faaf2dbd5 (patch) | |
tree | 7d79f04566302f9b1820d6378671122c26bca712 | |
parent | d426f57df5f25f9798349b8168fc2bc72c695231 (diff) | |
download | rspamd-f4bcd9642cce794bf6beaaa19c0a6a6faaf2dbd5.tar.gz rspamd-f4bcd9642cce794bf6beaaa19c0a6a6faaf2dbd5.zip |
Add X-Spam-Level header.
-rw-r--r-- | src/client/rspamc.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/client/rspamc.c b/src/client/rspamc.c index 45f90b64a..98ef61a48 100644 --- a/src/client/rspamc.c +++ b/src/client/rspamc.c @@ -865,7 +865,7 @@ rspamc_mime_output (FILE *out, ucl_object_t *result, GString *input, GError *err gchar scorebuf[32]; gboolean is_spam = FALSE; const gchar *hdr_scanned, *hdr_spam; - gchar *json_header, *json_header_encoded; + gchar *json_header, *json_header_encoded, *sc; ar.data = input->str; ar.len = input->len; @@ -925,6 +925,16 @@ rspamc_mime_output (FILE *out, ucl_object_t *result, GString *input, GError *err g_mime_object_append_header (GMIME_OBJECT (message), "X-Spam-Score", scorebuf); + /* SA style stars header */ + for (sc = scorebuf; sc < scorebuf + sizeof (scorebuf) - 1 && score > 0; + sc ++, score -= 1.0) { + *sc = '*'; + } + + *sc = '\0'; + g_mime_object_append_header (GMIME_OBJECT (message), "X-Spam-Level", + scorebuf); + if (json || raw) { /* We also append json data as a specific header */ if (json) { |