]> source.dussan.org Git - rspamd.git/commitdiff
[Feature] Rspamc can now add dkim signature in mime mode
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 2 Aug 2016 15:28:49 +0000 (16:28 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 2 Aug 2016 15:28:49 +0000 (16:28 +0100)
src/client/rspamc.c

index b8cec9e67b636f971593bfa66180707f2ea324ef..b9fe5ff545c308d781a41527f38119ea93852b32 100644 (file)
@@ -1124,9 +1124,19 @@ rspamc_mime_output (FILE *out, ucl_object_t *result, GString *input,
                                0);
                rspamd_printf_gstring (added_headers, "X-Spam-Symbols: %v\r\n",
                                folded_symbuf);
+
                g_string_free (folded_symbuf, TRUE);
                g_string_free (symbuf, TRUE);
 
+               if (ucl_object_lookup (result, "dkim-signature")) {
+                       folded_symbuf = rspamd_header_value_fold ("DKIM-Signature",
+                                       ucl_object_tostring (ucl_object_lookup (result, "dkim-signature")),
+                                       0);
+                       rspamd_printf_gstring (added_headers, "DKIM-Signature: %v\r\n",
+                                       folded_symbuf);
+                       g_string_free (folded_symbuf, TRUE);
+               }
+
                if (json || raw || compact) {
                        /* We also append json data as a specific header */
                        if (json) {