diff options
-rw-r--r-- | doc/Makefile | 4 | ||||
-rw-r--r-- | src/lua/lua_task.c | 15 |
2 files changed, 18 insertions, 1 deletions
diff --git a/doc/Makefile b/doc/Makefile index 55947cb19..bd561fc2b 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -12,7 +12,7 @@ rspamd.8: rspamd.8.md rspamc.1: rspamc.1.md $(PANDOC) -s -f markdown -t man -o rspamc.1 rspamc.1.md -lua-doc: lua_regexp lua_ip lua_config +lua-doc: lua_regexp lua_ip lua_config lua_task lua_regexp: ../src/lua/lua_regexp.c $(LUADOC) < ../src/lua/lua_regexp.c > markdown/lua/regexp.md @@ -20,3 +20,5 @@ lua_ip: ../src/lua/lua_ip.c $(LUADOC) < ../src/lua/lua_ip.c > markdown/lua/ip.md lua_config: ../src/lua/lua_config.c $(LUADOC) < ../src/lua/lua_config.c > markdown/lua/config.md +lua_task: ../src/lua/lua_task.c + $(LUADOC) < ../src/lua/lua_task.c > markdown/lua/task.md diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c index 9aadcada5..1bbf52a0f 100644 --- a/src/lua/lua_task.c +++ b/src/lua/lua_task.c @@ -215,6 +215,21 @@ function check_header_delimiter_tab(task, header_name) end */ LUA_FUNCTION_DEF (task, get_header_full); +/*** + * @method task:get_received_headers() + * Returns a list of tables of parsed received headers. A tables returned have + * the following structure: + * + * - `from_hostname` - string that represents hostname provided by a peer + * - `from_ip` - string representation of IP address as provided by a peer + * - `real_hostname` - hostname as resolved by MTA + * - `real_ip` - string representation of IP as resolved by PTR request of MTA + * - `by_hostname` - MTA hostname + * + * Please note that in some situations rspamd cannot parse all the fields of received headers. + * In that case you should check all strings for validity. + * @return {table of tables} list of received headers described above + */ LUA_FUNCTION_DEF (task, get_received_headers); LUA_FUNCTION_DEF (task, get_resolver); LUA_FUNCTION_DEF (task, inc_dns_req); |