]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
email-json: don't log subject by default
authorEric Leblond <eric@regit.org>
Tue, 5 May 2015 08:32:16 +0000 (10:32 +0200)
committerEric Leblond <eric@regit.org>
Tue, 6 Oct 2015 21:30:45 +0000 (23:30 +0200)
It seems to be a bit too intrusive for the privacy so this patch
adds this field to the extended logging only.

src/output-json-email-common.c

index ecbd273a2f8e90c1654d4e8c30ce6c8c27c7045e..84294c45b03e02dcf4d2d4d996b36917bd9ef058 100644 (file)
@@ -68,6 +68,7 @@ struct {
     { "reply_to", "reply-to", LOG_EMAIL_DEFAULT },
     { "bcc", "bcc", LOG_EMAIL_COMMA },
     { "message_id", "message-id", LOG_EMAIL_EXTENDED },
+    { "subject", "subject", LOG_EMAIL_EXTENDED },
     { "x_mailer", "x-mailer", LOG_EMAIL_EXTENDED },
     { "user_agent", "user-agent", LOG_EMAIL_EXTENDED },
     { "received", "received", LOG_EMAIL_ARRAY },
@@ -264,17 +265,6 @@ json_t *JsonEmailLogJsonData(const Flow *f, void *state, void *vtx, uint64_t tx_
                 }
             }
 
-            /* Subject: */
-            field = MimeDecFindField(entity, "subject");
-            if (field != NULL) {
-                char *s = BytesToString((uint8_t *)field->value, (size_t) field->value_len);
-                if (likely(s != NULL)) {
-                    //printf("Subject: \"%s\"\n", s);
-                    json_object_set_new(sjs, "subject", json_string(s));
-                    SCFree(s);
-                }
-            }
-
             entity->header_flags |= HDR_IS_LOGGED;
 
             if (mime_state->stack == NULL || mime_state->stack->top == NULL || mime_state->stack->top->data == NULL)