diff options
author | korgoth1 <vladislav.stakhov@gmail.com> | 2019-09-17 12:05:26 +0300 |
---|---|---|
committer | korgoth1 <vladislav.stakhov@gmail.com> | 2019-09-17 12:05:26 +0300 |
commit | 01a00441b2f13e6c489fa6c7408b50dbf1a389e5 (patch) | |
tree | 1de9dfd24ece7608341553dde422ec8331bd3c08 | |
parent | 41bbc144695fce42852674bee3b445fd63cb5201 (diff) | |
parent | baa476fc09c92bc261cb0e35f936f93c66358515 (diff) | |
download | rspamd-01a00441b2f13e6c489fa6c7408b50dbf1a389e5.tar.gz rspamd-01a00441b2f13e6c489fa6c7408b50dbf1a389e5.zip |
[Test] MAGIC ROBOT
-rw-r--r-- | lualib/lua_cfg_transform.lua | 26 | ||||
-rw-r--r-- | test/functional/messages/gargantua.eml | 10 |
2 files changed, 29 insertions, 7 deletions
diff --git a/lualib/lua_cfg_transform.lua b/lualib/lua_cfg_transform.lua index 6ee83a117..b6919cb10 100644 --- a/lualib/lua_cfg_transform.lua +++ b/lualib/lua_cfg_transform.lua @@ -253,10 +253,18 @@ local function surbl_section_convert(cfg, section) end for k,v in pairs(value) do + local skip = false -- Rename if k == 'suffix' then k = 'rbl' end if k == 'ips' then k = 'returncodes' end if k == 'bits' then k = 'returnbits' end + -- Crappy legacy + if k == 'options' then + if v == 'noip' or v == 'no_ip' then + converted.no_ip = true + skip = true + end + end if k:match('check_') then local n = k:match('check_(.*)') k = n @@ -272,7 +280,9 @@ local function surbl_section_convert(cfg, section) converted.emails_domainonly = true end - converted[k] = lua_util.deepcopy(v) + if not skip then + converted[k] = lua_util.deepcopy(v) + end end rbl_section[name] = converted end @@ -298,6 +308,7 @@ local function emails_section_convert(cfg, section) end for k,v in pairs(value) do + local skip = false -- Rename if k == 'dnsbl' then k = 'rbl' end if k == 'check_replyto' then k = 'replyto' end @@ -310,10 +321,21 @@ local function emails_section_convert(cfg, section) -- Hack converted.emails = false converted.replyto = true + skip = true end end + if k == 'expect_ip' then + -- Another stupid hack + if not converted.return_codes then + converted.return_codes = {} + end + local symbol = value.symbol or name + converted.return_codes[symbol] = { v } + end - converted[k] = lua_util.deepcopy(v) + if not skip then + converted[k] = lua_util.deepcopy(v) + end end rbl_section[name] = converted end diff --git a/test/functional/messages/gargantua.eml b/test/functional/messages/gargantua.eml index bb36d8859..c9fb72af3 100644 --- a/test/functional/messages/gargantua.eml +++ b/test/functional/messages/gargantua.eml @@ -23042,7 +23042,7 @@ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA --XXX -Content-Type: application/octet-stream +Content-Type: image/unknown Content-Transfer-Encoding: base64 X-Real-Type: png @@ -23117,7 +23117,7 @@ REFUOBFj1NLW/c9ARcBERbPARo0aSHmIjobhaBiSEQKjyYaMQEPTQvUwBAD4XQGl r/6/wAAAAABJRU5ErkJggg== --XXX -Content-Type: application/octet-stream +Content-Type: image/unknown Content-Transfer-Encoding: base64 X-Real-Type: jpg @@ -23134,7 +23134,7 @@ wFx0i+Lv1HK8mTLaeNa122GlmzLGrYnTofqPOhomtaytMWSZ6i9dfCa3SKuaqtt4 N44QXoIzwglB/9k= --XXX -Content-Type: application/octet-stream +Content-Type: image/unknown Content-Transfer-Encoding: base64 X-Real-Type: gif @@ -23169,7 +23169,7 @@ RKFxh0gZYFRRxRdRJocbkRLBGJoukSRyZxmIwBkfaIEyh4ygMOZiZo2TakWnoMh0 x92mlmoFKaSdJvUppqEWOaqjpaZ6U0AAOw== --XXX -Content-Type: application/octet-stream +Content-Type: image/unknown Content-Transfer-Encoding: base64 X-Real-Type: bmp @@ -23220,7 +23220,7 @@ ZgagmZkJPArXAyRcjzIAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAA//////// /v3///7+//3///39/v35///7///+////////////////////////AAAA --XXX -Content-Type: application/octet-stream +Content-Type: text/unknown Content-Transfer-Encoding: base64 X-Real-Type: txt |