lua_logger_err (lua_State * L)
{
const gchar *msg;
- msg = luaL_checkstring (L, 2);
+ msg = luaL_checkstring (L, 1);
lua_common_log (G_LOG_LEVEL_CRITICAL, L, msg);
return 1;
}
lua_logger_warn (lua_State * L)
{
const gchar *msg;
- msg = luaL_checkstring (L, 2);
+ msg = luaL_checkstring (L, 1);
lua_common_log (G_LOG_LEVEL_WARNING, L, msg);
return 1;
}
lua_logger_info (lua_State * L)
{
const gchar *msg;
- msg = luaL_checkstring (L, 2);
+ msg = luaL_checkstring (L, 1);
lua_common_log (G_LOG_LEVEL_INFO, L, msg);
return 1;
}
lua_logger_debug (lua_State * L)
{
const gchar *msg;
- msg = luaL_checkstring (L, 2);
+ msg = luaL_checkstring (L, 1);
lua_common_log (G_LOG_LEVEL_DEBUG, L, msg);
return 1;
}
for _,param in ipairs(params) do
local _,_,name,value = string.find(param, '([a-zA-Z_0-9]+)%s*=%s*(.+)')
if not name or not value then
- rspamd_logger:err('invalid rule: '..param)
+ rspamd_logger.err('invalid rule: '..param)
return nil
end
if name == 'dnsbl' then
newrule['domain_only'] = true
end
else
- rspamd_logger:err('invalid rule option: '.. name)
+ rspamd_logger.err('invalid rule option: '.. name)
return nil
end
end
if not newrule['symbol'] or (not newrule['map'] and not newrule['dnsbl']) then
- rspamd_logger:err('incomplete rule')
+ rspamd_logger.err('incomplete rule')
return nil
end
table.insert(rules, newrule)
if rspamd_config:get_api_version() >= 2 then
rspamd_config:register_module_option('emails', 'rule', 'string')
else
- rspamd_logger:err('Invalid rspamd version for this plugin')
+ rspamd_logger.err('Invalid rspamd version for this plugin')
end
end
local params = split(value, ',')
local rule = add_emails_rule (params)
if not rule then
- rspamd_logger:err('cannot add rule: "'..value..'"')
+ rspamd_logger.err('cannot add rule: "'..value..'"')
else
if type(rspamd_config.get_api_version) ~= 'nil' then
rspamd_config:register_virtual_symbol(rule['symbol'], 1.0)
local params = split(strrules, ',')
local rule = add_emails_rule (params)
if not rule then
- rspamd_logger:err('cannot add rule: "'..strrules..'"')
+ rspamd_logger.err('cannot add rule: "'..strrules..'"')
else
if type(rspamd_config.get_api_version) ~= 'nil' then
rspamd_config:register_virtual_symbol(rule['symbol'], 1.0)