Gmail script now has better error handling (supports disconnectivity).