diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-09-08 20:13:29 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-09-08 20:13:29 +0400 |
commit | c6d4570aa00c93e6d142aaa8cd38a3c9ee29eb8f (patch) | |
tree | 51fd7b69c3cee4817daca44c15ea2576f3e37d68 /src/cfg_file.y | |
parent | 9af09b7467a4b9b7b2c9fbf1390b481e71bb07c6 (diff) | |
download | rspamd-c6d4570aa00c93e6d142aaa8cd38a3c9ee29eb8f.tar.gz rspamd-c6d4570aa00c93e6d142aaa8cd38a3c9ee29eb8f.zip |
* Make settings working
Diffstat (limited to 'src/cfg_file.y')
-rw-r--r-- | src/cfg_file.y | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/cfg_file.y b/src/cfg_file.y index 46b3bf110..19584be92 100644 --- a/src/cfg_file.y +++ b/src/cfg_file.y @@ -9,6 +9,7 @@ #include "classifiers/classifiers.h" #include "tokenizers/tokenizers.h" #include "view.h" +#include "settings.h" #ifdef WITH_LUA #include "lua/lua_common.h" #else @@ -57,6 +58,7 @@ struct rspamd_view *cur_view = NULL; %token DELIVERY LMTP ENABLED AGENT SECTION LUACODE RAW_MODE PROFILE_FILE COUNT %token VIEW IP FROM SYMBOLS %token AUTOLEARN MIN_MARK MAX_MARK +%token SETTINGS USER_SETTINGS DOMAIN_SETTINGS %type <string> STRING %type <string> VARIABLE @@ -97,6 +99,7 @@ command : | raw_mode | profile_file | view + | settings ; tempdir : @@ -984,6 +987,37 @@ viewsymbols: } } ; + +settings: + SETTINGS OBRACE settingsbody EBRACE + ; + +settingsbody: + | settingscmd SEMICOLON + | settingsbody settingscmd SEMICOLON + ; + +settingscmd: + | usersettings + | domainsettings + ; + +usersettings: + USER_SETTINGS EQSIGN QUOTEDSTRING { + if (!read_settings ($3, cfg, cfg->user_settings)) { + yyerror ("yyparse: cannot read settings %s", $3); + YYERROR; + } + } + ; +domainsettings: + DOMAIN_SETTINGS EQSIGN QUOTEDSTRING { + if (!read_settings ($3, cfg, cfg->domain_settings)) { + yyerror ("yyparse: cannot read settings %s", $3); + YYERROR; + } + } + ; %% /* * vi:ts=4 |