]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Fix] Don't force action in replies module for authenticated users/local networks 937/head
authorAndrew Lewis <nerf@judo.za.org>
Thu, 8 Sep 2016 16:50:42 +0000 (18:50 +0200)
committerAndrew Lewis <nerf@judo.za.org>
Thu, 8 Sep 2016 16:52:41 +0000 (18:52 +0200)
src/plugins/lua/replies.lua

index 9916dc3cf6d384684eb587f0949d072d375a06ef..4a3c5646f3544c493cbaec19f23a303cb5c84fb7 100644 (file)
@@ -51,7 +51,11 @@ local function replies_check(task)
       -- Hash was found
       task:insert_result(settings['symbol'], 0.0)
       if settings['action'] ~= nil then
-        task:set_pre_result(settings['action'], settings['message'])
+        if task:get_user() or (ip_addr and ip_addr:is_local()) then
+          rspamd_logger.infox(task, "not forcing action for local network or authorized user");
+        else
+          task:set_pre_result(settings['action'], settings['message'])
+        end
       end
     end
   end