https://github.com/konimarti/elixir-mbox
Read and write MBOX files in Elixir
https://github.com/konimarti/elixir-mbox
mail mbox parser reader writer
Last synced: 4 months ago
JSON representation
Read and write MBOX files in Elixir
- Host: GitHub
- URL: https://github.com/konimarti/elixir-mbox
- Owner: konimarti
- License: mit
- Created: 2022-10-24T15:09:50.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-10-30T20:45:42.000Z (over 3 years ago)
- Last Synced: 2025-12-02T03:20:43.472Z (7 months ago)
- Topics: mail, mbox, parser, reader, writer
- Language: Elixir
- Homepage:
- Size: 32.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Mbox
Read and write mbox files. Works well in combination with
[elixir-mail](http://github.com/DockYard/elixir-mail).
Elixir fork of [go-mbox](http://www.github.com/emersion/go-mbox).
## Installation
```elixir
def deps do
[
# Get from hex
{:mbox, "~> 0.1.0"}
# Or from github
{:mbox, github: "konimarti/elixir-mbox"}
]
end
```
## Usage
#### Parse mbox files
```elixir
{:ok, body} = File.read("path/to/mboxfile")
messages = Mbox.Parser.parse(body)
```
#### Render mbox files
```elixir
output = Mbox.Renderer.render(messages)
```
#### In combination with elixir-mail
```elixir
{:ok, body} = File.read("path/to/mboxfile")
mails =
body
|> Mbox.Parser.parse
|> Enum.map(&Mail.Parsers.RFC2822.parse/1)
```