moduleNetwork.DomainAuth.PRD.Domain(extractDomain)whereimportNetwork.DNS(Domain)importNetwork.DomainAuth.MailimportNetwork.DomainAuth.PRD.LexerimportText.Appar.ByteStringimportqualifiedData.ByteString.Char8asBS{-|
Extract a domain from a value of a header field.
-}extractDomain::RawFieldValue->MaybeDomainextractDomainbs=parsestructuredbs>>=takeDomainwheretakeDomain=dropTail.dropWhile(/="@")dropTail[]=NothingdropTailxs=(Just.BS.pack.concat.takeWhile(/=">").tail)xs