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)
86static void EveEmailLogJSONMd5(
94 SCMimeSmtpLogSubjectMd5(js, entity);
102 SCMimeSmtpLogBodyMd5(js, entity);
106static void EveEmailLogJSONCustom(
111 if (entity == NULL) {
116 if (((email_ctx->
fields & (1ULL<<f)) != 0)
121 SCMimeSmtpLogFieldArray(
124 SCMimeSmtpLogFieldComma(
127 SCMimeSmtpLogFieldString(
137static bool EveEmailLogJsonData(
138 const Flow *f,
void *state,
void *vtx, uint64_t tx_id, SCJsonBuilder *sjs)
141 MimeStateSMTP *mime_state;
148 if (smtp_state == NULL) {
149 SCLogDebug(
"no smtp state, so no request logging");
155 SCLogDebug(
"lets go mime_state %p", mime_state);
161 if ((mime_state != NULL)) {
162 SCMimeSmtpLogData(sjs, mime_state);
171 void *state,
void *vtx, uint64_t tx_id)
175 SCJsonBuilderMark mark = { 0, 0, 0 };
177 SCJbGetMark(js, &mark);
178 SCJbOpenObject(js,
"email");
179 if (!EveEmailLogJsonData(f, state, vtx, tx_id, js)) {
180 SCJbRestoreMark(js, &mark);
185 EveEmailLogJSONCustom(email_ctx, js, tx);
188 EveEmailLogJSONMd5(email_ctx, js, tx);
201 return EveEmailLogJsonData(f, smtp_state, tx, tx_id, js);
213 if (extended != NULL) {
228 email_ctx->
fields |= (1ULL << f);
236 email_ctx->
flags = 0;
241 if (strcmp(
"body", field->
val) == 0) {
242 SCLogInfo(
"Going to log the md5 sum of email body");
245 if (strcmp(
"subject", field->
val) == 0) {
246 SCLogInfo(
"Going to log the md5 sum of email subject");
struct HtpBodyChunk_ * next
void * AppLayerParserGetTx(uint8_t ipproto, AppProto alproto, void *alstate, uint64_t tx_id)
SCConfNode * SCConfNodeLookupChild(const SCConfNode *node, const char *name)
Lookup a child configuration node by name.
int SCConfValIsTrue(const char *val)
Check if a value is true.
const char * SCConfNodeLookupChildValue(const SCConfNode *node, const char *name)
Lookup the value of a child configuration node by name.
const char * config_field
void OutputEmailInitConf(SCConfNode *conf, OutputJsonEmailCtx *email_ctx)
#define LOG_EMAIL_BODY_MD5
struct @143 email_fields[]
#define LOG_EMAIL_SUBJECT_MD5
bool EveEmailAddMetadata(const Flow *f, uint64_t tx_id, SCJsonBuilder *js)
#define LOG_EMAIL_DEFAULT
TmEcode EveEmailLogJson(JsonEmailLogThread *aft, SCJsonBuilder *js, const Packet *p, Flow *f, void *state, void *vtx, uint64_t tx_id)
#define LOG_EMAIL_EXTENDED
#define TAILQ_FOREACH(var, head, field)
OutputJsonEmailCtx * emaillog_ctx
MimeStateSMTP * mime_state
#define SCLogInfo(...)
Macro used to log INFORMATIONAL messages.
#define SCReturnPtr(x, type)