smtp: log transaction even if no email present

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

(cherry picked from commit 52b9c12f41)
pull/6765/head
Jason Ish 5 years ago committed by Shivani Bhardwaj
parent 87f04475aa
commit 6e9b21d0e6

@ -88,9 +88,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->file_ctx, &jhl->buffer);
}
EveEmailLogJson(jhl, jb, p, f, state, tx, tx_id);
OutputJsonBuilderBuffer(jb, jhl->file_ctx, &jhl->buffer);
jb_free(jb);

Loading…
Cancel
Save