summaryrefslogtreecommitdiffstats
path: root/src/cfg_file.y
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2009-10-27 19:34:11 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2009-10-27 19:34:11 +0300
commit15096c5130088a34af3384cac639ca8807a13f8e (patch)
treea52ee6535ce667f2c0be537228a413291b97ae01 /src/cfg_file.y
parent9c36d3f9efae2ee0b8c4322e9df1af5bef84678f (diff)
downloadrspamd-15096c5130088a34af3384cac639ca8807a13f8e.tar.gz
rspamd-15096c5130088a34af3384cac639ca8807a13f8e.zip
* Add ability to check views by client's ip (that ip from which we have a connection to rspamd)
Diffstat (limited to 'src/cfg_file.y')
-rw-r--r--src/cfg_file.y15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/cfg_file.y b/src/cfg_file.y
index c51e5a853..24a94bbc3 100644
--- a/src/cfg_file.y
+++ b/src/cfg_file.y
@@ -57,7 +57,7 @@ struct rspamd_view *cur_view = NULL;
%token LOG_LEVEL LOG_LEVEL_DEBUG LOG_LEVEL_INFO LOG_LEVEL_WARNING LOG_LEVEL_ERROR LOG_FACILITY LOG_FILENAME
%token STATFILE ALIAS PATTERN WEIGHT STATFILE_POOL_SIZE SIZE TOKENIZER CLASSIFIER
%token DELIVERY LMTP ENABLED AGENT SECTION LUACODE RAW_MODE PROFILE_FILE COUNT
-%token VIEW IP FROM SYMBOLS
+%token VIEW IP FROM SYMBOLS CLIENT_IP
%token AUTOLEARN MIN_MARK MAX_MARK
%token SETTINGS USER_SETTINGS DOMAIN_SETTINGS SYMBOL PATH SKIP_CHECK GROW_FACTOR
@@ -999,6 +999,7 @@ viewbody:
viewcmd:
| viewip
+ | viewclientip
| viewfrom
| viewsymbols
| viewskipcheck
@@ -1016,6 +1017,18 @@ viewip:
}
;
+viewclientip:
+ CLIENT_IP EQSIGN QUOTEDSTRING {
+ if (cur_view == NULL) {
+ cur_view = init_view (cfg->cfg_pool);
+ }
+ if (!add_view_client_ip (cur_view, $3)) {
+ yyerror ("yyparse: invalid ip line in view definition: ip = '%s'", $3);
+ YYERROR;
+ }
+ }
+ ;
+
viewfrom:
FROM EQSIGN QUOTEDSTRING {
if (cur_view == NULL) {