python email shutdown