commit d5131fc: [Test] Improve envelope stuff testing
Vsevolod Stakhov
vsevolod at highsecure.ru
Sun Nov 28 12:28:05 UTC 2021
Author: Vsevolod Stakhov
Date: 2021-11-28 12:23:06 +0000
URL: https://github.com/rspamd/rspamd/commit/d5131fcf2f9ceedbfdc8a5e28f663c15a1d8ffa7 (HEAD -> master)
[Test] Improve envelope stuff testing
---
test/lua/unit/lua_mime.message_to_ucl.lua | 29 ++++++++++++++++++++++++++++-
1 file changed, 28 insertions(+), 1 deletion(-)
diff --git a/test/lua/unit/lua_mime.message_to_ucl.lua b/test/lua/unit/lua_mime.message_to_ucl.lua
index 27bf24d5a..d02d2cc7b 100644
--- a/test/lua/unit/lua_mime.message_to_ucl.lua
+++ b/test/lua/unit/lua_mime.message_to_ucl.lua
@@ -51,6 +51,9 @@ context("Task piecewise split", function()
rspamd_parsers.parse_mail_address("Test1 <test1 at example.com>")[1],
rspamd_parsers.parse_mail_address("Test2 <test2 at example.com>")[1]
}, 'rewrite')
+ task:set_from_ip("198.172.22.91")
+ task:set_user("cool user name")
+ task:set_helo("hello mail")
task:process_message()
local expected_json = [[
@@ -108,6 +111,28 @@ context("Task piecewise split", function()
"newlines": "lf",
"digest": "043cf1a314d0a1af95951d6aec932faf",
"envelope": {
+ "recipients_smtp": [
+ {
+ "addr": "test1 at example.com",
+ "raw": "<test1 at example.com>",
+ "flags": {
+ "valid": true
+ },
+ "user": "test1",
+ "name": "Test1",
+ "domain": "example.com"
+ },
+ {
+ "addr": "test2 at example.com",
+ "raw": "<test2 at example.com>",
+ "flags": {
+ "valid": true
+ },
+ "user": "test2",
+ "name": "Test2",
+ "domain": "example.com"
+ }
+ ],
"from_smtp": {
"addr": "test at example.com",
"raw": "<test at example.com>",
@@ -117,7 +142,9 @@ context("Task piecewise split", function()
"user": "test",
"name": "Test",
"domain": "example.com"
- }
+ },
+ "helo": "hello mail",
+ "from_ip": "198.172.22.91"
},
"size": 666,
"headers": [
More information about the Commits
mailing list