aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2010-11-02 18:51:18 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2010-11-02 18:51:18 +0300
commit4cba5cf8133e8ecef7953416a4e540b1cf533342 (patch)
treefb3570511f6dea667b7c132117aaaeca1521ae65 /src/plugins
parent1ce9ce321a4d4076504adfbf2503364768d5124f (diff)
downloadrspamd-4cba5cf8133e8ecef7953416a4e540b1cf533342.tar.gz
rspamd-4cba5cf8133e8ecef7953416a4e540b1cf533342.zip
* Add phishing detector (now just compares <a href> with tag's data).
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/lua/phishing.lua28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/plugins/lua/phishing.lua b/src/plugins/lua/phishing.lua
new file mode 100644
index 000000000..8021a0069
--- /dev/null
+++ b/src/plugins/lua/phishing.lua
@@ -0,0 +1,28 @@
+-- Phishing detection interface for selecting phished urls and inserting corresponding symbol
+--
+--
+local symbol = 'PHISHED_URL'
+
+function phishing_cb (task)
+ local urls = task:get_urls();
+
+ if urls then
+ for _,url in ipairs(urls) do
+ if url:is_phished() then
+ task:insert_result(symbol, 1, url:get_host())
+ end
+ end
+ end
+end
+
+
+local opts = rspamd_config:get_all_opt('phishing')
+if opts then
+ if opts['symbol'] then
+ symbol = opts['symbol']
+
+ -- Register symbol's callback
+ rspamd_config:register_symbol(symbol, 1.0, 'phishing_cb')
+ end
+ -- If no symbol defined, do not register this module
+end