aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-12-14 10:18:32 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-12-14 10:18:32 +0000
commit5ce6a2d97ff655651e4bba7737b834d866b94c94 (patch)
tree24f4453f34a80d3389f17ea929ddd29e2237d000
parent865a3fad78cfeac8155a070ed7f17eeb5b9b6146 (diff)
downloadrspamd-5ce6a2d97ff655651e4bba7737b834d866b94c94.tar.gz
rspamd-5ce6a2d97ff655651e4bba7737b834d866b94c94.zip
[Minor] Allow to get raw body of non processed messages
-rw-r--r--src/lua/lua_task.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c
index 061ed1ee2..c0d5c85e0 100644
--- a/src/lua/lua_task.c
+++ b/src/lua/lua_task.c
@@ -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 {