Moved the imapdb auth and errror catching into a util file.