package sendmail

  1. Overview
  2. Docs
Implementation of the sendmail command

Install

dune-project
 Dependency

Authors

Maintainers

Sources

colombe-0.13.0.tbz
sha256=3d55b5baf77057239c1dc0a2893060303817c69f539c6f80d04f8f1c504cf24d
sha512=5eaa8ae98ce1d5bfd15e8093195492ec63b4b0277be63752428494d1090c6e7ceb54b7706b091ca6582b647f7ae4ce82c3cf475d61029855c0bc46d4762c61bb

doc/sendmail.starttls/Sendmail_with_starttls/index.html

Module Sendmail_with_starttlsSource

Sourcemodule Context_with_tls : sig ... end
Sourcemodule type VALUE = sig ... end
Sourcemodule Value : sig ... end
Sourcemodule type S = sig ... end
Sourcetype reverse_path = Colombe.Reverse_path.t
Sourcetype forward_path = Colombe.Forward_path.t
Sourcetype mechanism = Sendmail.mechanism
Sourcetype authentication = Sendmail.authentication
Sourcetype ('a, 's) stream = ('a, 's) Sendmail.stream
Sourcetype tmp_error = [
  1. | `Mailbox_unavailable
  2. | `Error_processing
  3. | `Action_ignored
  4. | `Unable_to_accomodate_parameters
]
Sourcetype error = [
  1. | `Protocol of [ Value.error | `Tls_alert of Tls.Packet.alert_type | `Tls_failure of Tls.Engine.failure | `Tls_closed ]
  2. | `Unsupported_mechanism
  3. | `Encryption_required
  4. | `Weak_mechanism
  5. | `Authentication_rejected
  6. | `Authentication_failed
  7. | `Authentication_required
  8. | `STARTTLS_unavailable
  9. | `Temporary_failure of tmp_error
]
Sourceval pp_error : error Fmt.t
Sourcetype 's streams = (string * int * int, 's) stream Seq.t
Sourceval sendmail : 's Colombe.Sigs.impl -> ('flow, 's) Colombe.Sigs.rdwr -> 'flow -> Context_with_tls.t -> Tls.Config.client -> ?authentication:authentication -> domain:Colombe.Domain.t -> reverse_path -> forward_path list -> (string * int * int, 's) stream -> ((unit, error) result, 's) Colombe.Sigs.io

sendmail impl rdwr flow ctx tls_config ?authentication ~domain sender recipients mail where:

  • impl is the scheduler (unix, lwt or async)
  • rdwr read/write syscall
  • flow witness of the flow (can be a socket)
  • ctx context used by the process
  • tls_config TLS configuration used by STARTTLS
  • authentication authentication information used by the process
  • sender sender of the mail
  • recipients recipients of the mail
  • mail stream of the mail

This process tries to send a mail according RFC4409. It ensures to use STARTTLS (eg. RFC3207) while the process according TLS configuration tls_config. If authentication is given, it does the authentication only while TLS flow. Mail is sended only while TLS flow.

The stream mail must respects same assumptions as Sendmail_lwt.sendmail.

Sourceval many : 's Colombe.Sigs.impl -> ('flow, 's) Colombe.Sigs.rdwr -> 'flow -> Context_with_tls.t -> Tls.Config.client -> ?authentication:authentication -> domain:Colombe.Domain.t -> (reverse_path * forward_path) list -> (string * int * int, 's) stream Seq.t -> (((reverse_path * forward_path * (unit, error) result) list, error) result, 's) Colombe.Sigs.io

many impl rdwr flow ctx tls_config ?authentication ~domain transactions sends multiple emails over a single TCP+STARTTLS connection. Each transaction is a (sender, recipients, mail) tuple. The connection is set up once (EHLO, STARTTLS, AUTH), then for each transaction: MAIL FROM, RCPT TO, DATA, body, DOT, RSET. Returns a list of results, one per transaction. If a transaction fails, the connection is reset and the next transaction is attempted.