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