email-header-0.4.1: Parsing and rendering of email and MIME headers

Safe HaskellNone
LanguageHaskell98

Network.Email.Header.Read

Contents

Description

Reading common header fields. This module is intended to be imported qualified:

import qualified Network.Email.Header.Read as H
Synopsis

Parsing

field :: MonadThrow m => HeaderName -> Parser a -> Headers -> m a Source #

Lookup and parse a header with a parser.

structuredField :: MonadThrow m => HeaderName -> Parser a -> Headers -> m a Source #

Lookup and parse a structured header with a parser. This skips initial comments and folding white space, and ensures that the entire body is consumed by the parser.

Origination date field

date :: MonadThrow m => Headers -> m ZonedTime Source #

Get the value of the Date: field.

Originator fields

from :: MonadThrow m => Headers -> m [Mailbox] Source #

Get the value of the From: field.

sender :: MonadThrow m => Headers -> m Mailbox Source #

Get the value of the Sender: field.

replyTo :: MonadThrow m => Headers -> m [Recipient] Source #

Get the value of the Reply-To: field.

Destination address fields

to :: MonadThrow m => Headers -> m [Recipient] Source #

Get the value of the To: field.

cc :: MonadThrow m => Headers -> m [Recipient] Source #

Get the value of the Cc: field.

bcc :: MonadThrow m => Headers -> m (Maybe [Recipient]) Source #

Get the value of the Bcc: field.

Identification fields

messageID :: MonadThrow m => Headers -> m MessageID Source #

Get the value of the Message-ID: field.

inReplyTo :: MonadThrow m => Headers -> m [MessageID] Source #

Get the value of the In-Reply-To: field.

references :: MonadThrow m => Headers -> m [MessageID] Source #

Get the value of the References: field.

Informational fields

subject :: MonadThrow m => Headers -> m Text Source #

Get the value of the Subject: field.

comments :: MonadThrow m => Headers -> m Text Source #

Get the value of the Comments: field.

keywords :: MonadThrow m => Headers -> m [Text] Source #

Get the value of the Keywords: field.

Resent fields

resentDate :: MonadThrow m => Headers -> m ZonedTime Source #

Get the value of the Resent-Date: field.

resentFrom :: MonadThrow m => Headers -> m [Mailbox] Source #

Get the value of the Resent-From: field.

resentSender :: MonadThrow m => Headers -> m Mailbox Source #

Get the value of the Resent-Sender: field.

resentTo :: MonadThrow m => Headers -> m [Recipient] Source #

Get the value of the Resent-To: field.

resentCc :: MonadThrow m => Headers -> m [Recipient] Source #

Get the value of the Resent-Cc: field.

resentBcc :: MonadThrow m => Headers -> m (Maybe [Recipient]) Source #

Get the value of the Resent-Bcc: field.

resentMessageID :: MonadThrow m => Headers -> m MessageID Source #

Get the value of the Resent-Message-ID: field.

MIME fields

mimeVersion :: MonadThrow m => Headers -> m (Int, Int) Source #

Get the value of the MIME-Version: field.

contentType :: MonadThrow m => Headers -> m (MimeType, Parameters) Source #

Get the value of the Content-Type: field.

contentTransferEncoding :: MonadThrow m => Headers -> m (CI ByteString) Source #

Get the value of the Content-Transfer-Encoding: field.

contentID :: MonadThrow m => Headers -> m MessageID Source #

Get the value of the Content-ID: field.