aboutsummaryrefslogtreecommitdiffstats
path: root/lualib
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2021-12-09 11:02:32 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2021-12-09 11:02:32 +0000
commit533d7bb3646317e7a71894e3d42608270b7fae46 (patch)
treef459c76500f8dd7e409c823dbda76c487ab1dada /lualib
parent510b61f82bae20b9d8c2b61b51a35d9579c2d347 (diff)
downloadrspamd-533d7bb3646317e7a71894e3d42608270b7fae46.tar.gz
rspamd-533d7bb3646317e7a71894e3d42608270b7fae46.zip
[Minor] Fix schema and add size in all cases
Diffstat (limited to 'lualib')
-rw-r--r--lualib/lua_mime.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/lualib/lua_mime.lua b/lualib/lua_mime.lua
index 1646b892c..2128b29a6 100644
--- a/lualib/lua_mime.lua
+++ b/lualib/lua_mime.lua
@@ -626,6 +626,7 @@ exports.message_to_ucl = function(task, stringify_content)
type = string.format('%s/%s', part:get_type()),
headers = part:get_headers(true) or E,
boundary = part:get_enclosing_boundary(),
+ size = 0,
}
if part:is_multipart() then
@@ -661,7 +662,8 @@ exports.message_to_ucl_schema = function()
local function part_schema()
return ts.shape{
- content = ts.string:describe('Decoded content'),
+ content = ts.string:describe('Decoded content'):is_optional(),
+ multipart_boundary = ts.string:describe('Multipart service boundary'):is_optional(),
size = ts.integer:describe('Size of the part'),
type = ts.string:describe('Announced type'):is_optional(),
detected_type = ts.string:describe('Detected type'):is_optional(),