move email delivery detection out of apps