Wrapped mail processing in a rescue block to ensure messages are not marked as done (or deleted) if an error occurs while processing.