generalize email rule processing