]> source.dussan.org Git - rspamd.git/commitdiff
Fixed bug in whitelist plugin with getting from address
authorSimon Pin <simon.pin@mail.com>
Wed, 4 Dec 2013 12:32:47 +0000 (12:32 +0000)
committerSimon Pin <simon.pin@mail.com>
Wed, 4 Dec 2013 12:32:47 +0000 (12:32 +0000)
src/plugins/lua/whitelist.lua

index 0f4c41f852660c78420cf5636dc5eddeadd5ae9c..7a196ec89ef35c6c9d6f4794dae1ce7c8a2f95fe 100644 (file)
@@ -22,10 +22,14 @@ function check_whitelist (task)
                -- check client's from domain
                local from = task:get_from()
                if from then
-                       local _,_,domain = string.find(from, '@(.+)>?$')
-                       local key = h:get_key(domain)
-                       if key then
-                               task:insert_result(symbol_from, 1)
+                       local from_addr = from[1]['addr']
+
+                       if from_addr then
+                               local _,_,domain = string.find(from_addr, '@(.+)>?$')
+                               local key = h:get_key(domain)
+                               if key then
+                                       task:insert_result(symbol_from, 1)
+                               end
                        end
                end
        end