mbox-0.3.4: Read and write standard mailbox files.

Copyright(c) Gershom Bazerman 2009; ported to Text by Alexander Jerneck 2012
LicenseBSD 3 Clause
Maintainergershomb@gmail.com
Stabilityexperimental
Safe HaskellSafe
LanguageHaskell98

Data.MBox

Description

Reads and writes mboxrd files as per http://www.qmail.org/man/man5/mbox.html.

This module uses Lazy Text pervasively, and should be able to operate as a streaming parser. That is to say, given a lazy stream of Text, and a streaming processing function, you should be able to analyze large mbox files in constant space.

Synopsis

Documentation

type MBox = [Message] Source #

type Header = (Text, Text) Source #

parseMBox :: Text -> MBox Source #

Parses Text as an mbox file.

parseForward :: Message -> Message Source #

Attempts to retrieve the contents of a forwarded message from an enclosing message.

parseDateHeader :: Text -> Maybe UTCTime Source #

Reads a date header as a UTCTime

showMessage :: Message -> Text Source #

Renders an individual message into Text.

showMBox :: MBox -> Text Source #

Renders an MBox into Text

getHeader :: (Header -> Bool) -> Message -> [Text] Source #

Return the values of headers for which predicate is True

isID :: Header -> Bool Source #

Return True if header is a Message-ID header.

isDate :: Header -> Bool Source #

Return True if header is a Date header.