module Net::IMAP::StringFormatter

def valid_string?(str)

Allows symbols in addition to strings
def valid_string?(str)
  str.is_a?(Symbol) || str.respond_to?(:to_str)
end