From b20b725cd6e392cd81be30225dd3e5b418034935 Mon Sep 17 00:00:00 2001 From: Oneric Date: Mon, 12 Feb 2024 21:33:50 +0100 Subject: [PATCH 1/2] readme: tls_options is no longer filtered dd7a0008f8466f1e3d0b8104e5d51344d1c772dc removed the filtering to allow using options from newer OTP releases. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fd6779c..ff74d08 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,7 @@ The `send` method variants `send/2, send/3, send_blocking/2` take an `Options` a * **auth** whether the smtp server needs authentication. Valid values are `if_available`, `always`, and `never`. Defaults to `if_available`. If your smtp relay requires authentication set it to `always` * **ssl** whether to connect on 465 in ssl mode. Defaults to `false` * **tls** valid values are `always`, `never`, `if_available`. Most modern smtp relays use tls, so set this to `always`. Defaults to `if_available` - * **tls_options** used in `ssl:connect`, More info at [Erlang documentation - ssl](https://www.erlang.org/doc/man/ssl.html). Defaults to `[{versions , ['tlsv1', 'tlsv1.1', 'tlsv1.2']}]`. This is merged with options listed at: [smtp_socket.erl#L50 - SSL_CONNECT_OPTIONS](https://github.com/gen-smtp/gen_smtp/blob/master/src/smtp_socket.erl#L50) . Any options not present in this list will be ignored. + * **tls_options** used in `ssl:connect`, More info at [Erlang documentation - ssl](https://www.erlang.org/doc/man/ssl.html). Defaults to `[{versions , ['tlsv1', 'tlsv1.1', 'tlsv1.2']}]`. This is merged with options listed at: [smtp_socket.erl#L50 - SSL_CONNECT_OPTIONS](https://github.com/gen-smtp/gen_smtp/blob/master/src/smtp_socket.erl#L50) . * **hostname** the hostname to be used by the smtp relay. Defaults to: `smtp_util:guess_FQDN()`. The hostname on your computer might not be correct, so set this to a valid value. * **retries** how many retries per smtp host on temporary failure. Defaults to 1, which means it will retry once if there is a failure. * **protocol** valid values are `smtp`, `lmtp`. Default is `smtp` From b4048e6c7dda0c20bb1a1b277d155d489f26e29e Mon Sep 17 00:00:00 2001 From: Oneric Date: Mon, 12 Feb 2024 21:39:43 +0100 Subject: [PATCH 2/2] readme: document sockopts And make it clear tls_options is only used for later STARTTLS upgrades. --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ff74d08..07e6cb4 100644 --- a/README.md +++ b/README.md @@ -83,8 +83,9 @@ The `send` method variants `send/2, send/3, send_blocking/2` take an `Options` a * **password** the password of the smtp relay e.g. `"mypassword"` * **auth** whether the smtp server needs authentication. Valid values are `if_available`, `always`, and `never`. Defaults to `if_available`. If your smtp relay requires authentication set it to `always` * **ssl** whether to connect on 465 in ssl mode. Defaults to `false` + * **sockopts** used for the initial plain or SSL/TLS TCP connection. More info at Erlang documentation [gen_tcp](https://www.erlang.org/doc/man/gen_tcp.html) and [ssl](https://www.erlang.org/doc/man/ssl.html). Defaults to `[binary, {packet, line}, {keepalive, true}, {active, false}]`. * **tls** valid values are `always`, `never`, `if_available`. Most modern smtp relays use tls, so set this to `always`. Defaults to `if_available` - * **tls_options** used in `ssl:connect`, More info at [Erlang documentation - ssl](https://www.erlang.org/doc/man/ssl.html). Defaults to `[{versions , ['tlsv1', 'tlsv1.1', 'tlsv1.2']}]`. This is merged with options listed at: [smtp_socket.erl#L50 - SSL_CONNECT_OPTIONS](https://github.com/gen-smtp/gen_smtp/blob/master/src/smtp_socket.erl#L50) . + * **tls_options** used for `STARTTLS` upgrades in `ssl:connect`, More info at [Erlang documentation - ssl](https://www.erlang.org/doc/man/ssl.html). Defaults to `[{versions , ['tlsv1', 'tlsv1.1', 'tlsv1.2']}]`. This is merged with options listed at: [smtp_socket.erl#L50 - SSL_CONNECT_OPTIONS](https://github.com/gen-smtp/gen_smtp/blob/master/src/smtp_socket.erl#L50) . * **hostname** the hostname to be used by the smtp relay. Defaults to: `smtp_util:guess_FQDN()`. The hostname on your computer might not be correct, so set this to a valid value. * **retries** how many retries per smtp host on temporary failure. Defaults to 1, which means it will retry once if there is a failure. * **protocol** valid values are `smtp`, `lmtp`. Default is `smtp`