Safe Haskell | None |
---|---|
Language | Haskell2010 |
Utilities for parsing an SMTP-TLRPT aggregated report, following RFC 8460. These functions also handle decompression (gzip or pkzip)
Synopsis
- tlsReportFromStrict :: ByteString -> Either String Report
- tlsReportFromLazy :: ByteString -> Either String Report
- tlsReportFromStream :: (MonadFail m, MonadIO m) => ByteStream m r -> m (Either String Report)
- tlsReportFromJson :: Value -> Either String Report
- data Report = Report {
- rpOrganizationName :: Text
- rpDateRange :: (UTCTime, UTCTime)
- rpContactInfo :: Text
- rpReportId :: Text
- rpPolicies :: [Policy]
- data Policy = Policy {}
- data PolicyDesc = PolicyDesc {
- pdPolicyType :: PolicyType
- pdPolicyString :: [Text]
- pdPolicyDomain :: Text
- pdMxHost :: [Text]
- data FailureDetails = FailureDetails {}
- type IpAddress = String
- data PolicySummary = PolicySummary {}
- data PolicyType
- data ResultType
Parsers
tlsReportFromStrict :: ByteString -> Either String Report Source #
Parse a TLSRPT report from a strict ByteString
tlsReportFromLazy :: ByteString -> Either String Report Source #
Parse a TLSRPT report from a lazy ByteString
tlsReportFromStream :: (MonadFail m, MonadIO m) => ByteStream m r -> m (Either String Report) Source #
Parse a TLSRPT report from a ByteStream
Data types
The entire SMTP-TLSRPT report
Report | |
|
Policy | |
|
data PolicyDesc Source #
Description of the evaluated policy
PolicyDesc | |
|
Instances
Eq PolicyDesc Source # | |
Defined in Data.Mail.TLSRPT.Reports (==) :: PolicyDesc -> PolicyDesc -> Bool # (/=) :: PolicyDesc -> PolicyDesc -> Bool # | |
Read PolicyDesc Source # | |
Defined in Data.Mail.TLSRPT.Reports readsPrec :: Int -> ReadS PolicyDesc # readList :: ReadS [PolicyDesc] # readPrec :: ReadPrec PolicyDesc # readListPrec :: ReadPrec [PolicyDesc] # | |
Show PolicyDesc Source # | |
Defined in Data.Mail.TLSRPT.Reports showsPrec :: Int -> PolicyDesc -> ShowS # show :: PolicyDesc -> String # showList :: [PolicyDesc] -> ShowS # | |
ToJSON PolicyDesc Source # | |
Defined in Data.Mail.TLSRPT.Reports toJSON :: PolicyDesc -> Value # toEncoding :: PolicyDesc -> Encoding # toJSONList :: [PolicyDesc] -> Value # toEncodingList :: [PolicyDesc] -> Encoding # | |
FromJSON PolicyDesc Source # | |
Defined in Data.Mail.TLSRPT.Reports parseJSON :: Value -> Parser PolicyDesc # parseJSONList :: Value -> Parser [PolicyDesc] # |
data FailureDetails Source #
FailureDetails | |
|
Instances
Eq FailureDetails Source # | |
Defined in Data.Mail.TLSRPT.Reports (==) :: FailureDetails -> FailureDetails -> Bool # (/=) :: FailureDetails -> FailureDetails -> Bool # | |
Read FailureDetails Source # | |
Defined in Data.Mail.TLSRPT.Reports readsPrec :: Int -> ReadS FailureDetails # readList :: ReadS [FailureDetails] # | |
Show FailureDetails Source # | |
Defined in Data.Mail.TLSRPT.Reports showsPrec :: Int -> FailureDetails -> ShowS # show :: FailureDetails -> String # showList :: [FailureDetails] -> ShowS # | |
ToJSON FailureDetails Source # | |
Defined in Data.Mail.TLSRPT.Reports toJSON :: FailureDetails -> Value # toEncoding :: FailureDetails -> Encoding # toJSONList :: [FailureDetails] -> Value # toEncodingList :: [FailureDetails] -> Encoding # | |
FromJSON FailureDetails Source # | |
Defined in Data.Mail.TLSRPT.Reports parseJSON :: Value -> Parser FailureDetails # parseJSONList :: Value -> Parser [FailureDetails] # |
data PolicySummary Source #
Summary of policy evaluation
PolicySummary | |
|
Instances
Eq PolicySummary Source # | |
Defined in Data.Mail.TLSRPT.Reports (==) :: PolicySummary -> PolicySummary -> Bool # (/=) :: PolicySummary -> PolicySummary -> Bool # | |
Read PolicySummary Source # | |
Defined in Data.Mail.TLSRPT.Reports readsPrec :: Int -> ReadS PolicySummary # readList :: ReadS [PolicySummary] # | |
Show PolicySummary Source # | |
Defined in Data.Mail.TLSRPT.Reports showsPrec :: Int -> PolicySummary -> ShowS # show :: PolicySummary -> String # showList :: [PolicySummary] -> ShowS # | |
ToJSON PolicySummary Source # | |
Defined in Data.Mail.TLSRPT.Reports toJSON :: PolicySummary -> Value # toEncoding :: PolicySummary -> Encoding # toJSONList :: [PolicySummary] -> Value # toEncodingList :: [PolicySummary] -> Encoding # | |
FromJSON PolicySummary Source # | |
Defined in Data.Mail.TLSRPT.Reports parseJSON :: Value -> Parser PolicySummary # parseJSONList :: Value -> Parser [PolicySummary] # |
data PolicyType Source #
NoPolicyFound | neither MTA-STS nor DANE |
TlsaPolicy | DANE policy (TLSA record) |
StsPolicy | MTA-STS policy |
Instances
Eq PolicyType Source # | |
Defined in Data.Mail.TLSRPT.Reports (==) :: PolicyType -> PolicyType -> Bool # (/=) :: PolicyType -> PolicyType -> Bool # | |
Read PolicyType Source # | |
Defined in Data.Mail.TLSRPT.Reports readsPrec :: Int -> ReadS PolicyType # readList :: ReadS [PolicyType] # readPrec :: ReadPrec PolicyType # readListPrec :: ReadPrec [PolicyType] # | |
Show PolicyType Source # | |
Defined in Data.Mail.TLSRPT.Reports showsPrec :: Int -> PolicyType -> ShowS # show :: PolicyType -> String # showList :: [PolicyType] -> ShowS # | |
ToJSON PolicyType Source # | |
Defined in Data.Mail.TLSRPT.Reports toJSON :: PolicyType -> Value # toEncoding :: PolicyType -> Encoding # toJSONList :: [PolicyType] -> Value # toEncodingList :: [PolicyType] -> Encoding # | |
FromJSON PolicyType Source # | |
Defined in Data.Mail.TLSRPT.Reports parseJSON :: Value -> Parser PolicyType # parseJSONList :: Value -> Parser [PolicyType] # |
data ResultType Source #
Failure types
StarttlsNotSupported | recipient MX did not support STARTTLS |
CertificateHostMismatch | MX hostname does not match any of the subject alternative names in the certificate |
CertificateExpired | certificate has expired |
CertificateNotTrusted | certificate is not signed by any trusted CA |
ValidationFailure | general negotiation failure (other) |
TlsaInvalid | validation error in the TLSA record |
DnssecInvalid | no valid records were returned from the recursive resolver |
DaneRequired | sending system is configured to require DANE TLSA records for all the MX hosts of the destination domain, but no DNSSEC-validated TLSA records were present for the MX host |
StsPolicyFetchError | failure to retrieve an MTA-STS policy (e.g. host unreachable) |
StsPolicyInvalid | validation error for the overall MTA-STS policy |
StsWebpkiInvalid | MTA-STS policy could not be authenticated using PKIX validation |
Instances
Eq ResultType Source # | |
Defined in Data.Mail.TLSRPT.Reports (==) :: ResultType -> ResultType -> Bool # (/=) :: ResultType -> ResultType -> Bool # | |
Read ResultType Source # | |
Defined in Data.Mail.TLSRPT.Reports readsPrec :: Int -> ReadS ResultType # readList :: ReadS [ResultType] # readPrec :: ReadPrec ResultType # readListPrec :: ReadPrec [ResultType] # | |
Show ResultType Source # | |
Defined in Data.Mail.TLSRPT.Reports showsPrec :: Int -> ResultType -> ShowS # show :: ResultType -> String # showList :: [ResultType] -> ShowS # | |
ToJSON ResultType Source # | |
Defined in Data.Mail.TLSRPT.Reports toJSON :: ResultType -> Value # toEncoding :: ResultType -> Encoding # toJSONList :: [ResultType] -> Value # toEncodingList :: [ResultType] -> Encoding # | |
FromJSON ResultType Source # | |
Defined in Data.Mail.TLSRPT.Reports parseJSON :: Value -> Parser ResultType # parseJSONList :: Value -> Parser [ResultType] # |