email-header-0.2.0: 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 :: HeaderName -> Parser a -> Headers -> Maybe a Source

Lookup and parse a header with a parser.

structuredField :: HeaderName -> Parser a -> Headers -> Maybe 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 :: Headers -> Maybe ZonedTime Source

Get the value of the Date: field.

Originator fields

from :: Headers -> Maybe [Mailbox] Source

Get the value of the From: field.

sender :: Headers -> Maybe Mailbox Source

Get the value of the Sender: field.

replyTo :: Headers -> Maybe [Recipient] Source

Get the value of the Reply-To: field.

Destination address fields

to :: Headers -> Maybe [Recipient] Source

Get the value of the To: field.

cc :: Headers -> Maybe [Recipient] Source

Get the value of the Cc: field.

bcc :: Headers -> Maybe (Maybe [Recipient]) Source

Get the value of the Bcc: field.

Identification fields

messageID :: Headers -> Maybe MessageID Source

Get the value of the Message-ID: field.

inReplyTo :: Headers -> Maybe [MessageID] Source

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

references :: Headers -> Maybe [MessageID] Source

Get the value of the References: field.

Informational fields

subject :: Headers -> Maybe Text Source

Get the value of the Subject: field.

comments :: Headers -> Maybe Text Source

Get the value of the Comments: field.

keywords :: Headers -> Maybe [Text] Source

Get the value of the Keywords: field.

Resent fields

resentDate :: Headers -> Maybe ZonedTime Source

Get the value of the Resent-Date: field.

resentFrom :: Headers -> Maybe [Mailbox] Source

Get the value of the Resent-From: field.

resentSender :: Headers -> Maybe Mailbox Source

Get the value of the Resent-Sender: field.

resentTo :: Headers -> Maybe [Recipient] Source

Get the value of the Resent-To: field.

resentCc :: Headers -> Maybe [Recipient] Source

Get the value of the Resent-Cc: field.

resentBcc :: Headers -> Maybe (Maybe [Recipient]) Source

Get the value of the Resent-Bcc: field.

resentMessageID :: Headers -> Maybe MessageID Source

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

MIME fields

mimeVersion :: Headers -> Maybe (Int, Int) Source

Get the value of the MIME-Version: field.

contentType :: Headers -> Maybe (MimeType, Parameters) Source

Get the value of the Content-Type: field.

contentTransferEncoding :: Headers -> Maybe (CI ByteString) Source

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

contentID :: Headers -> Maybe MessageID Source

Get the value of the Content-ID: field.