Added integration test to ensure that mail objects are handled like files