You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/mail/network/delivery_methods/smtp.rb
+13-3Lines changed: 13 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ module Mail
22
22
# :user_name => '<username>',
23
23
# :password => '<password>',
24
24
# :authentication => 'plain',
25
-
# :enable_starttls_auto => true }
25
+
# :enable_starttls => :auto }
26
26
# end
27
27
#
28
28
# === Sending via GMail
@@ -34,9 +34,17 @@ module Mail
34
34
# :user_name => '<username>',
35
35
# :password => '<password>',
36
36
# :authentication => 'plain',
37
-
# :enable_starttls_auto => true }
37
+
# :enable_starttls => :auto }
38
38
# end
39
39
#
40
+
# === Configuring TLS/SSL and STARTTLS
41
+
#
42
+
# A few remarks:
43
+
# - when enabling `tls` (or `ssl`), setting (truthy values for) either `enable_starttls` or `enable_starttls_auto` will raise an ArgumentError as TLS and STARTTLS are mutually exclusive.
44
+
# - to configure STARTTLS, use the `enable_starttls`-flag (instead of a combination of `enable_starttls` and `enable_starttls_auto`). Acceptable values are `:always`, `:auto` and `false`.
45
+
# - when providing a truthy value for `enable_starttls`, the `enable_starttls_auto`-flag will be ignored.
46
+
# - when none of `tls`, `ssl`, `enable_starttls` or `enable_starttls_auto` is set, the fallback will be `enable_starttls` `:auto`.
47
+
#
40
48
# === Certificate verification
41
49
#
42
50
# When using TLS, some mail servers provide certificates that are self-signed
@@ -112,6 +120,8 @@ def setting_provided?(k)
112
120
113
121
# Yields one of `:always`, `:auto` or `false` based on `enable_starttls` and `enable_starttls_auto` flags.
114
122
# Yields `false` when `smtp_tls?`.
123
+
# Else defaults to `:auto` when neither `enable_starttls*` flag is provided.
124
+
# Providing a truthy value for `enable_starttls` will ignore `enable_starttls_auto`.
0 commit comments