package emile

  1. Overview
  2. Docs
[Images](https://youtube.com/watch?v=S70NaQqAfaw))

Install

Dune Dependency

Authors

Maintainers

Sources

emile-v0.4.tbz
sha256=6a3f88bfdd3781f360a150638d4ec92888b92a78aa747153a3aab782462bb588
sha512=c24ec80fc9f09c285e19a254f429e2ca131c73d26a1a6281ffa5425a3901465fce5903a008fa774d159b9959db5481958bc9af4e85cb99ac945f5a4d6e9dfc3d

Description

Build Status MirageOS

Emile is a library to parse an e-mail address in OCaml. This project is an extraction of MrMime - but we use Angstrom instead of an internal decoder.

This implementation follow some RFCs:

We handle UTF-8 (RFC 6532), domain defined on the SMTP protocol (RFC 5321), and general e-mail address purpose (RFC 822, RFC 2822, RFC 5322) including folding-whitespace.

The last means we can parse something like:

A Group(Some people)
   :Chris Jones <c@(Chris's host.)public.example>,
     joe@example.org,
 John <jdoe@one.test> (my dear friend); (the end of the group)"

For a general purpose, it's not needed and is close e-mail purpose.

Then, for domain part (explained on RFC 5321 - SMTP protocol), we handle this kind of domain:

first.last@[12.34.56.78]
first.last@[IPv6:1111:2222:3333::4444:12.34.56.78]

The parser of IPv* is done by Ipaddr. As a old specification, we handle multiple-domains like:

<@a.com,b.com:john@doe.com>

Obviously, we handle (nested) comments:

a(a(b(c)d(e(f))g)h(i)j)@iana.org

All parsers are binded with a comment which explain where you can find the ABNF description and some notes about implementation. All was check by hands.

Advise

If you think it's easy to parse an e-mail address, you should look tests.

Published: 03 Jul 2019

README

Emile (& Images)

Emile is a library to parse an e-mail address in OCaml. This project is an extraction of MrMime - but we use Angstrom instead of an internal decoder.

This implementation follow some RFCs:

We handle UTF-8 (RFC 6532), domain defined on the SMTP protocol (RFC 5321), and general e-mail address purpose (RFC 822, RFC 2822, RFC 5322) including folding-whitespace.

The last means we can parse something like:

A Group(Some people)
   :Chris Jones <c@(Chris's host.)public.example>,
     joe@example.org,
 John <jdoe@one.test> (my dear friend); (the end of the group)"

For a general purpose, it's not needed and is close e-mail purpose.

Then, for domain part (explained on RFC 5321 - SMTP protocol), we handle this kind of domain:

first.last@[12.34.56.78]
first.last@[IPv6:1111:2222:3333::4444:12.34.56.78]

The parser of IPv* is done by Ipaddr. As a old specification, we handle multiple-domains like:

<@a.com,b.com:john@doe.com>

Obviously, we handle (nested) comments:

a(a(b(c)d(e(f))g)h(i)j)@iana.org

All parsers are binded with a comment which explain where you can find the ABNF description and some notes about implementation. All was check by hands.

Advise

If you think it's easy to parse an e-mail address, you should look tests.

Dependencies (8)

  1. fmt >= "0.8.5"
  2. uutf >= "1.0.0"
  3. pecu >= "0.3"
  4. base64 >= "3.0.0"
  5. ipaddr >= "2.7.0"
  6. angstrom >= "0.9.0" & < "0.14.0"
  7. dune
  8. ocaml >= "4.03.0"

Dev Dependencies (1)

  1. alcotest with-test

Used by (1)

  1. letters = "0.1.1"

Conflicts

None