attomail

Safe HaskellNone
LanguageHaskell2010

DeliveryHeaders

Contents

Description

Add delivery headers to an email message.

Synopsis

Data types

newtype Addr Source #

just a newtype to distinguish address from other strings.

Constructors

Addr 

Fields

Instances

Eq Addr Source # 

Methods

(==) :: Addr -> Addr -> Bool #

(/=) :: Addr -> Addr -> Bool #

Show Addr Source # 

Methods

showsPrec :: Int -> Addr -> ShowS #

show :: Addr -> String #

showList :: [Addr] -> ShowS #

data MailTime Source #

... actually, any string at all is considered a valid "time" string we can use.

header utilities

isDate :: Field -> Bool Source #

is this a Date field?

isFrom :: Field -> Bool Source #

Is this a From field?

makeReceived :: MailTime -> Maybe Addr -> Addr -> String Source #

make up the "Received:" header, given a time, a possible "from" address, and a "to" address.

addHeaders :: MailTime -> String -> Maybe Addr -> Addr -> Either String String Source #

add minimal headers: a "Received:" header, a "Date:" header if we haven't already been given one, a "From:" field if we haven't already been given one.

string utilities

rstrip :: String -> String Source #

strip whitespace from right-hand end

time utilities

getMailTime :: IO MailTime Source #

get the unix time