package emile

  1. Overview
  2. Docs
Parser of email address according RFC822

Install

Dune Dependency

Authors

Maintainers

Sources

emile-v1.1.tbz
sha256=1759253996b53b84ff1a2b76ff30c3614bc61cb02ff8a500480be4a96a202164
sha512=b53df652cd9c585d2720cf1ad6b877a11e3779b4edda08d6b965557721d46538cd10dd8a7a3a6316dc6a3785ae66167785529619e31f40e7dfde01faaf692c7f

Description

A parser of email address according RFC822, RFC2822, RFC5321 and RFC6532. It handles UTF-8 email addresses and encoded-word according RFC2047.

Published: 20 Nov 2020

README

Emile (& Images)

Emile is a library to parse an e-mail address in OCaml. This project is an extraction of mrmime.

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) without folding-whitespace.

Folding whitespace

According RFC 822, an e-mail address into an e-mail can be splitted by a folding-whitespace. However, this kind of form is not an usual case where user mostly wants to parse input from a form (for example). At the end, emile is not able to parse this kind of input:

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)"

However, a pre-process (like unstrctrd) can fold input and give you an usual output. emile can not be used into an e-mail context without this kind of pre-process.

Domain

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

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

It's possible to notify multiple domains for one local-part like this:

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

It's a valid form according RFC 882.

Comments

Even if we don't handle the folding-whitespace, we are able to discard comments.

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

Advise

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

Dependencies (8)

  1. uutf >= "1.0.0"
  2. bigstringaf >= "0.2.0"
  3. pecu >= "0.3"
  4. base64 >= "3.0.0"
  5. ipaddr >= "2.7.0"
  6. angstrom >= "0.14.0"
  7. dune >= "1.0"
  8. ocaml >= "4.03.0"

Dev Dependencies (1)

  1. alcotest with-test

Used by (8)

  1. functoria >= "4.0.0~beta1"
  2. git >= "3.0.0"
  3. letsencrypt-mirage
  4. mrmime >= "0.3.1"
  5. paf < "0.0.4"
  6. paf-le
  7. received >= "0.4.0"
  8. sendmail >= "0.4.0"

Conflicts

None