def matches?(rules)
      rules = Array(rules)
      rules.each do |rule|
        if rule.include?("/")
          return rule if self.in_cidr?(rule)
        else
          self.each {|mx| return rule if mx[:host].end_with?(rule) }
        end
      end
      false
    end
def matches?(rules)
      rules = Array(rules)
      rules.each do |rule|
        if rule.include?("/")
          return rule if self.in_cidr?(rule)
        else
          self.each {|mx| return rule if mx[:host].end_with?(rule) }
        end
      end
      false
    end
Simple matcher, takes an array of CIDR addresses (ip/bits) and strings.
 Returns true if any MX IP matches the CIDR or host name ends in string.
 Ex: match?(%w(127.0.0.1/32 0:0:1/64 .yahoodns.net))
 Note: Your networking stack may return IPv6 addresses instead of IPv4
 when both are available. If matching on IP, be sure to include both
 IPv4 and IPv6 forms for matching for hosts running on IPv6 (like gmail).