end
*/
LUA_FUNCTION_DEF (task, get_urls);
+/***
+ * @method task:get_content()
+ * Get raw content for the specified task
+ * @return {string} the data contained in the task
+ */
+LUA_FUNCTION_DEF (task, get_content);
/***
* @method task:get_urls()
* Get all email addresses found in a message.
LUA_INTERFACE_DEF (task, insert_result),
LUA_INTERFACE_DEF (task, set_pre_result),
LUA_INTERFACE_DEF (task, get_urls),
+ LUA_INTERFACE_DEF (task, get_content),
LUA_INTERFACE_DEF (task, get_emails),
LUA_INTERFACE_DEF (task, get_text_parts),
LUA_INTERFACE_DEF (task, get_parts),
return 1;
}
+static gint
+lua_task_get_content (lua_State * L)
+{
+ struct rspamd_task *task = lua_check_task (L);
+
+ if (task) {
+ lua_pushlstring (L, task->msg.start, task->msg.len);
+ return 1;
+ }
+
+ lua_pushnil (L);
+ return 1;
+}
+
static gint
lua_task_get_emails (lua_State * L)
{