more general improvements
first draft of check_mail script