mirror of
https://github.com/zeek/zeek.git
synced 2025-10-06 08:38:20 +00:00

- While updating, I did some further work on the branch. - New function in the base/utils/files for extracting filenames from content-dispositions. - New script for entity excerpt extraction if you aren't interested in full extraction. The data goes a log field too. - Some renaming and reorganization of types. - Updated tests to work with new code. * origin/topic/jsiwek/smtp-refactor: Make the doc.coverage test happy. SMTP script refactor. (addresses #509) Conflicts: doc/scripts/DocSourcesList.cmake policy/protocols/smtp/__load__.bro policy/protocols/smtp/base/__load__.bro
23 lines
639 B
Text
23 lines
639 B
Text
# Checks logging of mime types and md5 calculation. Mime type in the log
|
|
# is normalized to prevent sensitivity to libmagic version.
|
|
|
|
# @TEST-REQUIRES: grep -q '#define HAVE_LIBMAGIC' $BUILD/config.h
|
|
# @TEST-EXEC: bro -r $TRACES/smtp.trace %INPUT
|
|
# @TEST-EXEC: btest-diff smtp_entities.log
|
|
|
|
@load base/protocols/smtp
|
|
|
|
redef SMTP::generate_md5=/text\/plain/;
|
|
|
|
event bro_init()
|
|
{
|
|
Log::remove_default_filter(SMTP::SMTP_ENTITIES);
|
|
Log::add_filter(SMTP::SMTP_ENTITIES, [$name="normalized-mime-types",
|
|
$pred=function(rec: SMTP::EntityInfo): bool
|
|
{
|
|
if ( rec?$mime_type )
|
|
rec$mime_type = "FAKE_MIME";
|
|
return T;
|
|
}
|
|
]);
|
|
}
|