-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | An email parser that will parse everything -- -- An email parser that will parse everything @package emailparse @version 0.2.0.8 module Network.Mail.Parse.Decoders.FormatDecoders qpDec :: ByteString -> Either (ByteString, ByteString) ByteString decodeB64 :: ByteString -> Either (ByteString, ByteString) ByteString module Network.Mail.Parse.Types type UID = Integer type ErrorMessage = Text data EmailMessage EmailMessage :: [Header] -> ![EmailBody] -> EmailMessage [emailHeaders] :: EmailMessage -> [Header] [emailBodies] :: EmailMessage -> ![EmailBody] type MessageId = Text data Header Date :: ZonedTime -> Header From :: EmailAddress -> Header ReplyTo :: EmailAddress -> Header To :: [EmailAddress] -> Header CC :: [EmailAddress] -> Header BCC :: [EmailAddress] -> Header MessageId :: MessageId -> Header InReplyTo :: MessageId -> Header References :: [MessageId] -> Header Subject :: Text -> Header Comments :: Text -> Header Keywords :: [Text] -> Header Header :: !Text -> !Text -> Header [headerName] :: Header -> !Text [headerContents] :: Header -> !Text data EmailAddress EmailAddress :: !Text -> Maybe Text -> EmailAddress [emailAddress] :: EmailAddress -> !Text [emailLabel] :: EmailAddress -> Maybe Text -- | An email body contains the contents of an email part up until the -- boundary marker. data EmailBody -- | Body of a MIME message part. Contains headers MessageBody :: EmailMessage -> EmailBody -- | If the message contained no MIME information, it's probably just some -- text. Best guess decoding into UTF-8 is applied TextBody :: !Text -> EmailBody -- | Attachment is part of a MIME message, but a rather special one. It's -- decoded from whatever the transfer encoding was applied and left as a -- raw sollection of bytes for your enjoyment Attachment :: ![Header] -> !Text -> Maybe ByteString -> Maybe Text -> EmailBody [attachmentHeaders] :: EmailBody -> ![Header] [attachmentName] :: EmailBody -> !Text [attachmentBody] :: EmailBody -> Maybe ByteString -- | Location of the actual filename on disk [storageFilename] :: EmailBody -> Maybe Text defaultZT :: ZonedTime instance GHC.Generics.Generic Network.Mail.Parse.Types.EmailMessage instance GHC.Classes.Eq Network.Mail.Parse.Types.EmailMessage instance GHC.Show.Show Network.Mail.Parse.Types.EmailMessage instance GHC.Generics.Generic Network.Mail.Parse.Types.EmailBody instance GHC.Show.Show Network.Mail.Parse.Types.EmailBody instance GHC.Classes.Eq Network.Mail.Parse.Types.EmailBody instance GHC.Generics.Generic Network.Mail.Parse.Types.Header instance GHC.Show.Show Network.Mail.Parse.Types.Header instance GHC.Classes.Eq Network.Mail.Parse.Types.Header instance GHC.Generics.Generic Network.Mail.Parse.Types.EmailAddress instance GHC.Show.Show Network.Mail.Parse.Types.EmailAddress instance GHC.Classes.Eq Network.Mail.Parse.Types.EmailAddress instance GHC.Classes.Eq Data.Time.LocalTime.Internal.ZonedTime.ZonedTime module Network.Mail.Parse.Utils -- | If the previous character was a carriage return and the current is a -- line feed, stop parsing hadCRLF :: Word8 -> Word8 -> Maybe Word8 -- | Consumes a line until CRLF is hit consumeTillEndLine :: Parser ByteString -- | Can a given character be regarded as a whitespace? isWhitespace :: Word8 -> Bool -- | If the next line is a part of a previous header, parse it. Fail -- otherwise isConsequentHeaderLine :: Parser ByteString -- | Remove a MIME header comment and return a header without the comment commentRemover :: Text -> Text -- | Given a header name, it will try to locate it in a list of headers, -- fail if it's not there findHeader :: Text -> [Header] -> Either ErrorMessage Header eitherToMaybe :: Either a b -> Maybe b module Network.Mail.Parse.Parsers.Utils -- | Check if the given headers represent an attachment discoverAttachment :: [Header] -> Maybe Text -- | When provided with a content-disposition header, checks if it -- represents an attachment. If it does it returns it's name, otherwise -- Nothing findAttachmentName :: Text -> Maybe Text -- | Decide if the header contains a valid MIME info isMIME :: Header -> Bool module Network.Mail.Parse.Parsers.Multipart parseMultipart :: ByteString -> Parser [ByteString] module Network.Mail.Parse.Decoders.BodyDecoder -- | Remove transfer encoding from a string of bytes transferDecode :: ByteString -> Text -> Either (ByteString, ByteString) ByteString -- | Transform a string of bytes with a given encoding into a UTF-8 string -- of bytes encodingToUtf :: ByteString -> Text -> Text -- | Reverse content transfer encoding applied to the body. decodeBody :: [Header] -> ByteString -> ByteString -- | Given a set of headers it tries to figure out the transfer encoding -- and charset and normalizes the contents into an UTF-8 encoded Text. -- -- It will recover from errors, wherever possible decodeTextBody :: [Header] -> ByteString -> Text module Network.Mail.Parse.Parsers.HeaderFields -- | Parses an email in any format emailAddressParser :: Parser EmailAddress -- | Parses a list of email addresses emailAddressListParser :: Parser [EmailAddress] -- | Parse a time from a header containing time parseTime :: Text -> Either ErrorMessage ZonedTime parseEmailAddress :: Text -> Either ErrorMessage EmailAddress parseEmailAddressList :: Text -> Either ErrorMessage [EmailAddress] parseText :: Text -> Either ErrorMessage Text parseTextList :: Text -> Text -> Either ErrorMessage [Text] parseMessageId :: Text -> Either ErrorMessage MessageId module Network.Mail.Parse.Parsers.Header -- | Parses a header headerParser :: Parser Header -- | Concatenate lines insterting whitespace between them. The whitespace -- needs to be inserted as these lines come from parser that eats up the -- whitespace cleanupLines :: [ByteString] -> ByteString module Network.Mail.Parse.Parsers.Message -- | Parses a single message messageParser :: Maybe [Header] -> Maybe [Header] -> Parser (Either ErrorMessage EmailMessage) module Network.Mail.Parse -- | Parses a single message of any mimetype parseMessage :: ByteString -> Either ErrorMessage EmailMessage