-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
opam
93 lines (78 loc) · 3.07 KB
/
opam
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
opam-version: "2.0"
synopsis: "[Images](https://youtube.com/watch?v=S70NaQqAfaw))"
description: """
[![Build Status](https://travis-ci.org/dinosaure/emile.svg?branch=master)](https://travis-ci.org/dinosure/emile)
![MirageOS](https://img.shields.io/badge/MirageOS-%F0%9F%90%AB-red.svg)
Emile is a library to parse an e-mail address in OCaml. This project is an
extraction of [MrMime](https://github.com/oklm-wsh/MrMime.git) - but we use
[Angstrom](https://github.com/inhabitedtype/angstrom.git) instead of an
internal decoder.
This implementation follow some RFCs:
- [RFC 822](https://www.ietf.org/rfc/rfc822.txt)
- [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt)
- [RFC 5321](https://www.ietf.org/rfc/rfc5321.txt) (domain part)
- [RFC 5322](https://www.ietf.org/rfc/rfc5322.txt)
- [RFC 6532](https://www.ietf.org/rfc/rfc6532.txt)
We handle UTF-8 ([RFC 6532](https://www.ietf.org/rfc/rfc6532.txt)), domain
defined on the SMTP protocol ([RFC 5321](https://www.ietf.org/rfc/rfc5321.txt)),
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](https://github.com/mirage/ipaddr.git).
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](https://github.com/dinosaure/emile/blob/master/test/test.ml)."""
maintainer: "Romain Calascibetta <romain.calascibetta@gmail.com>"
authors: "Romain Calascibetta <romain.calascibetta@gmail.com>"
license: "MIT"
homepage: "https://github.com/dinosaure/emile"
doc: "https://dinosaure.github.io/emile/"
bug-reports: "https://github.com/dinosaure/emile/issues"
depends: [
"ocaml" {>= "4.03.0"}
"dune"
"angstrom" {>= "0.9.0" & < "0.14.0"}
"ipaddr" {>= "2.7.0"}
"base64" {>= "3.0.0"}
"pecu" {>= "0.3"}
"uutf" {>= "1.0.0"}
"fmt" {>= "0.8.5"}
"alcotest" {with-test}
]
build: [
["dune" "subst"] {dev}
["dune" "build" "-p" name "-j" jobs]
["dune" "runtest" "-p" name "-j" jobs] {with-test}
]
dev-repo: "git+https://github.com/dinosaure/emile.git"
url {
src:
"https://github.com/dinosaure/emile/releases/download/v0.4/emile-v0.4.tbz"
checksum: [
"sha256=6a3f88bfdd3781f360a150638d4ec92888b92a78aa747153a3aab782462bb588"
"sha512=c24ec80fc9f09c285e19a254f429e2ca131c73d26a1a6281ffa5425a3901465fce5903a008fa774d159b9959db5481958bc9af4e85cb99ac945f5a4d6e9dfc3d"
]
}