@antispam_url_threshold = 3 unless @antispam_url_threshold
@spamlist = [
  /\AWell done!$/,
  /\AGreat (work|job)!+$/i,
  /\AThank you!$/,
  /\ANice site!$/,
  /\AGood design!$/,
  /\AGood site! Thanks\.$/,
  /\Agood day!$/,
  /\Adouble\z/,
  /\Athanks\z/,
  /\A<div /,
  /syite/,
  /xanax|viagra|adipex|phentemine|ultram|levitra|ambien|tramadol/i,
  /\AYou have a very interesting site\.\.\.$/,
  /\Athis is very good$/,
  /\AHi cool site friends!$/,
  /mabulle\.com/,
  /<a href\s*=/i,
  /<img>/i,
  /\[url=/,
  /podomatic\.com/,
  /Credit/,
  /Sale/i,
  /My best private site/,
  /piter-prostitutki\.ru/,
  /softsoftware\.ru/,
  /belstaff/,
  /outlet/,
  /FUCK/i,
  /hahaha/,
  /prada|lovelv|louisvuitton/,
  /diverticulosis/,
  /SEO/,
  /vibration/,
  /kermiteer/,
  /beckerundibach/,
  /ghthome/,
  /^http:\/\/[^\/]*\/.info$/,
  /pharmac/,
  /fashion des/,
  /football/i,
  /endometrosis/,
  /\/sitemap\.html$/,
  /windows7keys/,
  /xrumer/i,
  /\bgooooogle\.com\b/,
  /\bbodybuilders?\b/,
  /\bhttps?:\/\/[\w\.]\.ru\b/,
  /サイト/u,
  /it's ok/,
  /Rolls Royce/,
  /\bhttps?:\/\/.*gooseonline/,
  /\bFSBO\b/,
  /\bchad micael\b/,
]

@spamaddr = [
  /@mail\.com\z/,
  /\Ateddybear@gmail\.com\z/,
  /\Awandnara@bonbon\.net\z/,
  /@mail\.ru\z/,
  /@spambob\.com\z/,
  /@mailinator\.com\z/,
  /@live\.cn\z/,
  /\Amrtesla/,
  /\Akokozmani@/,
  /\A(?:.*\.){5,}.*@gmail\.com\z/,
  /\A198298637@qq\.com\z/,
  /@faceepicentre\.com\z/,
  /kazino/,
  /@hotmail\.com\z/,
  /@yahoo\.com\z/,
  /@gmail\.com\z/,
]

def antispam
end

def check_spam(contents, addr = nil)
  return true if addr && @spamaddr.find{|re| re =~ addr}
  return true if %r(\Ahttps?://[\w\./]+\z) =~ contents.strip
  return true if contents.scan(%r(https?://)).size > @antispam_url_threshold
  return true if @spamlist.find{|re| re =~ contents}
  false
end
