Skip to content

Commit

Permalink
Merge pull request #63 from nevans/sasl/public-auth_capable
Browse files Browse the repository at this point in the history
Make `#auth_capable?` public
  • Loading branch information
tmtm authored Nov 4, 2023
2 parents 4b94205 + 6d51323 commit bb0c273
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 @@ -316,12 +316,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 bb0c273

Please sign in to comment.