55 #define LOG_EMAIL_DEFAULT 0
56 #define LOG_EMAIL_EXTENDED (1<<0)
57 #define LOG_EMAIL_ARRAY (1<<1)
58 #define LOG_EMAIL_COMMA (1<<2)
59 #define LOG_EMAIL_BODY_MD5 (1<<3)
60 #define LOG_EMAIL_SUBJECT_MD5 (1<<4)
93 SCMimeSmtpLogSubjectMd5(js, entity);
101 SCMimeSmtpLogBodyMd5(js, entity);
109 if (entity == NULL) {
114 if (((email_ctx->
fields & (1ULL<<f)) != 0)
119 SCMimeSmtpLogFieldArray(
122 SCMimeSmtpLogFieldComma(
125 SCMimeSmtpLogFieldString(
135 static bool EveEmailLogJsonData(
const Flow *f,
void *state,
void *vtx, uint64_t tx_id, JsonBuilder *sjs)
138 MimeStateSMTP *mime_state;
145 if (smtp_state == NULL) {
146 SCLogDebug(
"no smtp state, so no request logging");
152 SCLogDebug(
"lets go mime_state %p", mime_state);
158 if ((mime_state != NULL)) {
159 SCMimeSmtpLogData(sjs, mime_state);
171 JsonBuilderMark mark = { 0, 0, 0 };
173 jb_get_mark(js, &mark);
174 jb_open_object(js,
"email");
175 if (!EveEmailLogJsonData(f, state, vtx, tx_id, js)) {
176 jb_restore_mark(js, &mark);
181 EveEmailLogJSONCustom(email_ctx, js, tx);
184 EveEmailLogJSONMd5(email_ctx, js, tx);
197 return EveEmailLogJsonData(f, smtp_state, tx, tx_id, js);
209 if (extended != NULL) {
224 email_ctx->
fields |= (1ULL << f);
232 email_ctx->
flags = 0;
237 if (strcmp(
"body", field->
val) == 0) {
238 SCLogInfo(
"Going to log the md5 sum of email body");
241 if (strcmp(
"subject", field->
val) == 0) {
242 SCLogInfo(
"Going to log the md5 sum of email subject");