--- and validating it against a simple regex.
-validate_syntax :: Address -> Bool
-validate_syntax address =
- (validate_length address) && (validate_regex address)
-
-
--- HUnit tests
+-- and validating it against either a simple regex or RFC5322,
+-- depending on the --rfc5322 flag.
+--
+validate_syntax :: Bool -> Address -> Bool
+validate_syntax rfc5322 address =
+ (validate_length address) &&
+ if rfc5322
+ then isValid address
+ else validate_regex address
+
+
+-- * Tasty Tests