[Rspamd] Add metadata exporter for unauthed mail
This commit is contained in:
@@ -12,8 +12,31 @@ rules {
|
||||
selector = "ratelimited";
|
||||
formatter = "json";
|
||||
}
|
||||
UNAUTHMAIL {
|
||||
backend = "http";
|
||||
url = "http://nginx:9081/pushover.php";
|
||||
selector = "unauth_mail";
|
||||
# Only return msgid, do not parse the full message
|
||||
formatter = "msgid";
|
||||
meta_headers = true;
|
||||
}
|
||||
}
|
||||
|
||||
custom_select {
|
||||
unauth_mail = <<EOD
|
||||
return function(task)
|
||||
local action = task:get_metric_action('default')
|
||||
if task:has_symbol('NO_LOG_STAT') or (action == 'reject' or action == 'add header' or action == 'rewrite subject') then
|
||||
return false
|
||||
else
|
||||
local uname = task:get_user()
|
||||
if not uname then
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
end
|
||||
EOD;
|
||||
ratelimited = <<EOD
|
||||
return function(task)
|
||||
local ratelimited = task:get_symbol("RATELIMITED")
|
||||
@@ -33,3 +56,12 @@ return function(task)
|
||||
end
|
||||
EOD;
|
||||
}
|
||||
|
||||
custom_format {
|
||||
msgid = <<EOD
|
||||
return function(task)
|
||||
return task:get_message_id()
|
||||
end
|
||||
EOD;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user