end
*/
LUA_FUNCTION_DEF (task, get_header_full);
+
+/***
+ * @method task:get_raw_headers()
+ * Get all undecoded headers of a message as a string
+ * @reeturn {string} all raw headers for a message
+ */
+LUA_FUNCTION_DEF (task, get_raw_headers);
+
/***
* @method task:get_received_headers()
* Returns a list of tables of parsed received headers. A tables returned have
LUA_INTERFACE_DEF (task, get_header),
LUA_INTERFACE_DEF (task, get_header_raw),
LUA_INTERFACE_DEF (task, get_header_full),
+ LUA_INTERFACE_DEF (task, get_raw_headers),
LUA_INTERFACE_DEF (task, get_received_headers),
LUA_INTERFACE_DEF (task, get_resolver),
LUA_INTERFACE_DEF (task, inc_dns_req),
return lua_task_get_header_common (L, FALSE, TRUE);
}
+static gint
+lua_task_get_raw_headers (lua_State *L)
+{
+ struct rspamd_task *task = lua_check_task (L, 1);
+
+ if (task) {
+ lua_pushstring (L, task->raw_headers_str);
+ }
+ else {
+ lua_pushnil (L);
+ }
+
+ return 1;
+}
+
static gint
lua_task_get_received_headers (lua_State * L)
{