| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Data.Mail.TLSRPT.Reports
Contents
Description
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
Constructors
| Report | |
Fields
| |
Constructors
| Policy | |
Fields
| |
data PolicyDesc Source #
Description of the evaluated policy
Constructors
| PolicyDesc | |
Fields
| |
Instances
| Eq PolicyDesc Source # | |
Defined in Data.Mail.TLSRPT.Reports | |
| Read PolicyDesc Source # | |
Defined in Data.Mail.TLSRPT.Reports Methods readsPrec :: Int -> ReadS PolicyDesc # readList :: ReadS [PolicyDesc] # readPrec :: ReadPrec PolicyDesc # readListPrec :: ReadPrec [PolicyDesc] # | |
| Show PolicyDesc Source # | |
Defined in Data.Mail.TLSRPT.Reports Methods showsPrec :: Int -> PolicyDesc -> ShowS # show :: PolicyDesc -> String # showList :: [PolicyDesc] -> ShowS # | |
| ToJSON PolicyDesc Source # | |
Defined in Data.Mail.TLSRPT.Reports Methods toJSON :: PolicyDesc -> Value # toEncoding :: PolicyDesc -> Encoding # toJSONList :: [PolicyDesc] -> Value # toEncodingList :: [PolicyDesc] -> Encoding # | |
| FromJSON PolicyDesc Source # | |
Defined in Data.Mail.TLSRPT.Reports | |
data FailureDetails Source #
Constructors
| FailureDetails | |
Fields
| |
Instances
| Eq FailureDetails Source # | |
Defined in Data.Mail.TLSRPT.Reports Methods (==) :: FailureDetails -> FailureDetails -> Bool # (/=) :: FailureDetails -> FailureDetails -> Bool # | |
| Read FailureDetails Source # | |
Defined in Data.Mail.TLSRPT.Reports Methods readsPrec :: Int -> ReadS FailureDetails # readList :: ReadS [FailureDetails] # | |
| Show FailureDetails Source # | |
Defined in Data.Mail.TLSRPT.Reports Methods showsPrec :: Int -> FailureDetails -> ShowS # show :: FailureDetails -> String # showList :: [FailureDetails] -> ShowS # | |
| ToJSON FailureDetails Source # | |
Defined in Data.Mail.TLSRPT.Reports Methods toJSON :: FailureDetails -> Value # toEncoding :: FailureDetails -> Encoding # toJSONList :: [FailureDetails] -> Value # toEncodingList :: [FailureDetails] -> Encoding # | |
| FromJSON FailureDetails Source # | |
Defined in Data.Mail.TLSRPT.Reports Methods parseJSON :: Value -> Parser FailureDetails # parseJSONList :: Value -> Parser [FailureDetails] # | |
data PolicySummary Source #
Summary of policy evaluation
Constructors
| PolicySummary | |
Fields
| |
Instances
| Eq PolicySummary Source # | |
Defined in Data.Mail.TLSRPT.Reports Methods (==) :: PolicySummary -> PolicySummary -> Bool # (/=) :: PolicySummary -> PolicySummary -> Bool # | |
| Read PolicySummary Source # | |
Defined in Data.Mail.TLSRPT.Reports Methods readsPrec :: Int -> ReadS PolicySummary # readList :: ReadS [PolicySummary] # | |
| Show PolicySummary Source # | |
Defined in Data.Mail.TLSRPT.Reports Methods showsPrec :: Int -> PolicySummary -> ShowS # show :: PolicySummary -> String # showList :: [PolicySummary] -> ShowS # | |
| ToJSON PolicySummary Source # | |
Defined in Data.Mail.TLSRPT.Reports Methods toJSON :: PolicySummary -> Value # toEncoding :: PolicySummary -> Encoding # toJSONList :: [PolicySummary] -> Value # toEncodingList :: [PolicySummary] -> Encoding # | |
| FromJSON PolicySummary Source # | |
Defined in Data.Mail.TLSRPT.Reports Methods parseJSON :: Value -> Parser PolicySummary # parseJSONList :: Value -> Parser [PolicySummary] # | |
data PolicyType Source #
Constructors
| 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 | |
| Read PolicyType Source # | |
Defined in Data.Mail.TLSRPT.Reports Methods readsPrec :: Int -> ReadS PolicyType # readList :: ReadS [PolicyType] # readPrec :: ReadPrec PolicyType # readListPrec :: ReadPrec [PolicyType] # | |
| Show PolicyType Source # | |
Defined in Data.Mail.TLSRPT.Reports Methods showsPrec :: Int -> PolicyType -> ShowS # show :: PolicyType -> String # showList :: [PolicyType] -> ShowS # | |
| ToJSON PolicyType Source # | |
Defined in Data.Mail.TLSRPT.Reports Methods toJSON :: PolicyType -> Value # toEncoding :: PolicyType -> Encoding # toJSONList :: [PolicyType] -> Value # toEncodingList :: [PolicyType] -> Encoding # | |
| FromJSON PolicyType Source # | |
Defined in Data.Mail.TLSRPT.Reports | |
data ResultType Source #
Failure types
Constructors
| 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 | |
| Read ResultType Source # | |
Defined in Data.Mail.TLSRPT.Reports Methods readsPrec :: Int -> ReadS ResultType # readList :: ReadS [ResultType] # readPrec :: ReadPrec ResultType # readListPrec :: ReadPrec [ResultType] # | |
| Show ResultType Source # | |
Defined in Data.Mail.TLSRPT.Reports Methods showsPrec :: Int -> ResultType -> ShowS # show :: ResultType -> String # showList :: [ResultType] -> ShowS # | |
| ToJSON ResultType Source # | |
Defined in Data.Mail.TLSRPT.Reports Methods toJSON :: ResultType -> Value # toEncoding :: ResultType -> Encoding # toJSONList :: [ResultType] -> Value # toEncodingList :: [ResultType] -> Encoding # | |
| FromJSON ResultType Source # | |
Defined in Data.Mail.TLSRPT.Reports | |