Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

& images

License

NotificationsYou must be signed in to change notification settings

mirage/emile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build StatusMirageOS

Emile is a library to parse an e-mail address in OCaml. This project is anextraction ofmrmime.

This implementation follow some RFCs:

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

Folding whitespace

According RFC 822, an e-mail address into an e-mail can be splitted by afolding-whitespace. However, this kind of form is not an usual case where usermostly wants to parse input from a form (for example). At the end,emile isnot 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 (likeunstrctrd) canfold input and giveyou an usual output.emile can not be used into an e-mail context without thiskind of pre-process.

Domain

Then, for domain part (explained on RFC 5321 - SMTP protocol), we handle thiskind of domain (IPv4 and IPv6 domain) withipaddr:

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 accordingRFC 882.

Comments

Even if we don't handle thefolding-whitespace, we are able to discardcomments.

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 looktests.


[8]ページ先頭

©2009-2025 Movatter.jp