mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00

So they're easier to override (just provide a new handler without specifying a priority).
27 lines
648 B
Text
27 lines
648 B
Text
@load ./main
|
|
@load ./entities
|
|
@load base/utils/conn-ids
|
|
@load base/frameworks/file-analysis/main
|
|
|
|
module SMTP;
|
|
|
|
export {
|
|
## Default file handle provider for SMTP.
|
|
global get_file_handle: function(c: connection, is_orig: bool): string;
|
|
}
|
|
|
|
function get_file_handle(c: connection, is_orig: bool): string
|
|
{
|
|
if ( ! c?$smtp ) return "";
|
|
return cat(ANALYZER_SMTP, " ", c$start_time, " ", c$smtp$trans_depth, " ",
|
|
c$smtp_state$mime_level);
|
|
}
|
|
|
|
module GLOBAL;
|
|
|
|
event get_file_handle(tag: AnalyzerTag, c: connection, is_orig: bool)
|
|
&priority=5
|
|
{
|
|
if ( tag != ANALYZER_SMTP ) return;
|
|
set_file_handle(SMTP::get_file_handle(c, is_orig));
|
|
}
|