close #13, smarter email handling