X-Git-Url: http://gitweb.michael.orlitzky.com/?p=dead%2Fharbl.git;a=blobdiff_plain;f=src%2FDnsblSite.hs;h=bf87a89ef34516dc8bd9416f9ce63d9a0f263f8b;hp=24d8c96e84b72b6368c30abd4c62fa0c076fd246;hb=e0a24d8248c2c6c8e1fbc482542945a33310e390;hpb=6f177422a389b2361e4f66280d8f4021774dd475 diff --git a/src/DnsblSite.hs b/src/DnsblSite.hs index 24d8c96..bf87a89 100644 --- a/src/DnsblSite.hs +++ b/src/DnsblSite.hs @@ -4,10 +4,11 @@ -- -- postscreen_dnsbl_sites = bl.mailspike.net=127.0.0.[2;10;11]*2, ... -- --- Here, the 'Domain' is \"bl.mailspike.net\", the return code --- pattern is \"127.0.0.[2;10;11]\", and the weight is \"2". +-- Here, the blacklist (a 'UserDomain') is \"bl.mailspike.net\", the +-- return code pattern is \"127.0.0.[2;10;11]\", and the weight is +-- \"2". -- -module DnsblSite +module DnsblSite () where import Text.Parsec ( @@ -25,7 +26,7 @@ import Text.Parsec ( import Text.Parsec.String ( Parser ) import Text.Read ( readMaybe ) - +import Domain ( UserDomain ) import IPv4Pattern ( IPv4Pattern ) newtype Weight = Weight Int deriving (Eq, Show) @@ -82,7 +83,5 @@ weight = try parse_weight <|> (eof >> return (Weight 1)) Nothing -> unexpected "weight: readMaybe failed on a sequence of digits!" Just k -> return $ Weight (if sign == '-' then negate k else k) -newtype Domain = Domain String - -data DnsblSite = DnsblSite Domain IPv4Pattern Weight +data DnsblSite = DnsblSite UserDomain IPv4Pattern Weight