From: Vsevolod Stakhov Date: Wed, 18 Sep 2019 15:28:28 +0000 (+0100) Subject: [Minor] Multimap: Better attachments handling X-Git-Tag: 2.0~181 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=95394aa37a81e7ee828483da326b2f38ffbd3432;p=rspamd.git [Minor] Multimap: Better attachments handling --- diff --git a/src/lua/lua_mimepart.c b/src/lua/lua_mimepart.c index fdc793ad8..01c64ae64 100644 --- a/src/lua/lua_mimepart.c +++ b/src/lua/lua_mimepart.c @@ -1730,7 +1730,7 @@ lua_mimepart_is_attachment (lua_State * L) return luaL_error (L, "invalid arguments"); } - if (!(part->flags & (RSPAMD_MIME_PART_IMAGE|RSPAMD_MIME_PART_TEXT))) { + if (!(part->flags & (RSPAMD_MIME_PART_IMAGE))) { if (part->cd && part->cd->type == RSPAMD_CT_ATTACHMENT) { lua_pushboolean (L, true); } diff --git a/src/plugins/lua/multimap.lua b/src/plugins/lua/multimap.lua index aee98f6b2..f3c647f15 100644 --- a/src/plugins/lua/multimap.lua +++ b/src/plugins/lua/multimap.lua @@ -861,7 +861,7 @@ local function multimap_callback(task, rule) local parts = task:get_parts() local function filter_parts(p) - return (not p:is_text()) and (not p:is_multipart()) + return p:is_attachment() or (not p:is_text()) and (not p:is_multipart()) end for p in fun.iter(fun.filter(filter_parts, parts)) do