Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Net::SMTP#start tls_verify and tls_hostname options in Ruby 3 #1460

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion lib/mail/network/delivery_methods/smtp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,25 @@ def deliver!(mail)

private
def start_smtp_session(&block)
build_smtp_session.start(settings[:domain], settings[:user_name], settings[:password], settings[:authentication], &block)
if RUBY_VERSION >= '3.0'
build_smtp_session.start(
settings[:domain],
settings[:user_name],
settings[:password],
settings[:authentication],
tls_hostname: settings[:tls_hostname],
tls_verify: settings[:tls_verify],
&block
)
else
build_smtp_session.start(
settings[:domain],
settings[:user_name],
settings[:password],
settings[:authentication],
&block
)
end
end

def build_smtp_session
Expand Down