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: mail_starttls_patch.rb
    path of file: ./repos/gitlabhq/config/initializers
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

require 'mail/network/delivery_methods/smtp'

# Monkey patch mail 2.8.1 to make it possible to disable STARTTLS.
# without having to change existing settings.
# This brings in changes from https://github.com/mikel/ma
    
    def smtp_starttls
      return false if smtp_tls?

      if setting_provided?(:enable_starttls) && settings[:enable_starttls]
        # enable_starttls: provided and truthy
        case settings[:enable_starttls]
        when :auto then :auto
        when :always then :always
        else
          :always
        end