You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: email_settings_validator.rb
    path of file: ./repos/discourse/app/services
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

require "net/imap"
require "net/smtp"
require "net/pop"

# Usage:
#
# begin
#   EmailSettingsValidator.validate_imap(host: "imap.test.com", port: 999, username: "test@test.com", password: "password")
#
#   # or for specific host preset
#   EmailSettingsValidator.validate_imap(**{ username: "test@gmail.com", password: "test"
    
  def self.provider_specific_ssl_overrides(host, port, enable_tls, enable_starttls_auto)
    # Gmail acts weirdly if you do not use the correct combinations of
    # TLS settings based on the port, we clean these up here for the user.
    if host == "smtp.gmail.com"
      if port.to_i == 587
        enable_starttls_auto = true
        enable_tls = false
      elsif port.to_i == 465
        enable_starttls_auto = false
        enable_tls = true
      end
    end