Add functionality to use a configuration file and fix issue of clean-up email being sent when no clean-up performed