aboutsummaryrefslogtreecommitdiffstats
path: root/lualib/lua_util.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lualib/lua_util.lua')
-rw-r--r--lualib/lua_util.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/lualib/lua_util.lua b/lualib/lua_util.lua
index 387952fef..c401610d5 100644
--- a/lualib/lua_util.lua
+++ b/lualib/lua_util.lua
@@ -135,4 +135,13 @@ exports.remove_email_aliases = function(email_addr)
end
end
+exports.is_rspamc_or_controller = function(task)
+ local ua = task:get_request_header('User-Agent') or ''
+ local pwd = task:get_request_header('Password')
+ local is_rspamc = false
+ if tostring(ua) == 'rspamc' or pwd then is_rspamc = true end
+
+ return is_rspamc
+end
+
return exports