From: Vsevolod Stakhov Date: Sat, 24 Jun 2017 23:02:17 +0000 (+0100) Subject: [Minor] Allow to check for milter flag in a task X-Git-Tag: 1.6.2~74 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f1b9b48c3343ccdfe3835b55a44053e34b6f0b0c;p=rspamd.git [Minor] Allow to check for milter flag in a task --- diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c index 579eee9cc..e0412e2da 100644 --- a/src/lua/lua_task.c +++ b/src/lua/lua_task.c @@ -730,6 +730,7 @@ LUA_FUNCTION_DEF (task, has_flag); * - `learn_spam`: learn message as spam * - `learn_ham`: learn message as ham * - `broken_headers`: header data is broken for a message + * - `milter`: task is initiated by milter connection * @return {array of strings} table with all flags as strings */ LUA_FUNCTION_DEF (task, get_flags); @@ -3325,6 +3326,8 @@ lua_task_has_flag (lua_State *L) LUA_TASK_GET_FLAG (flag, "greylisted", RSPAMD_TASK_FLAG_GREYLISTED); LUA_TASK_GET_FLAG (flag, "broken_headers", RSPAMD_TASK_FLAG_BROKEN_HEADERS); + LUA_TASK_GET_FLAG (flag, "milter", + RSPAMD_TASK_FLAG_MILTER); if (!found) { msg_warn_task ("unknown flag requested: %s", flag); @@ -3391,6 +3394,10 @@ lua_task_get_flags (lua_State *L) lua_pushstring (L, "greylisted"); lua_rawseti (L, -2, idx++); break; + case RSPAMD_TASK_FLAG_MILTER: + lua_pushstring (L, "milter"); + lua_rawseti (L, -2, idx++); + break; default: break; }