]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Allow to get raw body of non processed messages
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 14 Dec 2020 10:18:32 +0000 (10:18 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 14 Dec 2020 10:18:32 +0000 (10:18 +0000)
src/lua/lua_task.c

index 061ed1ee2576797808a3975eb01c154f088bbf4d..c0d5c85e0569712eccbae9afcd525bb9f6973224 100644 (file)
@@ -2546,7 +2546,13 @@ lua_task_get_rawbody (lua_State * L)
                        t->flags = 0;
                }
                else {
-                       lua_pushnil (L);
+                       /* Push body it it is there */
+                       if (task->msg.len > 0 && task->msg.begin != NULL) {
+                               lua_new_text (L, task->msg.begin, task->msg.len, FALSE);
+                       }
+                       else {
+                               lua_pushnil (L);
+                       }
                }
        }
        else {