email working, and a small bash fix