Mercurial > prosody-modules
comparison mod_register_dnsbl/mod_register_dnsbl.lua @ 2135:42b095dab626
mod_register_dnsbl: Fix matching pattern (Thanks Ge0rG)
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 21 Mar 2016 13:18:04 +0100 |
parents | 0890c4860f14 |
children | 2dcc3079572c |
comparison
equal
deleted
inserted
replaced
2134:bd7744df0b4a | 2135:42b095dab626 |
---|---|
1 local adns = require "net.adns"; | 1 local adns = require "net.adns"; |
2 local rbl = module:get_option_string("registration_rbl"); | 2 local rbl = module:get_option_string("registration_rbl"); |
3 | 3 |
4 local function reverse(ip, suffix) | 4 local function reverse(ip, suffix) |
5 local a,b,c,d = ip:match("^(%d+%).(%d+%).(%d+%).(%d+%)$"); | 5 local a,b,c,d = ip:match("^(%d+).(%d+).(%d+).(%d+)$"); |
6 if not a then return end | 6 if not a then return end |
7 return ("%d.%d.%d.%d.%s"):format(d,c,b,a, suffix); | 7 return ("%d.%d.%d.%d.%s"):format(d,c,b,a, suffix); |
8 end | 8 end |
9 | 9 |
10 -- TODO async | 10 -- TODO async |