diff options
author | Andrew Lewis <nerf@judo.za.org> | 2017-02-13 18:45:02 +0200 |
---|---|---|
committer | Andrew Lewis <nerf@judo.za.org> | 2017-02-13 18:45:02 +0200 |
commit | 28d3143551376428e17505ddbd43326662445734 (patch) | |
tree | 9ee77ab58859780b2285cfe85241a02a359273fd /rules | |
parent | b031412b168dd53c26948bc559d7b47ed679c06b (diff) | |
download | rspamd-28d3143551376428e17505ddbd43326662445734.tar.gz rspamd-28d3143551376428e17505ddbd43326662445734.zip |
[Minor] Filter artificial Received header in multimap by default
- Also filter headers in CHECK_RECEIVED rule
Diffstat (limited to 'rules')
-rw-r--r-- | rules/misc.lua | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/rules/misc.lua b/rules/misc.lua index d1bd8f9ca..e7dca4b04 100644 --- a/rules/misc.lua +++ b/rules/misc.lua @@ -17,6 +17,7 @@ limitations under the License. -- This is main lua config file for rspamd local E = {} +local fun = require "fun" local util = require "rspamd_util" local rspamd_regexp = require "rspamd_regexp" @@ -610,6 +611,9 @@ rspamd_config:set_metric_symbol('TO_MATCH_ENVRCPT_SOME', 0, 'Some of the recipie rspamd_config.CHECK_RECEIVED = { callback = function (task) local received = task:get_received_headers() + received = fun.filter(function(h) + return not h['artificial'] + end, received):totable() task:insert_result('RCVD_COUNT_' .. #received, 1.0) end } @@ -788,7 +792,6 @@ rspamd_config:register_dependency(freemail_reply_neq_from_id, 'FREEMAIL_FROM') rspamd_config.OMOGRAPH_URL = { callback = function(task) - local fun = require "fun" local urls = task:get_urls() if urls then |