|
|
@@ -251,6 +251,11 @@ LUA_FUNCTION_DEF (task, get_raw_headers); |
|
|
|
* @return {table of tables} list of received headers described above |
|
|
|
*/ |
|
|
|
LUA_FUNCTION_DEF (task, get_received_headers); |
|
|
|
/*** |
|
|
|
* @method task:get_queue_id() |
|
|
|
* Returns queue ID of the message being processed. |
|
|
|
*/ |
|
|
|
LUA_FUNCTION_DEF (task, get_queue_id); |
|
|
|
/*** |
|
|
|
* @method task:get_resolver() |
|
|
|
* Returns ready to use rspamd_resolver object suitable for making asynchronous DNS requests. |
|
|
@@ -462,6 +467,7 @@ static const struct luaL_reg tasklib_m[] = { |
|
|
|
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_queue_id), |
|
|
|
LUA_INTERFACE_DEF (task, get_resolver), |
|
|
|
LUA_INTERFACE_DEF (task, inc_dns_req), |
|
|
|
LUA_INTERFACE_DEF (task, call_rspamd_function), |
|
|
@@ -1228,6 +1234,20 @@ lua_task_get_received_headers (lua_State * L) |
|
|
|
return 1; |
|
|
|
} |
|
|
|
|
|
|
|
static gint |
|
|
|
lua_task_get_queue_id (lua_State *L) |
|
|
|
{ |
|
|
|
struct rspamd_task *task = lua_check_task (L, 1); |
|
|
|
|
|
|
|
if (task && task->queue_id != NULL && task->queue_id != "undef") { |
|
|
|
lua_pushstring (L, task->queue_id); |
|
|
|
return 1; |
|
|
|
} |
|
|
|
|
|
|
|
lua_pushnil (L); |
|
|
|
return 1; |
|
|
|
} |
|
|
|
|
|
|
|
static gint |
|
|
|
lua_task_get_resolver (lua_State *L) |
|
|
|
{ |