An mbox parser in Gleam
Find a file
2024-07-28 18:48:44 +05:30
.github/workflows kinda sorta print headers 2024-03-23 19:08:06 +05:30
src Add Header type and use Header list in place of Mail.to 2024-07-28 18:48:44 +05:30
test start making everything a Result 2024-07-20 19:55:48 +05:30
.gitignore kinda sorta print headers 2024-03-23 19:08:06 +05:30
gleam.toml bump version 2024-07-20 21:01:15 +05:30
LICENSE add license 2024-03-24 10:32:17 +05:30
manifest.toml start making everything a Result 2024-07-20 19:55:48 +05:30
README.md update README with RFC list 2024-07-28 17:52:11 +05:30

mbox

Parse mbox files in Gleam.

WARNING: This library is a personal project to learn Gleam. It is extremely incomplete, barely works, highly un - optimized, and is NOT guaranteed to work, in present or future. I do intend to make it useable and utilise in another project, but right now, if you use it and it breaks stuff, you get to keep all the pieces. Be warned and prosper.

That said, there are multiple specs pertaining to the Internet Mail format (thanks to collect them in one place, mrmime):

  • RFC822: Standard For The Format of ARPA Internet Text Messages
  • RFC2822: Internet Message Format
  • RFC5321: Simple Mail Transfer Protocol
  • RFC5322: Internet Message Format
  • RFC2045: MIME Part One: Format of Internet Message Bodies
  • RFC2046: MIME Part Two: Media Types
  • RFC2047: MIME Part Three: Message-Header Extensions for Non-ASCII Text
  • RFC2049: MIME Part Five: Conformance Criteria and Examples
  • RFC6532: Internationalized Email Headers

So far, there is some progress with RFC 822, RFC2822 and RFC 4155. Vast majority of the spec of these RFCs and ALL of the rest of RFCs is yet to be implemented.

The codebase is in flux, as I continue to learn Gleam and get a hang of things, so beware before depending on this lib for anything serious. I am, however, open for suggestions on everything in here, so feel free to reach out by creating an issue or PR.

Package Version Hex Docs

gleam add mbox

TODOs:

  • Add example
  • Better error propagation
  • Handle multi-part MIME messages

Further documentation can be found at https://hexdocs.pm/gleambox.

Development

gleam run   # Run the project
gleam test  # Run the tests
gleam shell # Run an Erlang shell