]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Reputation: deal with inbound/outbound both set
authorAndrew Lewis <nerf@judo.za.org>
Mon, 15 Jan 2018 09:07:40 +0000 (11:07 +0200)
committerAndrew Lewis <nerf@judo.za.org>
Mon, 15 Jan 2018 09:07:40 +0000 (11:07 +0200)
src/plugins/lua/reputation.lua

index e7349e445aed265e47ed19e8070a2c99cb375884..0d870eee8115b52666fe349fca88ee0635906dbd 100644 (file)
@@ -763,13 +763,15 @@ local backends = {
 
 local function is_rule_applicable(task, rule)
   local ip = task:get_from_ip()
-  if rule.selector.config.outbound then
-    if not (task:get_user() or (ip and ip:is_local())) then
-      return false
-    end
-  elseif rule.selector.config.inbound then
-    if task:get_user() or (ip and ip:is_local()) then
-      return false
+  if not (rule.selector.config.outbound and rule.selector.config.inbound) then
+    if rule.selector.config.outbound then
+      if not (task:get_user() or (ip and ip:is_local())) then
+        return false
+      end
+    elseif rule.selector.config.inbound then
+      if task:get_user() or (ip and ip:is_local()) then
+        return false
+      end
     end
   end