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

Safe HaskellNone
LanguageHaskell98

Network.Email.Header.Render

Contents

Description

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

import qualified Network.Email.Header.Render as R
Synopsis

Rendering options

data RenderOptions Source #

Rendering options.

Constructors

RenderOptions 

Fields

data Encoding Source #

The encoding used for binary characters in an encoded word.

Constructors

QP

Quoted-printable encoding. Spaces are represented with underscores, and undisplayable characters are represented as hex pairs.

Base64

Base 64 encoding of all characters.

defaultRenderOptions :: RenderOptions Source #

Default rendering options, which uses a line width of 80, and indent of 2, and utf-8 quated-printable encoding.

Rendering

data Doc Source #

A formatted email header.

Instances
IsString Doc Source # 
Instance details

Defined in Network.Email.Header.Doc

Methods

fromString :: String -> Doc #

Semigroup Doc Source # 
Instance details

Defined in Network.Email.Header.Doc

Methods

(<>) :: Doc -> Doc -> Doc #

sconcat :: NonEmpty Doc -> Doc #

stimes :: Integral b => b -> Doc -> Doc #

Monoid Doc Source # 
Instance details

Defined in Network.Email.Header.Doc

Methods

mempty :: Doc #

mappend :: Doc -> Doc -> Doc #

mconcat :: [Doc] -> Doc #

renderHeaders :: RenderOptions -> [(HeaderName, Doc)] -> Headers Source #

Render a list of headers.

Origination date field

date :: ZonedTime -> (HeaderName, Doc) Source #

Create a Date: field.

Originator fields

from :: [Mailbox] -> (HeaderName, Doc) Source #

Create a From: field.

sender :: Mailbox -> (HeaderName, Doc) Source #

Create a Sender: field.

replyTo :: [Recipient] -> (HeaderName, Doc) Source #

Create a Reply-To: field.

Destination address fields

to :: [Recipient] -> (HeaderName, Doc) Source #

Create a To: field.

cc :: [Recipient] -> (HeaderName, Doc) Source #

Create a Cc: field.

bcc :: Maybe [Recipient] -> (HeaderName, Doc) Source #

Create a Bcc: field.

Identification fields

messageID :: MessageID -> (HeaderName, Doc) Source #

Create a Message-ID: field.

inReplyTo :: [MessageID] -> (HeaderName, Doc) Source #

Create a In-Reply-To: field.

references :: [MessageID] -> (HeaderName, Doc) Source #

Create a References: field.

Informational fields

subject :: Text -> (HeaderName, Doc) Source #

Create a Subject: field.

comments :: Text -> (HeaderName, Doc) Source #

Create a Comments: field.

keywords :: [Text] -> (HeaderName, Doc) Source #

Create a Keywords: field.

Resent fields

resentDate :: ZonedTime -> (HeaderName, Doc) Source #

Create a Resent-Date: field.

resentFrom :: [Mailbox] -> (HeaderName, Doc) Source #

Create a Resent-From: field.

resentSender :: Mailbox -> (HeaderName, Doc) Source #

Create a Resent-Sender: field.

resentTo :: [Recipient] -> (HeaderName, Doc) Source #

Create a Resent-To: field.

resentCc :: [Recipient] -> (HeaderName, Doc) Source #

Create a Resent-Cc: field.

resentBcc :: Maybe [Recipient] -> (HeaderName, Doc) Source #

Create a Resent-Bcc: field.

resentMessageID :: MessageID -> (HeaderName, Doc) Source #

Create a Resent-Message-ID: field.

MIME fields

mimeVersion :: Int -> Int -> (HeaderName, Doc) Source #

Create a MIME-Version: field.

contentType :: MimeType -> Parameters -> (HeaderName, Doc) Source #

Create a Content-Type: field.

contentTransferEncoding :: CI ByteString -> (HeaderName, Doc) Source #

Create a Content-Transfer-Encoding: field.

contentID :: MessageID -> (HeaderName, Doc) Source #

Create a Content-ID: field.