package async_smtp

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file session.ml

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
open! Core
open! Async
open Async_ssl.Std
open Async_smtp_types

type t =
  { remote : Socket.Address.Inet.t
  ; local : Socket.Address.Inet.t
  ; helo : string option
  ; tls : Ssl.Connection.t option
  ; authenticated : string option
  ; advertised_extensions : Smtp_extension.t list
  }
[@@deriving sexp_of]

let create ~remote ~local ?helo ?tls ?authenticated ?(advertised_extensions = []) () =
  { remote; local; helo; tls; authenticated; advertised_extensions }
;;

let cleanup t =
  match t.tls with
  | None -> return (Ok ())
  | Some tls ->
    Ssl.Connection.close tls;
    Ssl.Connection.closed tls
;;
OCaml

Innovation. Community. Security.