Skip to content

Commit

Permalink
Merge branch 'sasl/public-auth_capable' into HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
nevans committed Oct 21, 2023
2 parents 4f9e040 + 6d51323 commit 86745c1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/net/smtp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -324,12 +324,13 @@ def capable_cram_md5_auth?
auth_capable?('CRAM-MD5')
end

# Returns whether the server advertises support for the authentication type.
# You cannot get valid result before opening SMTP session.
def auth_capable?(type)
return nil unless @capabilities
return false unless @capabilities['AUTH']
@capabilities['AUTH'].include?(type)
end
private :auth_capable?

# Returns supported authentication methods on this server.
# You cannot get valid value before opening SMTP session.
Expand Down

0 comments on commit 86745c1

Please sign in to comment.