]> source.dussan.org Git - rspamd.git/commitdiff
Output emails and urls.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 21 Jan 2014 17:53:19 +0000 (17:53 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 21 Jan 2014 17:53:19 +0000 (17:53 +0000)
src/client/rspamc.c

index 77520a346b7c0d133931a7f4b22663a00d8b126f..082a0ecccfc5be0398a70a396d5a10301440951e 100644 (file)
@@ -441,6 +441,7 @@ rspamc_symbols_output (ucl_object_t *obj)
 {
        ucl_object_iter_t it = NULL;
        ucl_object_t *cur;
+       gchar *emitted;
 
        while ((cur = ucl_iterate_object (obj, &it, true)) != NULL) {
                if (g_ascii_strcasecmp (ucl_object_key (cur), "message-id") == 0) {
@@ -449,6 +450,16 @@ rspamc_symbols_output (ucl_object_t *obj)
                else if (g_ascii_strcasecmp (ucl_object_key (cur), "queue-id") == 0) {
                        rspamd_fprintf (stdout, "Queue-ID: %s\n", ucl_object_tostring (cur));
                }
+               else if (g_ascii_strcasecmp (ucl_object_key (cur), "urls") == 0) {
+                       emitted = ucl_object_emit (cur, UCL_EMIT_JSON_COMPACT);
+                       rspamd_fprintf (stdout, "Urls: %s\n", emitted);
+                       free (emitted);
+               }
+               else if (g_ascii_strcasecmp (ucl_object_key (cur), "emails") == 0) {
+                       emitted = ucl_object_emit (cur, UCL_EMIT_JSON_COMPACT);
+                       rspamd_fprintf (stdout, "Emails: %s\n", emitted);
+                       free (emitted);
+               }
                else if (cur->type == UCL_OBJECT) {
                        /* Parse metric */
                        rspamc_metric_output (cur);