class Object

Constants

VALID_HOSTNAME_REGEX

Regex to verify a valid hostname per RFC 1123.

Public Instance Methods

validate_address(input) click to toggle source
# File lib/raw_smtp/validator.rb, line 6
def validate_address(input)
  if input.match(VALID_HOSTNAME_REGEX) || input.match(Resolv::IPv4::Regex)
    input
  else
    nil
  end
end