diff options
author | eneq123 <you@example.com> | 2015-02-11 16:19:02 +0300 |
---|---|---|
committer | eneq123 <you@example.com> | 2015-02-11 16:19:02 +0300 |
commit | ac0d8c035e05209b320d6a5020211fdee84410ed (patch) | |
tree | 7ea4e40125be04e6160bc04d49062060284447c2 /src/plugins/lua/ratelimit.lua | |
parent | cc473f6816c618ed1dcb05a3bf33037f49fb12cf (diff) | |
download | rspamd-ac0d8c035e05209b320d6a5020211fdee84410ed.tar.gz rspamd-ac0d8c035e05209b320d6a5020211fdee84410ed.zip |
set empty <> user or addr for msgs without FROM (the MAIL FROM:<> is RFC 821 defined error message transport)
Diffstat (limited to 'src/plugins/lua/ratelimit.lua')
-rw-r--r-- | src/plugins/lua/ratelimit.lua | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/plugins/lua/ratelimit.lua b/src/plugins/lua/ratelimit.lua index afb88b4e7..4f0d908db 100644 --- a/src/plugins/lua/ratelimit.lua +++ b/src/plugins/lua/ratelimit.lua @@ -179,9 +179,11 @@ local function rate_test_set(task, func) end -- Parse from local from = task:get_from() - local from_user = '' + local from_user = '<>' + local from_addr = '<>' if from then from_user = from[1]['user'] + from_addr = from[1]['addr'] end -- Get user (authuser) local auser = task:get_user() @@ -189,7 +191,7 @@ local function rate_test_set(task, func) func(task, settings['user'], make_rate_key (auser, '<auth>', nil)) end - if not from_user or not rcpts_user[1] then + if not rcpts_user[1] then -- Nothing to check return end @@ -207,7 +209,7 @@ local function rate_test_set(task, func) func(task, settings['to'], make_rate_key (nil, r['addr'], nil)) if ip then func(task, settings['to_ip'], make_rate_key (nil, r['addr'], ip)) - func(task, settings['to_ip_from'], make_rate_key (from[1]['addr'], r['addr'], ip)) + func(task, settings['to_ip_from'], make_rate_key (from_addr, r['addr'], ip)) end end end |