]> source.dussan.org Git - rspamd.git/commitdiff
[Feature] Send DKIM signature to protocol reply
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 6 Jul 2016 14:42:47 +0000 (15:42 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 6 Jul 2016 14:42:47 +0000 (15:42 +0100)
src/libserver/protocol.c

index 6c09acf97e722f0baadc6f1cec429b56f738121b..d54f20d39232d3b293848aeb45a9fbc574982fef 100644 (file)
@@ -975,6 +975,7 @@ rspamd_protocol_write_ucl (struct rspamd_task *task)
        struct metric_result *metric_res;
        ucl_object_t *top = NULL, *obj;
        GHashTableIter hiter;
+       GString *dkim_sig;
        gpointer h, v;
 
        g_hash_table_iter_init (&hiter, task->results);
@@ -1005,6 +1006,13 @@ rspamd_protocol_write_ucl (struct rspamd_task *task)
        ucl_object_insert_key (top, ucl_object_fromstring (task->message_id),
                        "message-id", 0, false);
 
+       dkim_sig = rspamd_mempool_get_variable (task->task_pool, "dkim-signature");
+
+       if (dkim_sig) {
+               ucl_object_insert_key (top, ucl_object_fromstring (dkim_sig->str),
+                                       "dkim-signature", 0, false);
+       }
+
        return top;
 }