Improve robustness of email handling