From 852af5d02e31d7361ede44cee3c8f93fea951ec6 Mon Sep 17 00:00:00 2001 From: Justin Azoff Date: Mon, 13 Jan 2014 16:55:07 -0500 Subject: [PATCH] Include file information in notices Add file_desc and file_mime_type information to notice output if it exists in the notice. --- scripts/base/frameworks/notice/main.bro | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/scripts/base/frameworks/notice/main.bro b/scripts/base/frameworks/notice/main.bro index a5f17a4979..328dea8e6a 100644 --- a/scripts/base/frameworks/notice/main.bro +++ b/scripts/base/frameworks/notice/main.bro @@ -400,11 +400,20 @@ function email_notice_to(n: Notice::Info, dest: string, extend: bool) # First off, finish the headers and include the human readable messages # then leave a blank line after the message. - email_text = string_cat(email_text, "\nMessage: ", n$msg); + email_text = string_cat(email_text, "\nMessage: ", n$msg, "\n"); if ( n?$sub ) - email_text = string_cat(email_text, "\nSub-message: ", n$sub); + email_text = string_cat(email_text, "Sub-message: ", n$sub, "\n"); - email_text = string_cat(email_text, "\n\n"); + email_text = string_cat(email_text, "\n"); + + # add information about the file if it exists + if (n?$file_desc) + email_text = string_cat(email_text, "File Description: ", n$file_desc, "\n"); + if (n?$file_mime_type) + email_text = string_cat(email_text, "File Mime Type: ", n$file_mime_type, "\n"); + + if (n?$file_desc || n?$file_mime_type) + email_text = string_cat(email_text, "\n"); # Next, add information about the connection if it exists. if ( n?$id )