mbox-0.1: Read and write standard mailbox files.

Stability | experimental
Maintainer | gershomb@gmail.com
Safe Haskell | None

Data.MBox

Description

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

Synopsis

- type MBox = [Message]
- data Message = Message {
  - fromLine :: String
  - headers :: [Header]
  - body :: String
  }
- type Header = (String, String)
- parseMBox :: String -> MBox
- parseForward :: Message -> Message
- parseDateHeader :: String -> Maybe UTCTime
- showMessage :: Message -> String
- showMBox :: MBox -> String

# Documentation

type MBox = [Message]Source

data Message Source

Constructors

Message |

Fields

fromLine :: String
headers :: [Header]
body :: String

Instances

Read Message |
Show Message |

type Header = (String, String)Source

parseMBox :: String -> MBox Source

Reads a string as an mbox file.

parseForward :: Message -> Message Source

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

parseDateHeader :: String -> Maybe UTCTime Source

Reads a date header as a UTCTime

showMessage :: Message -> String Source

Renders an individual message into a String.

showMBox :: MBox -> String Source

Renders an MBox into a String