Mail libs framework, Pass Rids from view to rules, add patches