summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-06-25 00:02:17 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-06-25 00:02:17 +0100
commitf1b9b48c3343ccdfe3835b55a44053e34b6f0b0c (patch)
tree43d19bec9d4d66f92953ae3ef14e39769cb56f09
parent5ebc4f7215714626e2a3eb6bb617a423c984a4b1 (diff)
downloadrspamd-f1b9b48c3343ccdfe3835b55a44053e34b6f0b0c.tar.gz
rspamd-f1b9b48c3343ccdfe3835b55a44053e34b6f0b0c.zip
[Minor] Allow to check for milter flag in a task
-rw-r--r--src/lua/lua_task.c7
1 files changed, 7 insertions, 0 deletions
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;
}