package colombe

  1. Overview
  2. Docs
SMTP protocol in OCaml

Install

Dune Dependency

Authors

Maintainers

Sources

colombe-v0.6.0.tbz
sha256=914e25db190507f800fd17e34b5c73e34b581a151b7d0df9fc13f0577796cd88
sha512=e203add8b22a91f8bb5a967c3fe6e88ec27d124d3c36aef6751ba2ec2dcee3f5036469a866febaa944410e41dd48c899ac460cdba014568d8bd55ba2d41fecef

Description

SMTP protocol according RFC5321 without extension.

Published: 04 Jan 2022

README

Colombe - an implementation of SMTP protocol in OCaml

colombe is a little library which wants to implement the SMTP protocol according RFC5321. It is a low-level library used by some others projects to implements clients or servers.

The library does not handle properly an email. If you want to generate a proper email or introspect an email, you should be interested by mrmime.

As a client

The distribution provides sendmail, sendmail.starttls and sendmail-lwt which are respectively:

  • An agnostic (to the system) implementation of an usual client with authentication

  • An agnostic (to the system) implementation of an usual client with authentication and STARTTLS extension

  • An LWT implementation of an usual client with authentication

Depending on your context:

  • If you want to communicate with a SMTP server which require a TLS connection (like, *:465), sendmail with a scheduler such as LWT or ASYNC (or UNIX) should be use. sendmail-lwt is a specialization with LWT.

  • If you want to communicate with a SMTP server which handles (and surely requires) STARTTLS extension, (like *:587), sendmail.starttls with a scheduler should be use.

Of course, a client can be more complex and can handle:

  • file attachments

  • a well formed email

  • some usual metadata such as the timezone

If you are interested by that, you should look into facteur which wants to provide a little binary to send an email with a nice use between colombe, mrmime and some others MirageOS projects.

As a server

Of course, colombe implements both sides. By this library, you are able to implement an SMTP server - if you are interested by that, you should look into ptt.

How to use colombe

As we said, the library wants to be a low-level one. At least, the core does not handle properly eSMTP extensions or any high mechanisms such the authentication. It's mostly because the library wants to be used by a server implementation and a client implementation.

It only ensures a high abstracted interface on top of the low-level of the communication. The library defines only few parts of the SMTP protocol and a monadic interface to describe the state-machine while the communication with an other peer.

sendmail is a good example about how to use colombe. It describes structurally the SMTP protocol (only what it really needs) and the state machine to send an email.

Received field

RFC5321 describes the SMTP protocols and some mechanisms such as the Received: field. The distribution provides a way to introspect Received: fields (and can produce a graph of them) or generate them from a server configuration.

Credits

colombe has received funding from the Next Generation Internet Initiative (NGI) within the framework of the DAPSI Project.

Dependencies (6)

  1. ocaml-syntax-shims
  2. angstrom >= "0.14.0"
  3. ipaddr >= "3.0.0"
  4. fmt >= "0.8.9"
  5. dune >= "2.0.0"
  6. ocaml >= "4.03.0"

Dev Dependencies (2)

  1. crowbar >= "0.2" & with-test
  2. alcotest with-test

Used by (5)

  1. facteur
  2. letters >= "0.3.0" & < "0.3.3"
  3. received >= "0.5.0"
  4. sendmail = "0.6.0"
  5. uspf

Conflicts (1)

  1. emile < "0.8"