Mbox
Read and write mbox files. Works well in combination with elixir-mail.
Elixir fork of go-mbox.
Installation
def deps do
[
# Get from hex
{:mbox, "~> 0.1.0"}
# Or from github
{:mbox, github: "konimarti/elixir-mbox"}
]
endUsage
Parse mbox files
{:ok, body} = File.read("path/to/mboxfile")
messages = Mbox.Parser.parse(body)Render mbox files
output = Mbox.Renderer.render(messages)In combination with elixir-mail
{:ok, body} = File.read("path/to/mboxfile")
mails =
body
|> Mbox.Parser.parse
|> Enum.map(&Mail.Parsers.RFC2822.parse/1)