]> git.ipfire.org Git - people/ms/suricata.git/commitdiff
smtp: log transaction even if no email present
authorJason Ish <jason.ish@oisf.net>
Wed, 10 Nov 2021 22:38:35 +0000 (16:38 -0600)
committerVictor Julien <vjulien@oisf.net>
Mon, 22 Nov 2021 09:58:11 +0000 (10:58 +0100)
The SMTP transaction logger was not writing the log if the email
portion of the logger failed, such as in the case of STARTTLS
where this is no email decoded.

Ticket #4817

src/output-json-smtp.c

index 59043518bdd15d70eebdd935f786a3c0d92fa81d..5fe126f4184c5a2a53a0bdc6d612cac8773e1767 100644 (file)
@@ -85,9 +85,8 @@ static int JsonSmtpLogger(ThreadVars *tv, void *thread_data, const Packet *p, Fl
     EveSmtpDataLogger(f, state, tx, tx_id, jb);
     jb_close(jb);
 
-    if (EveEmailLogJson(jhl, jb, p, f, state, tx, tx_id) == TM_ECODE_OK) {
-        OutputJsonBuilderBuffer(jb, jhl->ctx);
-    }
+    EveEmailLogJson(jhl, jb, p, f, state, tx, tx_id);
+    OutputJsonBuilderBuffer(jb, jhl->ctx);
 
     jb_free(jb);