diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-03-28 17:54:14 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-03-28 17:54:14 +0000 |
commit | 3e71c8b6ddaa774907692eb645f30a7df56cec17 (patch) | |
tree | 58125a650fa036403adde068203a5417c4cba65b | |
parent | 1771fb92d2d493ff003d82b07a394aaafe45580b (diff) | |
parent | eba9e34f731a928caf6fbce3b303e5becf1592bf (diff) | |
download | rspamd-3e71c8b6ddaa774907692eb645f30a7df56cec17.tar.gz rspamd-3e71c8b6ddaa774907692eb645f30a7df56cec17.zip |
Merge pull request #55 from AlexeySa/patch-4
Hfilter: Fix for IPv6 support
-rw-r--r-- | conf/lua/hfilter.lua | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/conf/lua/hfilter.lua b/conf/lua/hfilter.lua index 60a5cd722..775b59e04 100644 --- a/conf/lua/hfilter.lua +++ b/conf/lua/hfilter.lua @@ -37,12 +37,15 @@ local checks_hellohost = { } local checks_hello = { -['localhost$'] = 5, ['\\.hfilter\\.ru'] = 5, ['^\\[*84\\.47\\.176\\.(70|71)'] = 5, ['^\\[*81\\.26\\.148\\.(66|67|68|69|70|71|72|73|74|75|76|77|79)'] = 5, +['localhost$'] = 5, ['^(dsl)?(device|speedtouch)\\.lan$'] = 5, ['\\.(lan|local|home|localdomain|intra|in-addr.arpa|priv|online|user|veloxzon)$'] = 5, -['^\\[*127\\.'] = 5, ['^\\[*10\\.'] = 5, ['^\\[*172\\.16\\.'] = 5, ['^\\[*192\\.168\\.'] = 5, ---bareip -['^\\[*\\d+[x.-]\\d+[x.-]\\d+[x.-]\\d+\\]*$'] = 4 +['^\\[*0\\.'] = 5, ['^\\[*::1\\]*'] = 5, --loopback ipv4, ipv6 +['^\\[*127\\.'] = 5, ['^\\[*10\\.'] = 5, ['^\\[*172\\.16\\.'] = 5, ['^\\[*192\\.168\\.'] = 5, --local ipv4 +['^\\[*fe[89ab][0-9a-f]::'] = 5, ['^\\[*fe[cdf][0-9a-f]:'] = 5, --local ipv6 (fe80:: - febf::, fec0:: - feff::) +['^\\[*2001:db8::'] = 5, --reserved RFC 3849 for ipv6 +['^\\[*fc00::'] = 5, ['^\\[*ffxx::'] = 5, --unicast, multicast ipv6 +['^\\[*\\d+[x.-]\\d+[x.-]\\d+[x.-]\\d+\\]*$'] = 4, ['^\\[*\\d+:'] = 4 --bareip ipv4, ipv6 } local function trim1(s) @@ -160,7 +163,7 @@ local function hfilter(task) local rip = task:get_from_ip() if rip then ip = rip:to_string() - if ip and ip == '0.0.0.0' then + if ip and (ip == '0.0.0.0' or ip == '::') then ip = false end end |