]> gitweb.michael.orlitzky.com - dead/harbl.git/blobdiff - src/DnsblSite.hs
Add length (max 255) checking for domains.
[dead/harbl.git] / src / DnsblSite.hs
index 24d8c96e84b72b6368c30abd4c62fa0c076fd246..bf87a89ef34516dc8bd9416f9ce63d9a0f263f8b 100644 (file)
@@ -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