From c2a4fda0e3e7916a5495322d551b733c0e2d171e Mon Sep 17 00:00:00 2001 From: Andrew Lewis Date: Thu, 12 Feb 2015 17:11:58 +0200 Subject: [PATCH] Rename user to exclude_users and invert logic --- conf/modules.conf | 2 +- doc/markdown/modules/rbl.md | 4 ++-- src/plugins/lua/rbl.lua | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/conf/modules.conf b/conf/modules.conf index a72eb1818..de125866a 100644 --- a/conf/modules.conf +++ b/conf/modules.conf @@ -86,7 +86,7 @@ rbl { default_from = true; default_received = false; - default_user = false; + default_exclude_users = true; rbls { diff --git a/doc/markdown/modules/rbl.md b/doc/markdown/modules/rbl.md index aba496f24..41854c542 100644 --- a/doc/markdown/modules/rbl.md +++ b/doc/markdown/modules/rbl.md @@ -49,9 +49,9 @@ Use this RBL to test parameters sent for HELO/EHLO at SMTP time. If set to false, do not yield a result unless the response received from the RBL is defined in its related returncodes {} subsection, else return the default symbol for the RBL. -- default_user (true) +- default_exclude_users (false) -If set to false, do not use this RBL if the message sender is authenticated. +If set to true, do not use this RBL if the message sender is authenticated. RBL-specific subsection is structured as follows: diff --git a/src/plugins/lua/rbl.lua b/src/plugins/lua/rbl.lua index 9aa0d15cf..f89055f26 100644 --- a/src/plugins/lua/rbl.lua +++ b/src/plugins/lua/rbl.lua @@ -63,7 +63,7 @@ local function rbl_cb (task) for k,rbl in pairs(rbls) do (function() - if rbl['user'] == false then + if rbl['exclude_users'] then if not havegot['user'] and not notgot['user'] then havegot['user'] = task:get_user() if havegot['user'] == nil then @@ -167,7 +167,7 @@ if type(rspamd_config.get_api_version) ~= 'nil' then rspamd_config:register_module_option('rbl', 'default_rdns', 'string') rspamd_config:register_module_option('rbl', 'default_helo', 'string') rspamd_config:register_module_option('rbl', 'default_unknown', 'string') - rspamd_config:register_module_option('rbl', 'default_user', 'string') + rspamd_config:register_module_option('rbl', 'default_exclude_users', 'string') end end @@ -197,11 +197,11 @@ end if(opts['default_helo'] == nil) then opts['default_helo'] = false end -if(opts['default_user'] == nil) then - opts['default_user'] = true +if(opts['default_exclude_users'] == nil) then + opts['default_exclude_users'] = false end for key,rbl in pairs(opts['rbls']) do - local o = { "ipv4", "ipv6", "from", "received", "unknown", "rdns", "helo", "user" } + local o = { "ipv4", "ipv6", "from", "received", "unknown", "rdns", "helo", "exclude_users" } for i=1,table.maxn(o) do if(rbl[o[i]] == nil) then rbl[o[i]] = opts['default_' .. o[i]] -- 2.39.5