]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Allow to check for milter flag in a task
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 24 Jun 2017 23:02:17 +0000 (00:02 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 24 Jun 2017 23:02:17 +0000 (00:02 +0100)
src/lua/lua_task.c

index 579eee9cc0959b9c64a65bb286315a51ec6a7b20..e0412e2da4c233ddbb0b97d443561269484ad9e3 100644 (file)
@@ -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;
                                }