lib/banhammer.rb
####
# Returns 'true' if any matches are found, returns 'false' if no matches are found
####
Returns 'true' if any matches are found, returns 'false' if no matches are found
Returns ' true ' if any matches are found returns ' false ' if no matches are found
def check_email(email)
      domain = email[/@\w+[\.](\S+)/, 0].downcase
      tld = domain[/[.]\w+\z/,0].downcase
      multiple_domains = Array.new
      if domain.match(/\w+\.\w+\.\w+\z/) 
        subdomains = domain.split('.').reverse
        tmp = '.' + subdomains[1] + '.' + subdomains[0]
        subdomains.drop(2).each do |s|
          unless s.match(/@/) then multiple_domains << '.' + s + tmp end
        end
      end
      if @email_filter_list.include?(domain) || @email_filter_list.include?(email) || @email_filter_list.include?(tld) || (multiple_domains & @email_filter_list).empty? == false
        return true
      end
      false
    end
def check_email ( email ) domain = email [ / @ \w +[ \. ]( \S +) / , 0 ] . downcase tld = domain [ / [.] \w + \z / , 0 ] . downcase multiple_domains = Array . new if domain . match ( / \w + \. \w + \. \w + \z / ) subdomains = domain . split ( '.' ) . reverse tmp = '.' + subdomains [ 1 ] + '.' + subdomains [ 0 ] subdomains . drop ( 2 ) . each do | s | unless s . match ( / @ / ) then multiple_domains << '.' + s + tmp end end end if @email_filter_list . include? ( domain ) || @email_filter_list . include? ( email ) || @email_filter_list . include? ( tld ) || ( multiple_domains & @email_filter_list ) . empty? == false return true end false end
Returns 'true' if any matches are found, returns 'false' if no matches are found
Returns ' true ' if any matches are found returns ' false ' if no matches are found
email
<not_specific>