[mail] Fixes, criteria unification and optimization.