aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-11-29 19:04:35 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-11-29 19:04:35 +0000
commit0330f5c96e2eb47497b912709fa46deea52dcd0c (patch)
treef414f48f56212f9a906ea023c08aa75b80a8d6f4
parente734fc93a4ac532b98138248ad0f9f5a9196f960 (diff)
downloadrspamd-0330f5c96e2eb47497b912709fa46deea52dcd0c.tar.gz
rspamd-0330f5c96e2eb47497b912709fa46deea52dcd0c.zip
[Project] Add configuration method
-rw-r--r--src/lua/lua_spf.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/lua/lua_spf.c b/src/lua/lua_spf.c
index 7deb8fef1..bfa041051 100644
--- a/src/lua/lua_spf.c
+++ b/src/lua/lua_spf.c
@@ -231,4 +231,25 @@ lua_spf_record_dtor (lua_State *L)
}
return 0;
+}
+
+/***
+ * @function rspamd_spf.config(object)
+ * Configures SPF library according to the UCL config
+ * @param {table} object configuration object
+*/
+gint
+lua_spf_config (lua_State * L)
+{
+ ucl_object_t *config_obj = ucl_object_lua_import (L, 1);
+
+ if (config_obj) {
+ spf_library_config (config_obj);
+ ucl_object_unref (config_obj); /* As we copy data all the time */
+ }
+ else {
+ return luaL_error (L, "invalid arguments");
+ }
+
+ return 0;
} \ No newline at end of file