make testemail.py more general