diff options
author | LeftTry <lerest.go@gmail.com> | 2024-07-28 19:57:37 +0600 |
---|---|---|
committer | LeftTry <lerest.go@gmail.com> | 2024-07-28 19:57:37 +0600 |
commit | 74a302d1e9581d336ba7b8c23f235e49d5600637 (patch) | |
tree | 919d916cea9bdd70c9ebd87a85d9037f6085513f /src | |
parent | 128352a01d8daac65d4e17a3152fa85aab634e68 (diff) | |
parent | 090dd9e96e242cec0dbe1130baaeba765d4161b3 (diff) | |
download | rspamd-74a302d1e9581d336ba7b8c23f235e49d5600637.tar.gz rspamd-74a302d1e9581d336ba7b8c23f235e49d5600637.zip |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/lua/arc.lua | 12 | ||||
-rw-r--r-- | src/plugins/lua/gpt.lua | 4 | ||||
-rw-r--r-- | src/plugins/lua/known_senders.lua | 3 |
3 files changed, 15 insertions, 4 deletions
diff --git a/src/plugins/lua/arc.lua b/src/plugins/lua/arc.lua index ff19aef4c..90e254e78 100644 --- a/src/plugins/lua/arc.lua +++ b/src/plugins/lua/arc.lua @@ -635,11 +635,21 @@ local function prepare_arc_selector(task, sel) end end + local function arc_result_from_ar(ar_header) + ar_header = ar_header or "" + for k, v in string.gmatch(ar_header, "(%w+)=(%w+)") do + if k == 'arc' then + return v + end + end + return nil + end + if settings.reuse_auth_results then local ar_header = task:get_header('Authentication-Results') if ar_header then - local arc_match = string.match(ar_header, 'arc=(%w+)') + local arc_match = arc_result_from_ar(ar_header) if arc_match then if arc_match == 'none' or arc_match == 'pass' then diff --git a/src/plugins/lua/gpt.lua b/src/plugins/lua/gpt.lua index 61217cbf8..823dbd045 100644 --- a/src/plugins/lua/gpt.lua +++ b/src/plugins/lua/gpt.lua @@ -94,11 +94,11 @@ local function default_condition(task) local action = result.action if action == 'reject' and result.npositive > 1 then - return true, 'already decided as spam' + return false, 'already decided as spam' end if action == 'no action' and score < 0 then - return true, 'negative score, already decided as ham' + return false, 'negative score, already decided as ham' end end -- We also exclude some symbols diff --git a/src/plugins/lua/known_senders.lua b/src/plugins/lua/known_senders.lua index 6d57acea3..5cb2ddcf5 100644 --- a/src/plugins/lua/known_senders.lua +++ b/src/plugins/lua/known_senders.lua @@ -18,6 +18,7 @@ limitations under the License. local rspamd_logger = require "rspamd_logger" local N = 'known_senders' +local E = {} local lua_util = require "lua_util" local lua_redis = require "lua_redis" local lua_maps = require "lua_maps" @@ -258,7 +259,7 @@ local function verify_local_replies_set(task) return nil end - local replies_recipients = task:get_recipients('mime') + local replies_recipients = task:get_recipients('mime') or E local replies_sender_string = lua_util.maybe_obfuscate_string(tostring(replies_sender), settings, settings.sender_prefix) |