Skip to content
This repository has been archived by the owner on Dec 30, 2019. It is now read-only.

Raise SSL errors and respect action mailer's :enable_starttls_auto setting #10

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions lib/action_mailer/ar_sendmail.rb
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ def deliver(emails)

smtp = Net::SMTP.new(smtp_settings[:address], smtp_settings[:port])
if smtp.respond_to?(:enable_starttls_auto)
smtp.enable_starttls_auto unless smtp_settings[:tls] == false
smtp.enable_starttls_auto unless smtp_settings[:tls] == false || smtp_settings[:enable_starttls_auto] == false
else
settings << smtp_settings[:tls]
end
Expand Down Expand Up @@ -406,7 +406,7 @@ def deliver(emails)
log "authentication error, retrying: #{e.message}"
end
sleep delay
rescue Net::SMTPServerBusy, SystemCallError, OpenSSL::SSL::SSLError
rescue Net::SMTPServerBusy, SystemCallError
# ignore SMTPServerBusy/EPIPE/ECONNRESET from Net::SMTP.start's ensure
end

Expand Down