diff options
author | John McKay <adenosine3p@gmail.com> | 2019-01-26 06:34:41 +0000 |
---|---|---|
committer | John McKay <adenosine3p@gmail.com> | 2019-02-02 05:41:41 +0000 |
commit | bbabe7c61ca8403cf332fbfa6a0f23997f8cb92d (patch) | |
tree | df3333ba324d8ed7d25e9349564d640b7004262b /src/client | |
parent | 875f80ee9aa1ff58463f32864ec5fcd57558b0a5 (diff) | |
download | rspamd-bbabe7c61ca8403cf332fbfa6a0f23997f8cb92d.tar.gz rspamd-bbabe7c61ca8403cf332fbfa6a0f23997f8cb92d.zip |
Add multiple signature support.
Configuration is not clean and milter doesn't support it yet
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/rspamc.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/src/client/rspamc.c b/src/client/rspamc.c index c52f615dc..3433ef7d6 100644 --- a/src/client/rspamc.c +++ b/src/client/rspamc.c @@ -887,7 +887,15 @@ rspamc_symbols_output (FILE *out, ucl_object_t *obj) } } - PRINT_PROTOCOL_STRING ("dkim-signature", "DKIM-Signature"); + elt = ucl_object_lookup (obj, "dkim-signature"); + if (elt && elt->type == UCL_STRING) { + rspamd_fprintf (out, "DKIM-Signature: %s\n", ucl_object_tostring (elt)); + } else if (elt && elt->type == UCL_ARRAY) { + mit = NULL; + while ((cmesg = ucl_object_iterate (elt, &mit, true)) != NULL) { + rspamd_fprintf (out, "DKIM-Signature: %s\n", ucl_object_tostring (cmesg)); + } + } elt = ucl_object_lookup (obj, "profile"); @@ -1372,11 +1380,16 @@ rspamc_mime_output (FILE *out, ucl_object_t *result, GString *input, g_string_free (folded_symbuf, TRUE); g_string_free (symbuf, TRUE); - if (ucl_object_lookup (result, "dkim-signature")) { + res = ucl_object_lookup (result, "dkim-signature"); + if (res && res->type == UCL_STRING) { rspamd_printf_gstring (added_headers, "DKIM-Signature: %s%s", - ucl_object_tostring ( - ucl_object_lookup (result, "dkim-signature")), - line_end); + ucl_object_tostring (res), line_end); + } else if (res && res->type == UCL_ARRAY) { + it = NULL; + while ((cur = ucl_object_iterate (res, &it, true)) != NULL) { + rspamd_printf_gstring (added_headers, "DKIM-Signature: %s%s", + ucl_object_tostring (cur), line_end); + } } if (json || raw || compact) { |